Arduino Yun board and network setup overview, Arduino Yun setup, Linux networking, Arduino board tutorial

Introduction to Arduino YUN

2.1M Views
40
700
60
25
60
PCBWay

Hello everyone! Today we will explore the Arduino Yún and connect it to a local network. This board combines familiar Arduino programming with an onboard Linux system, allowing a project to read physical inputs and communicate with network services without keeping a desktop computer attached.

Libraries

Arduino Simulation Libraries

Helping Tools

We will start by understanding its two processors, then follow the original illustrated Wi-Fi configuration procedure. After that, we will upload a simple sketch, distinguish USB communication from Bridge communication, and plan a small sensor-logging application.

This tutorial concerns the original Arduino Yún, a legacy board. Its screenshots show the original configuration interface, so menu details can differ with the installed Linux image and development tools. Identify your board revision before using instructions intended for a Yún Rev2, Yún Mini, or Yún Shield.

Arduino Yun board and network setup overview, Arduino Yun setup, Linux networking, Arduino board tutorial
Figure: Arduino Yun board and network setup overview.

What Is the Arduino Yún?

The Yún combines an ATmega32U4 microcontroller with an Atheros AR9331 processor running an OpenWrt-based Linux environment. Arduino's original hardware overview describes how these two sides share responsibilities. The microcontroller executes an Arduino sketch, while Linux provides facilities such as networking, files, processes, and attached USB devices.

That division is more useful than thinking of the board as one unusually large Arduino. The microcontroller remains a small embedded device with its own memory and peripherals. Linux has separate memory and software. A large file stored on the Linux side does not become a large array that the sketch can access without communication.

The two processing environments
SideTypical responsibilitiesImportant constraint
ATmega32U4Digital I/O, analog readings, timers, and Arduino application logicSmall microcontroller memory and pin-current limits
AR9331 Linux systemWi-Fi, Ethernet, files, network clients, and operating-system processesBoot time and operating-system scheduling affect availability
Interprocessor connectionTransfers commands and data between the two environmentsCommunication has overhead and needs a defined format

The original Linux side includes 64 MB of DDR2 RAM and 16 MB of flash, while the ATmega32U4 has its own much smaller memories. These capacities serve different purposes. Check free filesystem space before adding packages or logs rather than assuming all advertised flash is available for your application.

The board also provides Wi-Fi, Ethernet, a USB host connection, and a microSD slot. The USB host and storage features belong to the Linux environment. The micro-USB connection used for ordinary sketch uploading has a different role. Similar-looking USB connections should not be treated as interchangeable.

Decide Which Processor Should Do Each Job

Suppose you want to record a sensor value once per second and upload a batch to a server. The sketch can acquire readings and attach sequence numbers. Linux can collect those records, write a local file, and handle the network request. This keeps the sensor code separate from details such as hostnames and file paths.

In my original project, the Linux side handled transferring sensor data to a server. That remains a useful architectural example, but the transfer mechanism should match the receiving service. Uploading a file does not automatically insert its contents into a SQL database; a server-side application must validate and store the data.

Keep timing-sensitive work close to the microcontroller's peripherals. Starting a Linux process to toggle a pin at an exact microsecond deadline is not equivalent to using a hardware timer. Conversely, implementing a complete network application inside the limited AVR memory ignores much of the reason for choosing this board.

Define what happens when Linux is still booting or Wi-Fi is unavailable. The sketch may continue sampling, pause acquisition, or retain a bounded number of records. Make that policy explicit instead of allowing a failed upload to block every unrelated part of the project.

Prepare the Board and Development Tools

Use a suitable regulated USB supply and a data-capable micro-USB cable for initial setup. The original post called this a mini-USB cable; the connector on the Yún is micro-USB. A charge-only cable can power the board while leaving the computer unable to identify its USB device.

Check the power instructions for your exact revision before applying power through header pins. Do not copy a voltage range from an Uno simply because the board outline looks similar. Start with the documented USB power method while learning the board.

Install an Arduino development environment and board support that recognize the original Yún. The historical screenshots use IDE 1.5.5, but that does not mean 1.5.5 is the only compiler environment that can build its sketches. Select the correct board definition and confirm compatibility of any legacy Bridge examples you intend to use.

A useful first preparation list is:

  • The correct board revision and its documentation.
  • A reliable power source and USB data cable.
  • A computer able to join the board's initial wireless network.
  • The SSID and password of a compatible local Wi-Fi network.
  • Access to the router's client list if automatic hostname discovery fails.

Allow the Linux system to boot. A sketch starting or an LED lighting does not prove that the web configuration service is ready. Check the appropriate network indicators and connection state instead of assuming both processors become available at the same instant.

