How to setting Arduino yun

Dear All

Hi, My name is Yootthapong

Now, I have Arduino yun. I have problem step config for sent data from Arduino yun to P.C. Now, I can connect communicate from P.C to arduino yun is O.K. But reverse I can’t config sent signal or data from Arduino yun to P.C. It my idea is following attach file.

Please help me for setting programming.

Thank you.

Yootthapong.W
:blush: :blush:
=( =( =(

Click "Report to Moderator" in this reply and ask the Moderator to move your Thread to the Yun section of the Forum.

...R

Dear Robin2 and pepe

Thank you very much for information to help me. I will be tested on the information provided.

pepe: A small schema to remind how it is working :

..................................................................

Dear Pepe

From , http://forum.arduino.cc/index.php?topic=265597.msg1873949#msg1873949 The Arduino environment provides some examples of programs. In the menu File > Examples > Bridge, you can find the Bridge example, which permit to transmit the states of input pins to a PC thru the Wifi interface.

Once the Bridge example is programmed into the Arduino Yún, and since the Wifi interface is acting as a web server, the PC has to ask for the reading of a particular input pin each time it is required, using a web request.

The default IP address of the Yún is 192.168.240.1, and the web requests look like :

http://192.168.240.1/arduino/analog/2 to get the analog level (voltage) on the analog input pin #A2 http://192.168.240.1/arduino/analog/9/128 to set the analog level (PWM) of the digital output pin #9 to 128 http://192.168.240.1/arduino/digital/13/1 to set digital output #13 to HIGH http://192.168.240.1/arduino/digital/2/0 to set digital output #2 to LOW http://192.168.240.1/arduino/digital/11 to get the logic level of the digital input #11 http://192.168.240.1/arduino/mode/11/input to make the pin #11 acting as an INPUT http://192.168.240.1/arduino/mode/3/output to make the pin #11 acting as an OUTPUT

You can directly type such requests in the adress bar of your web browser. You can also make a PC program (for instance written in Javascript inside a HTML file) to send such requests in order to get the sensor measurements automatically.

I take step is 1. Connect wifi Arduino yun 2. Open Arduino software. and config borad and port to be 192.168.240.1 3. I take clik in the menu File > Examples > Bridge > Bridge 4. Upload source code. 5. Open webpage 192.168.240.1 and input password. 6. Open http://192.168.240.1/arduino/analog/2 is you provide to me. I don't know to user name and password to log in. when I input "arduino" word to user and password. is passed but webpage is bank ( White screen) . I don't know for open for application read analog sensor to P.C.

Please help me.

I would like to your email address for sent information.

Sorry for my writing , so very pool.

Yootthapong

Dear Pepe

Thank you very much.

Yootthapong

pepe:

yootthapong: 5. Open webpage 192.168.240.1 and input password. 6. Open http://192.168.240.1/arduino/analog/2 is you provide to me. I don't know to user name and password to log in. when I input "arduino" word to user and password. is passed but webpage is bank ( White screen) . I don't know for open for application read analog sensor to P.C.

By default, the login is "root", and the password is "arduino".

yootthapong: I would like to your email address for sent information.

Sorry, but I do not provide private consulting nor engineering services over Internet.

The information about the issues we are dealing with on the forum are intended to be public, so that everybody can participate to the discussion and benefit from the answers.

yootthapong: Sorry for my writing , so very pool.

My English is not good either. But the important thing is we can understand each other. ;)

Dear Pepe

I take input user is "root" and "arduino" password ready . When i open http://192.168.240.1/arduino/analog/2 .It is show Pin A2 reads analog 352. I don't sure this page is Ok. or correct.

Pls, I would like to know example for correct webpage ( or capture picture show) .

Thank you very much.

Yootthapong

Dear Pepe

Thank you very much for information to help me.

:) :) :open_mouth: :open_mouth:

Yootthapong

pepe:
The result is correct, since this is the kind of response sent by the Bridge example sketch.

The returned value corresponds to the ratio between the input voltage on the analog pin and the ADC reference voltage on pin AREF, multiplied by 1024 (i.e. 210, because it’s a 10-bit ADC).

