Arduino Yun

Arduino Yun pairs a commonly found wifi router chipset, the Atheros AR9331, with a classical AVR microcontroller.

The Yún’s Bridge library enables communication between the two processors, connecting the hardware serial port of the AR9331 to Serial1 on the 32U4 (digital pins 0 & 1). Another post will describe the library in greater depth. The serial port of the AR9331 exposes the Linux console (aka, the command line interface, or CLI) for communication with the 32U4. The console is a means for the Linux kernel and other processes to output messages to the user and receive input from the user. File and system management tools are installed by default. It’s also possible to install and run your own applications using Bridge.

The ATmega32U4 can be programmed from the AR9331 by uploading a sketch through the Yún’s WiFi interface. When connected to the same WiFi network as your computer, the board will appear under the “Port” menu of the Arduino IDE. The sketch will be transferred to the AR9331, and the Linux distribution will program the ATmega32U4 through the SPI bus, emulating an AVR ISP programmer.

Via Arduino Yun Hardware Review

By the time I am writing this, this might be the first article that tells you how to install OpenWRT on Arduino Yun because no one talks about it. Also, Arduino Yun is already reached its end of life, and the version history is not well documented in each article so I will write it as clearly as I can. Here I am using the old Arduino Yun. It comes with the 1.1.4 version of the bootloader.

