🛠 Premiers pas sur la Yún : Bridge, Console et LED
Objectives
Get to know the most atypical board in the Arduino ecosystem: the Yún combines an ATmega32U4 microcontroller (16 MHz, same family as the Leonardo) and an Atheros AR9331 network SoC (WiFi + Ethernet) running a Linux distribution based on OpenWrt, called Linino OS. This first tutorial lays the foundations: initializing the Bridge library, communicating with the Serial Monitor via Console, and blinking the built-in LED.
Hardware
- 1 Arduino Yún board (Yún Mini / Plus use the same libraries)
- 1 micro-USB cable (the ATmega32U4 handles USB natively, just like on the Leonardo)
- PC with Arduino IDE (the Yún is a standard "AVR" board from the upload perspective)
- Optional: LED + 330 Ω resistor on pin 13
Complete Code
// Blink version Yún : Bridge + Console au lieu de Serial.
#include <Bridge.h>
const uint8_t LED = 13;
void setup {
// Sur Yún, ne PAS mettre de while(!Serial) : le port est l'USB natif du 32U4,
// mais le Bridge, lui, doit attendre qu Linux soit prêt.
pinMode(LED, OUTPUT);
Bridge.begin; // bloque jusqu'à ce que le Bridge côté Linux réponde
Console.begin; // Console = flux série acheminé par le Bridge
Console.println(F("Bridge connecte, Linux est pret"));
}
void loop {
digitalWrite(LED, HIGH);
delay(500);
Console.println(F("LED ON"));
digitalWrite(LED, LOW);
delay(500);
Console.println(F("LED OFF"));
}
In the IDE: Tools > Board > Arduino Yún, select the USB serial port, and upload normally.
Expected Verification
The "L" LED blinks every 500 ms. The Serial Monitor (connected via USB) displays Console messages — but beware: Console goes through the Bridge, so if you open the Monitor AFTER startup, messages already sent are lost. Reconnect the Bridge on the 32U4 side while keeping the Monitor open: Bridge.begin takes a few seconds to complete on the first startup, allowing time for Linino OS to be ready.
Common Errors
- Confusing Serial and Console: Serial = native USB from the 32U4 to the PC; Console = channel routed THROUGH the Bridge to the Linux world. Both coexist.
- Forgetting Bridge.begin: without it, Console displays nothing and Process fails silently.
- Thinking the board is "dead" on the first upload: the Bridge waits up to ~20-25 s for Linux to respond; be patient before unplugging.
- Wrong board type: uploading as "Leonardo" might work (same ATmega32U4) but the bootloader differs — always select Arduino Yún.
- The board is at the end of its commercial life (discontinued): package mirrors and the Linino site may become unavailable; keep a local copy of the IDE and firmwares. >
Other tutorials for this board
- Connecter la Yún au WiFi et piloter une broche depuis le navigateur
- 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