So when the ADC reads a value N, the voltage on the analog pin is V = N×VAREF/1024 .

If the reference voltage is VAREF = 5 V (which is the theoretical default value), then 352 corresponds to a 352×5/1024 ? 1.719 V voltage on pin A2.

This is an example of a circuit getting the position of a potentiometer :

The sketch is just an example. One can adapt it to get a response fitting the real needs of the project.

.

Dear Pepe

From your direction the result is O.K. when i take input 5 V. the webpage is show Vref =1023 and input 0 V. the webpage is show Vref = 0 . But I just take push F5 button every time per change input voltage for refresh and change value in Vref in webpage.

The final In the project, I have ideal monitoring graph real time. (In attach picture)
How to can help me for information to success in the project.

Please. :blush: :blush:

Yootthapong
:slight_smile: :slight_smile:

Dear Pepe.

Now , I tested system for sent data between Arduino and Computer. 1. I sent sine wave 1 Hz to 150 Hz from function generator sent to Arduino. 2. From Aruduino yun sent data to computer by Web server ( by Http Client library) 3. It step 1-2 is working O.K.

Now , I have problem for frequency Sampling time for sent data to wireless system . before i test between arduino and computer . I want sampling data time from arduino every about 1 mSec. time. because systems Web server want response . it is system need wait response is slow and very delay for high frequency .

How to setting for sent data from arduino to computer to be no need response for high sampling time. and show graph is very solution.

Thank you.

Yootthapong.W

pepe: It is possible to send HTTP requests to the Arduino Yún recursively from the PC, using a HTML web page running Javascript.

On the other hand, thanks to HTML 5, one can draw graphics in a canvas on the web page, corresponding to the data received from the Arduino.

For further information, see this link about the XMLHttpRequest object, and this link and this one about the Canvas object.

Please help me

Sorry I don't understand the question. Can you rephrase it?

[quote author=Federico Fissore link=topic=265597.msg1919339#msg1919339 date=1413217896] Sorry I don't understand the question. Can you rephrase it? [/quote]

Dear Federico Fissore

I'm sorry for my writing. Now , I have question for sent data from A/D Port (0-1023) of Arduino yun to Web server ( By HTTP Client library)

It my step is following below : 1. I take generated Sine wave from Function generator to Arduino yun at amplitude 0-5 Vp-p. 2. The Arduino yun sent data by Wireless system to web server (HTTP: Client Library) 3. From web server is response following by analog input is OK. I create Graph for show Level Voltage and time.

My Question is

  1. My sampling time from arduino yun sent data to web server is very low. The graph can not show sine wave for more then 2 Hz. I want take sampling time for sent data every 1 mSec or 0.001 Sec. ( Now i can sent data maximum is 10 point per 1 Sec.) for creating sine wave graph is about 150 Hz. is beautiful graph.

How setting for sent data is high sampling time.

Please help me.

Yootthapong.w

So you want the yun to call your webserver 1000 times per second, is that right?

If so, you ain't gonna make it: it's too much, for the yun and for many webservers out there. You can achieve better performance by tweaking the yun hard, but ask yourself: is the effort worth of the architecture you want to use (that is: yun calling an external web page) ?

Someone, months ago, has made a custom version of the Bridge that saves its shared storage on a local database. That could do: you still need to tweak the yun but at least there is not network involved

It sounds like you are sending one sample per request? If so, I agree with Federico: you are asking too much of the network to make that many requests per second. There is a lot of overhead involved in contacting the server, the server accepting the connection, sending request headers, processing the data, receiving response data, then closing the connection. Then you want to do it all over again a millisecond later? It's not the Yun that is the limitation, you're just asking too much of the network because you're trying to do a lot more work than is necessary.

Suppose you're giving a book to a friend. Do you take the first page over, knock on his door, wait form him to answer, give him the first page, say goodbye, then go home to get the next page and start it over again? Of course not, you take the whole book over at once.

You should consider doing the same thing here. Have the Yun collect a bunch of samples, and store them in an array in RAM. Then when you have a few hundred samples, make the connection to the server and send them all at once. You will be spending more time actually sending data, and less time sending all of the overhead to open and close connections so often.