Arduino Yún

Introduction

Please see this video for an introduction to the Arduino Yún from the Arduino founders:

Please note: the images on this page are available for download at the bottom of the page for better viewing.

Overview

The official product page for the Arduino Yún can be found at:

https://docs.arduino.cc/retired/boards/arduino-yun/

As well as detailed technical information the page has links to the schematics.

Please note that although the Arduino Yún is now a retired product it is still a very capable development board should you pick one up secondhand, as I did.

The Arduino Yún is a suitable choice for Internet of Things (IoT) development, combining an 8-bit ATmega32u4 microcontroller for real time tasks, with an Atheros AR9331 System on-a-Chip (SoC) for wireless connectivity, running the Linino Operating System (a Linux distribution based on OpenWrt). Benefits of the Yún include its on-board support for Ethernet and Wi-Fi along with a full size USB port for peripherals, micro-SD slot, 20 digital input/output pins and 12 analog inputs. This can be thought of as the equivalent of a traditional Arduino with multiple shields stacked on top along with a second, more powerful processor.

Getting started

Please note that it is assumed that you have some familiarity with using various Arduino boards and the IDE.

In the Arduino IDE I set the board to Arduino Yún and opened the WebClient example (File->Examples->Ethernet->WebClient). I plugged an ethernet cable from my router into the Yún and a micro USB from my laptop into the board. The Yún's L13 LED, WAN LED on, and ON LED were on. In oticed the board got quite warm - from looking online this seems normal. In the Arduino IDE under Ports the Yún appeared as both a COM port and network port, as well as a Wi-Fi access point. Putting the board's IP address or yun.local (not sure if the board's name affects it) into a browser takes you to the 'Welcome to your Arduino Yún' page where you need to enter your password to access the web control panel, as below:

Since I got my Yún second hand I looked at how to reset the password and found:

https://support.arduino.cc/hc/en-us/articles/360016076940-How-to-reset-the-password-for-Arduino-Yun-Webpanel

However, I couldn't find YunSerialTerminal or any Bridge examples in Arduino IDE v2.3.2. We can however get YunSerialTerminal from:

https://github.com/arduino-libraries/Bridge/blob/master/examples/YunSerialTerminal/YunSerialTerminal.ino

Click to download the raw file (it will be .ino file) and open in the Arduino IDE. Having already set the board type and port number I uploaded to the Yún.

While uploading (took about 7 seconds) the IDE reported:

Sketch uses 4998 bytes (17%) of program storage space. Maximum is 28672 bytes.

Global variables use 453 bytes (17%) of dynamic memory, leaving 2107 bytes for local variables. Maximum is 2560 bytes.

Connecting to programmer: .

Found programmer: Id = "CATERIN"; type = S

    Software Version = 1.0; No Hardware Version given.

Programmer supports auto addr increment.

Programmer supports buffered memory access with buffersize=128 bytes.

Programmer supports the following devices:

    Device code: 0x44

There was no confirmation that the upload was successful.

L13 was now off so that seemed to confirm it had actually been programmed. I entered the serial monitor, pressed enter and got the Linino OpenWRT ASCII art and root log in prompt:

I was then able to use the passwd command to change the password. It then took me to the following page:

The page shows the wired and wireless status, a link for the log, and the CONFIGURE button. Clicking to view the log I was able to see some interesting information amongst all the text:

Linux version 3.8.3
SoC: Atheros AR9330 rev 1
Clocks: CPU:400.000MHz, DDR:400.000MHz, AHB:200.000MHz, Ref:25.000MHz
Linux video capture interface: v2.00
eth1: link up (100Mbps/Full duplex)

Click on the CONFIGURE button allows us to change the password, select the time zone, select the Wi-Fi network to connect to, and set REST API access level:

There's also a link at the top of the page for the advanced configuration panel (luci), which gives you status information and various menus at the top of the screen, very much like a router configuration/status page:

Especially useful is the Realtime load graphs accessible from the Status menu.

Going back to the WebClient example, after uploading and entering the serial monitor it said it couldn't find the ethernet shield.

I found some examples at to research further:

https://docs.arduino.cc/retired/getting-started-guides/ArduinoYun/

In the Process section it states: "the OpenWrt-Yun will connect to a server with curl, and download some ASCII text. It prints the text a serial connection."

I copied the code into a new sketch. However, I didn't have the Process.h library required so I looked into adding it through Sketch->Include Library->Manage Libraries... I searched for process.h and saw Bridge, so I installed. This added the missing Bridge examples including YunSerialTerminal. Now the process example compiled so I uploaded it to the Yún. I opened the serial monitor and got the Arduino logo ASCII art as expected. Note that closing and reopening the serial monitor doesn't cause the text to appear again (that is, the Yún doesn't reset). Pressing the Yún reset on the board and waiting didn't reset either, I had to unplug and re-plug the micro USB then after about 1:04 the text began to appear in the serial monitor. So this shows the difference with a 'traditional' type Arduino which resets when you enter the serial monitor.

Note: Bridge allows you to pass information between the two processors using a key/value pairing.

As mentioned on:

https://docs.arduino.cc/retired/getting-started-guides/ArduinoYun/

In 'Using Bridge to pass information between processors' section, we can use various URL structures to manipulate Yún GPIO provided the REST password is turned off. However, I couldn't get it to work even though REST was set to open.

Next I tried the ConsolePixel example. It says to select Yun's name and IP address in the Port menu then open the Port Monitor but I didn't see such a thing in the Arduino IDE. when I opened the serial monitor I got error 'No monitor available for the port protocol network'. It may be that the board has to be connected to Wi-Fi, So I connected the Yún to my Wi-Fi network using the browser config page and clicked the CONFIGURE & RESTART button. It instructed for me to connect my computer to the same network, so I did (I was previously using ethernet). But now the Yún didn't show up as a network port in the Arduino IDE and I couldn't log in to the web page. I had to power the Yún off and back on and reconnect my laptop to ethernet to be able to log in to the Yún through the browser and for its network port to show in the Arduino IDE. The issue could have been poor Wi-Fi connection, however.

Lastly I tried Bridge (File->Examples->Bridge->Bridge). After uploading, you can use various URLs to manipulate Yún's GPIO as explained here:

https://docs.arduino.cc/tutorials/yun-rev2/bridge/

Example:

http://myarduinoyun.local/arduino/digital/13/1

Is supposed to turn digital pin 13 on but I found I had to use:

http://yun.local/arduino/digital/13/1

I think the difference in URL is to do with the board's name, which you can set through the browser configuration.

Turning on digital pin 13 will switch the Yún's on-board L13 LED on - it will take a few seconds to come on. The browser will report 'Pin D13 set to 1'. 

To turn the LED off use '0' instead of '1' at the end of the URL.

You can use a similar form in Command Prompt (CMD) in Windows using this format:

curl http://yun.local/arduino/digital/13/1

All content of this and related pages is copyright (c) James S. 2025