Join the Yún's Initial Access Point

An unconfigured original Yún normally exposes its own wireless access point. In your computer's Wi-Fi list, look for the board's advertised network. The original screenshot below shows the network appearing alongside other available connections.

Yun setup network in the wireless connection list, Arduino Yun setup, Linux networking, Arduino board tutorial
Figure: Yun setup network in the wireless connection list.

Connect the computer to that network. This puts the computer and board on a local link so that the configuration page can be reached. It does not necessarily give the computer Internet access. A warning that this network has no Internet can therefore be expected during this setup stage.

Computer connected to the Yun access point, Arduino Yun setup, Linux networking, Arduino board tutorial
Figure: Computer connected to the Yun access point.

If your computer automatically reconnects to its usual Wi-Fi network, the setup page may become unreachable. Confirm the active connection before diagnosing the board. Disable automatic switching only as needed for this setup, then restore your normal network arrangement afterward.

A previously configured board may join its saved network instead of advertising the initial access point. In that case, inspect the router's connected-device list or use the known hostname. Do not assume an absent setup network means the hardware has failed.

Open the Configuration Page

For the original access-point setup shown here, open http://192.168.240.1/ in a browser. This is a local address on the board's setup network, not a public website. The login page should resemble the historical screenshot below.

Original Yun web configuration login page, Arduino Yun setup, Linux networking, Arduino board tutorial
Figure: Original Yun web configuration login page.

The original factory image used arduino as its default password. That applies only while the password remains at its factory value. After signing in, set a unique password and keep a record of it. A second-hand or previously configured board may already have a different password.

The status page reports details such as network interfaces and addresses. Read those fields as interface-specific information. A working wireless connection does not imply that an Ethernet cable is attached, and a physical Ethernet link does not by itself confirm Internet access.

Yun network status and configuration controls, Arduino Yun setup, Linux networking, Arduino board tutorial
Figure: Yun network status and configuration controls.

Choose Configure to enter the network settings. The historical interface provides fields for the board name, password, timezone, wireless network, and network password. Use a short, memorable board name that will help distinguish this unit from others on the same network.

Set the Network and Timezone

Select the intended SSID and enter its password carefully. For a legacy wireless client, confirm that the access point offers a compatible band and authentication mode. A network visible to a modern laptop may still use settings that the board's older software cannot negotiate.

Set the timezone to match how you want local time displayed. Timezone and clock synchronization are different settings: selecting a timezone does not establish the correct current date. A logging project should also establish how the Linux clock obtains a trustworthy time after startup.

For data exchanged with a server, storing UTC timestamps and converting them for display avoids ambiguity between locations. If the device has not yet synchronized its clock, record that state or use a sequence number until a meaningful timestamp is available.

Apply the configuration and restart through the web interface. The saved-configuration screen in the original sequence is shown below. Expect a temporary loss of the setup connection while the network mode changes.

Saved Yun configuration and restart notice, Arduino Yun setup, Linux networking, Arduino board tutorial
Figure: Saved Yun configuration and restart notice.

The earlier article suggested a fixed ten-to-fifteen-minute restart wait. A better approach is to watch for the board to reappear on the intended network. If it remains unavailable for an unusually long period, investigate power and network configuration instead of repeatedly waiting the same arbitrary interval.

Reconnect to the Shared Local Network

Reconnect your computer to the same local network that you selected for the Yún. The board's new address will normally come from that network's DHCP server. It need not remain 192.168.240.1, and it need not match an address printed in this tutorial's screenshots.

Try the configured hostname when local discovery is available, or use the IP address shown in the router's client list. Hostname resolution and IP connectivity are separate things. If direct access by IP works but the name does not, focus on name discovery rather than reconfiguring Wi-Fi unnecessarily.

Guest networks and client isolation can prevent two connected devices from reaching one another. Both devices displaying the same SSID is therefore not sufficient evidence that the computer can contact the board. Check the access point's local-client communication policy.

For a stable development setup, a DHCP reservation can keep the board's address predictable without manually configuring an address that conflicts with another device. Record the board's identity and assigned address so that later uploads target the correct unit.

Upload a First Sketch

Begin with a USB upload of a minimal Blink sketch. This establishes that the board selection, cable, bootloader path, and compiler work before networking is added to the investigation. Use the built-in LED definition rather than assuming every board uses the same pin mapping.

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
  digitalWrite(LED_BUILTIN, HIGH);
  delay(500);
  digitalWrite(LED_BUILTIN, LOW);
  delay(500);
}

Once local uploading works and Linux is reachable, select the board's network port in a compatible IDE. The original screenshot shows the board name and discovered address in the Port menu. Those values belong to that particular setup and should not be copied into yours.

