🛠 Téléverser par WiFi, logger sur microSD, et récupérer une Yún briquée

Arduino Yún · avance · IMG-yun-avance-9-yun-televersement-wifi-recuperation.svg — Yún avec trois zones annotées : 1) antenne + éclair « téléversement WiFi » vers l'IDE, 2) fente microSD avec flèche « logs CSV », 3) bouton de restauration maintenu 30 s et broches du connecteur pour le mode recovery.

Objectives

Three operational skills to keep a Yún running: (1) upload sketches over WiFi, without a cable; (2) log sensor data to microSD from Linux; (3) recover a card with corrupted Linino OS (bad network config, failed opkg, full flash) using the restoration procedure.

Hardware

1) Uploading over WiFi

Once the Yún is on your network, the IDE (Port menu) displays it as a network port (arduino.local or its IP): the upload goes over the network, and the AR9331 reprograms the 32U4 via its internal serial port. Advantage: no more cables, the board stays in its enclosure. If the port does not appear: check mDNS (iTunes/Bonjour on Windows) or enter the IP in the additional ports.

2) Logging to microSD (Linux side)

# Montage auto typique : /mnt/mmcblk0p1 (sinon : mount /dev/mmcblk0p1 /mnt)
# Script de log alimenté par le data store du Bridge :
cat > /root/logger.sh << 'EOF'
#!/bin/sh
LOG=/mnt/mmcblk0p1/log.csv
[ -f $LOG ] || echo "timestamp,pot" > $LOG
while true; do
  V=$(wget -qO- http://localhost/data/get/pot 2>/dev/null)
  [ -n "$V" ] && echo "$(date +%s),$V" >> $LOG
  sleep 5
done
EOF
chmod +x /root/logger.sh && /root/logger.sh &

On the sketch side, remember to publish regularly: Bridge.put("pot", String(analogRead(A0))). For a clean restart, add the script to /etc/rc.local.

3) Recovering a corrupted Yún

  1. Lost network: hold the WiFi button for ~30 s at startup → recovery mode (SSID "Arduino Yun"), reconfigure via http://arduino.local. The root password, however, is NOT reset by this button.
  2. Linino OS broken: the official reflash procedure uses recovery mode (booting an image from the 32U4 or USB) — download the Linino OS "sysupgrade" image and follow the recovery page on the Arduino/OpenWrt wiki. As a last resort, the SoC test pins allow serial booting. >
  3. 32U4 intact, Linux dead: the board continues to upload and blink via USB — only the Linux world needs reinstalling.

Expected Verification

Upload Blink WITHOUT a USB cable (via WiFi): the LED blinks. The logger script fills log.csv even after replugging (data survives, unlike /data in RAM). Simulate a disaster: passwd with a forgotten password over SSH → full reinstallation → the board comes back alive, with the microSD and 32U4 bootloader intact.

Common Errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials