🛠 Connecter la Yún au WiFi et piloter une broche depuis le navigateur
Objectives
Leverage the Yún's networking capabilities: connect to its "Arduino Yun" WiFi access point (restore mode), access the built-in configuration page, join your home network, and control a digital pin directly via a URL — without writing a single line of code, thanks to the REST API embedded in Linino OS.
Hardware
- 1 Arduino Yún + 5 V USB power supply (or 7–12 V jack)
- A PC/smartphone connected to the same network as the board
- 1 LED + 330 Ω resistor on pin 13 (or the built-in "L" LED)
- Optionally, an Ethernet cable for initial troubleshooting if WiFi fails
Complete Procedure
- Power on the Yún. For approximately 20 seconds during startup, it broadcasts an open WiFi network named Arduino Yun (restore mode). Connect to it (password: WiFi is open on first boot, then protected by the default admin password "yun" — depending on the Linino OS version).
- Open http://arduino.local (or the IP address displayed on the captive portal page). The configuration panel asks for the root password (default:
yun). - In the WiFi configuration tab: select your network, enter the key, and confirm. The board restarts and joins your access point.
- Test the REST API directly in your browser (pin 13 set as output):
# Mettre la pin 13 en sortie, niveau HIGH :
http://arduino.local/arduino/digital/13/1
# Niveau LOW :
http://arduino.local/arduino/digital/13/0
# Lecture d'une broche numérique (réponse texte) :
http://arduino.local/arduino/digital/7
These routes work WITHOUT a specific sketch on the 32U4: the Bridge service on the Linux side drives the pins directly, provided that a sketch with Bridge.begin (or the BridgeYunServer example sketch) keeps the bridge alive. This is the quickest way to verify that the 32U4 ↔ AR9331 duo is communicating (they talk via the internal serial port, pins 0/1 of the 32U4).
Expected Verification
http://arduino.local responds → Linux is online and reachable. The command /arduino/digital/13/1 turns the LED on instantly; /13/0 turns it off. From a terminal: curl http://arduino.local/arduino/digital/13/1 does the same thing. If arduino.local does not respond (mDNS resolution can be flaky on Windows), use the IP address displayed on the configuration page.
Common Errors
- Missing the first 20-second window: the "Arduino Yun" network only appears at startup (or after holding the WiFi button for a long time — hold it for ~30 seconds to force restore mode).
- Forgetting that a sketch must keep the Bridge alive: the /arduino/* routes require the Bridge service to be active on the 32U4; upload at least the BridgeYunServer example sketch.
- Root password changed and then forgotten: the WiFi restore button does NOT reset the root password — you must then reinstall Linino OS (see the advanced recovery tutorial).
- Two Yún boards on the same network: arduino.local causes a collision (mDNS); name them or use their IP addresses.
- WiFi is limited to 2.4 GHz 802.11 b/g/n (AR9331 radio): pure 5 GHz networks are invisible.
Other tutorials for this board
- Premiers pas sur la Yún : Bridge, Console et LED
- Envoyer un capteur analogique sur le réseau : potentiomètre et Bridge REST
- runShellCommandOnLinux : faire exécuter des commandes Linux depuis le sketch
- L'API REST du Bridge en détail : /arduino, /data et routes personnalisées
- Alerte email : bouton sur la Yún et envoi via sendmail
- Serveur web embarqué : YunServer, YunClient et pages dynamiques
Code examples for this board
clignotant-rest.inoArduinoconsole-bridge.inoArduinovaleurs-partagees.inoArduinoprocess-shell.inoArduinoserveur-json.inoArduinolecture-fichier.inoArduino