Now to update it to the latest OpenWRT what we will need to do is:

  1. Update the bootloader to 1.1.5 because 1.1.4 does not support bigger kernel upload by default
  2. Flash the firmware from the latest build of OpenWRT
  1. Arduino Yun v1 (rev 2 is also compatible but haven't tried yet)
  2. Linux PC (Windows or Mac is also compatible but not covered here)
  3. LAN and MicroUSB cable
  4. Access Point with Internet Connection

The old version of Yun is able to use the latest OpenWRT. The 1.1.5 bootloader is also available for rev. 2 so I think the Yun rev. 2 is also able to boot the latest OpenWRT. No need to be afraid of bricking, if you still have the bootloader, everything can be reflashed. Go here if you need to re-flashing the stock Yun firmware.

Connect Yun LAN and Micro USB to your PC. Open Arduino IDE, and download the bridge library. Select menu Sketch > Include Library > Manage Libraries … Search bridge on library manager and install

Open YunSerialTerminal sketch by selecting File > Example > Bridge > YunSerialTerminal. Upload YunSerialTerminal; open the serial monitor and set the baud rate to 115200. Press enter and a terminal will show up:

Reset Yun by pressing a white button near the LEDs. Go to boot mode quickly, and send lin (or depending on the message, some bootloaders need ard, some only need to press any character) command into the serial monitor until the bootloader command prompt is shown below

Now let's set up the host. Make sure your PC IP connected to Yun is with gateway You can use any IP here, but if you want to follow me just use the same IP as my configuration. Below is my PC IP,

Install tftp server

$ sudo apt-get install tftpd-hpa

In my Linux OS, after installing, check the tftp folder

$ cat /etc/default/tftpd-hpa
# /etc/default/tftpd-hpa


in my case it is /srv/tftp

Now download this Yun-Go-Updater, and extract the bootloader file only:


And move it to the /srv/tftp directory

$ mv u-boot-arduino-lede.bin /srv/tftp

Then get the latest OpenWRT firmware here

By the time I am writing this, it is 22.03.3

Put the firmware also in tftp folder


So now the /srv/tftp contains our bootloader and OpenWRT firmware.

After everything is set up then send these commands in Yun serial monitor:

linino> setenv serverip;

linino> setenv ipaddr;

The Yun is set to and our PC is

Send the bootloader to Yun

tftp 0x80060000 u-boot-arduino-lede.bin

Then erase the old bootloader and replace using these commands.

erase 0x9f000000 +0x40000;
cp.b $fileaddr 0x9f000000 $filesize;
erase 0x9f040000 +0x10000

Below is the output

Then we can send the OpenWRT firmware to Yun, erase the previous firmware, and write the OpenWRT

tftp 0x80060000 openwrt-22.03.3-ath79-generic-arduino_yun-squashfs-sysupgrade.bin;
erase 0x9f050000 +0xE50000;
cp.b $fileaddr 0x9f050000 $filesize;

Below is the output

Now reset by pressing the white Yun reset button near the LEDs. Now we can see the new bootloader and running the latest and the most bleeding edge OpenWRT

Press Enter again in the serial monitor to activate the console

Now we have the latest OpenWRT installed on Arduino Yun! By default, the wifi is turned off. To access the Yun, run this command to set the Yun IP.

ifconfig eth0

Once the IP is set, you can access the OpenWRT web interface on the browser by visiting

Connect to your Wifi access point and run opkg update to update the package list.

There are so many packages that you can install but the Yun memory is too small. However, we can expand the storage using extroot method.

The old storage expanding steps does not work on the newest OpenWRT. So to expand the storage using a microSD card, use the OpenWRT instruction. Here is the screenshot of the expanded storage size of my Arduino Yun.

Stock Buildconfig for the release unit and the customized Linino OpenWrt redistribution it is built upon.

Below steps from Building a custom image for Arduino YUN, via Fiore Basile:

As soon as I got my hands on the YUN I found the selection of packages lacks many interesting pieces of software that could help building interesting appliances. I think Arduino people selected those packages that would easily fit in the minimal 64MB flash.

So first of all I formatted a 4GB mini-sd as ext3 and plugged it in to the mini, it was recognized as /dev/sda1, so I quickly added an /opt folder and mounted in there instead. Now I have plenty of space to add my custom packages, and some “secure” disk space just in case I have to wipe my YUN loosing all flash content.

Resetting the YUN flash is done by holding the reset button for 30 seconds. Holding it for 5 just resets the WiFi config.

Then I spent some time to collect all the information needed to setup our own buildroot for the YUN, here you can find a few tips to do it yourself.

First of all you should clone the Arduino YUN buildroot sources, available from github.

git clone linino

This will checkout the OpenWrt buildroot with specific Arduino YUN modifications

In order to successfully compile the builroot you'll need a few packages installed: for Debian Stable you can easily get them by running as root (or with sudo)

apt-get install subversion build-essential git-core libncurses5-dev zlib1g-dev gawk asciidoc \
bash bc binutils bzip2 fastjar flex g++ gcc util-linux zlib1g-dev libncurses5-dev \
libssl-dev perl-modules python2.6-dev rsync ruby sdcc unzip wget gettext xsltproc \
zlib1g-dev libxml-parser-perl

I've included a few you might already have installed, just in case someone had removed them, it won't hurt anyway to put them on the command line.

Once you're done with prerequisites go on to configure the kernel:

cd  linino/trunk    
./scripts/feeds update -a
./scripts/feeds install -a
make menuconfig

If all the steps above have been done correctly you will be presented with a familiar menu, similar to the standard Linux kernel build. Go on and select the kernel modules, and packages you want to build.

Once you exit you can compare with diff the generated config with the one available on the Arduino YUN package repository, this should be located at

EDIT: If you want to keep the same config and packages getting built by Yun developers, also do:

./scripts/feeds uninstall -a
rm -rf feeds
./scripts/feeds update -a
./scripts/feeds install -a
rm -f .config
git checkout .config
make oldconfig

Build it Now you can just run make to start the build process, get a cup of coffee, or several considering it needs to fetch many packages i.e. the Linux kernel and build lots of stuff.

make V=s

Please note that using the V=s param switches on verbose output. If you like you can add -j4 or -j8 depending on how many cores you configured on your machine or VM to speed things up a little.

At the end of the process you should have images ready to be uploaded via TFTP (I'm currently investigating how), and a complete cross-compiling toolchain to test out new packages, and eventually package and contribute them to the offical repository.

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
  • Last modified: 2023/02/22 20:02
  • by derrypratama