The Arduino YUN is one of my favorite prototyping platforms for Wi-Fi connected microcontroller applications, but for unclear reasons the originators felt that by default the EEPROM contents should be lost when reprogramming code images. Let’s fix that.
I typically use EEPROM to store board-specific identification, configuration, and calibration information — things I’d rather not lose when updating the code. And if you only update using the USB connection you’ll be fine. But leverage one of the great features of the YUN — updates over Wi-Fi within the IDE — and say goodbye to your EEPROM.
It’s an easy fix, though, and you just need to ssh into the board, change two bytes, and EEPROM will then be preserved.
You’ll need to have your YUN connected to Wi-Fi, and you’ll need the IP address. To find it, either use the IDE to select the Wi-Fi connected port, or use a Bonjour browser such as this one for Windows.
Once you have an IP address. ssh into the board using a tool such as Putty. Then navigate to /usr/bin and edit (I use vi) run-avrdude, changing the 0xD8 after hfuse to be 0xD0. Save the file and your Wi-Fi code updates will no longer clear out your EEPROM settings.