This page is mostly a response to a recently posted long multi-part question which was asked in an old thread. Since the question is not really related to that other thread, and since the answer is likely to be interesting to a wider audience, I'm starting a new thread on the topic.
Note: this reply has many instances of URLs that access the Yun. I will use the address "arduino.local" since that is the default network name for a new Yun. The "arduino" portion of the name can be changed during the initial setup of your new Yun, in which case you should substitute your Yun's name. For example, if you named your Yun "MyYun" then you would want to use "MyYun.local" wherever this discussion uses "arduino.local". Also, some computers don't have the necessary software to be able to decode these names, so you may have to substitute the IP address of your Yun, using something like "192.168.1.123" in place of "arduino.local".
jumpjack:
I can't find in the sample page a descritpion on how the web page must be set up to send proper commands to the sketch, any help?
You're probably having trouble because there are many ways to do it. Which method is best depends you your individual goals. More discussion on that later, after I address a few more questions.
Additionally, I don't understand when the page talks about "REST" (I know POST and GET) and the required password...
That's a reasonable definition of REST, but probably doesn't help you much. The easiest way to think of it is that you are performing an HTTP GET operation with a URL that can be easily parsed. When the Yun receives any request that has a URL that starts with [color=blue]http://arduino.local/arduino/[/color], the rest of the URL string is passed to the sketch via a YunServer/YunClient object. For example, when running the Bridge Example, an incoming request of [color=blue]http://arduino.local/arduino/digital/13/1[/color] will pass the string [color=blue]digital/13/1[/color] to the YunClient object, which will be decoded by the sketch and end up calling the function digitalWrite(13,1).
The Bridge Example implements a fairly simple and generic API. You are free to define any kind of command/request API that you wish, it's all a matter of how you write the sketch that decodes it and responds to it.
Isn't there an index of yun-related tutorials, or a single step-by-step Yun guide?
There are some pages that give some good overall information on the Yun, but you won't find a single step-by-step guide because there are so many things that you can do with the Yun, and so many ways to do it. For example, even your simple question about sending commands to a sketch can be done many ways. But good initial reading is:
- Yun Product Information
- Guide to the Arduino Yun
- Arduino Yun Playground
The Examples page lists many good examples for the Yun, under the "Bridge Library" heading.
In addition, Jesse has started to collect some useful information here: 3rd Party Projects for the Yun
Till now what I understood and what I miss is:
- Create a suitable webpage (how??)
That's a really broad question, and out of scope for this forum. You can write raw HTML pages in any text editor, you can use HTML editors that simplify the process, or many word processors (such as Microsoft Office Word) lets you save documents as HTML pages (although the results are often messy.) And what you should put in the web page is totally up to you. Searching the web on creating web files will inundate you with information. But discussing it here is overly broad and off-topic.
- Setup a [yunname].local/ address (how?? is it done by Arduino IDE installer or what? Can I setup such address by installing just the ZIP version of the IDE?)
You give your Yun a name during it's initial configuration. The configuration process is spelled out here. The name you enter in the "YUN NAME" field becomes the network name of the device. For example, if you enter "MyYun" in that field, the resulting network name will be MyYun.local.
- Can I connect by WiFi to a Yun not connected to internet?
Yes. Of course, to communicate with the Yun, it needs to be connected to a network, but that network does not necessarily need to be connected to the Internet. That being said, certain functionality will need an Internet connection, such as running opkg on the Linux side to install software, and accessing remote services like Temboo or cloud data servers.