Yun network upload port in the historical Arduino IDE, Arduino Yun setup, Linux networking, Arduino board tutorial
Figure: Yun network upload port in the historical Arduino IDE.

A network upload uses services on the Linux side to deliver a sketch to the microcontroller. It is not the same as replacing the Linux operating system. Use the configured password when requested, and distinguish an authentication failure from a compiler error.

If the port is absent, first check whether the configuration page is reachable by IP. If it is, investigate discovery or development-tool support. If it is not, return to the network and power checks. This order prevents unnecessary changes to a sketch that has already compiled successfully.

Understand Bridge and Serial Communication

The Bridge library provides a way for the sketch and Linux to exchange information and request services. The original board's interprocessor connection uses Serial1 on the ATmega32U4, associated with digital pins 0 and 1. Do not simultaneously treat those pins as an unrelated serial peripheral connection while expecting Bridge to own the same channel.

USB Serial and the network Console are different paths. USB Serial communicates through the microcontroller's USB interface. Console builds on the Yún's network and Bridge facilities. Arduino's Yún HTTP Client Console example illustrates that distinction, although examples should still be matched to the software installed on your board.

Bridge communication adds overhead. It is suitable for exchanging readings, settings, and application messages, but should not be assumed to replace a direct hardware bus for every timing-sensitive operation. Transfer meaningful records and keep the real-time responsibilities local to the microcontroller.

Plan a Small Sensor-Logging Project

A useful first record format contains a sequence number, a sensor identifier, a value, and a timestamp or elapsed time. Add a clear delimiter so that the Linux side can distinguish complete records. Avoid interpreting each serial read as a complete message, because communication streams can deliver data in fragments.

Suppose one record occupies 40 bytes and you collect one record per second. The raw daily storage requirement is 40 × 86400 = 3,456,000 bytes, about 3.46 MB in decimal units. Filesystem overhead, additional metadata, and retries add to that amount. This simple estimate shows why unlimited logging in the small internal flash is a poor default.

Use an appropriate storage device, rotate logs, and define an upper limit. If network service is unavailable, retain only the amount the project can afford. When the connection returns, sequence numbers help the server detect duplicate or missing records rather than silently accepting every retry as a new measurement.

For an analog sensor, also separate digital resolution from measurement accuracy. With an ideal 10-bit conversion over a 5 V reference, one nominal count spans approximately 5 / 1024 = 4.88 mV. Reference uncertainty, sensor error, wiring noise, and calibration can be more important than that step size.

Choose a transfer protocol supported by the installed software and the receiving server. Prefer authenticated, encrypted communication where supported; do not assume an old Linux image can negotiate every modern HTTPS configuration. Keep the board on an appropriate local network and avoid exposing its legacy configuration services directly to the Internet.

Troubleshooting and Review

Useful checks during Yún setup
SymptomCheck
No USB port appearsData-capable cable, board selection, power, and USB device recognition
Initial Wi-Fi network is absentLinux boot state and whether a saved network configuration already exists
192.168.240.1 does not openWhether the computer is actually connected to the board's setup network
Board disappears after configurationReconnect to the selected network and find its new DHCP address
IP works but hostname failsLocal name-resolution and discovery support
Bridge communication failsLinux availability, matching library support, and conflicts on Serial1

The Yún's value lies in dividing work between a microcontroller and Linux. Once the network and upload paths are understood, that architecture makes it easier to build a project that continues acquiring data while files and remote services are handled separately.

Frequently Asked Questions

Is the Yún simply an Uno with Wi-Fi?

No. It uses an ATmega32U4 and a separate Linux processor, with different USB and interprocessor communication arrangements.

Must I install Arduino IDE 1.5.5?

That version appears in the historical screenshots. Use a compatible environment with the correct board support rather than assuming one old version is the only valid choice.

Does uploading a sketch replace Linux?

No. The sketch runs on the microcontroller. Updating the Linux image is a separate operation with its own revision-specific procedure.

Can the board work without a computer attached?

Yes, when supplied with suitable power and configured to run its application independently. Avoid code that waits indefinitely for a debugging connection before doing useful work.

Why does my board have a different IP address?

The setup access-point address and the address assigned by your router serve different network configurations. Find the current address instead of copying one from an old screenshot.


Comments

1

Join the conversation

Reply1

Hi Syed Zain Nasir, thank you for this post, it's very interesting! Reading this post my attention is focusing on your example in that you refer at a project in which the sensors data attached to the YUN were uploading directly on the web server via FTP and were saved in the sql database without no computer. can you send me some more information about it? is there a guideline or tutorial?

Thank you
Ilario