This example for the Arduino Yún shows how to use the Bridge library's Process class to run Linux processes on the AR9331. Specifically, in this example, you'll be using curl and cat to transfer data from a web server and get information on the Linux processor.

Hardware Required

  • Arduino Yún
  • a network connection to the internet

There is no circuit for this example.

image developed using Fritzing. For more circuit examples, see the Fritzing project page


Include the Process class in your sketch. #include <Process.h>

In setup(), you'll want to initialize Bridge and start a serial connection. Before running the rest of setup() wait for a serial connection to become active.

void setup() {

  while (!Serial);

The rest of setup() is used to call your two custom functions, runCurl() and runCpuInfo(). There's nothing in loop().


void loop() {
  // Do nothing here.

runCurl() will launch the curl command and download the Arduino logo as ASCII. Create a named Process and start it by calling myProcess.begin("curl");. Add the URL to retrieve with the addParameter() method, and run it all with run().

void runCurl() {
  Process p;           

When there is data available from the process, print it out to the serial monitor :

while (p.available()>0) {
    char c =;

For the runCpuInfo() function, you'll create a new process for cat. Add the parameter to cat passing it the path to the cpu Info file, then run the process.

void runCpuInfo() {
  Process p;

When there is data available from the process, print it out to the serial monitor :

while (p.available()>0) {
    char c =;

The full code is below :

SORRY, There is an error at our code repository, please inform to

See Also

  • Bridge Library - Your reference to the Bridge Library
  • Bridge – Simple REST style calls to access analog and digital pins
  • Consolle Ascii Table – A complete ASCII table printed to the Console
  • Console Pixel – Turn an LED on and off through the Console
  • Console Read - Read data coming from bridge using the function
  • Data Logger - Log data from three analog sensors to an SD card.
  • File Write - How to write file into the Yún filesystem.
  • Http Client - A basic HTTP client that connects to the internet and downloads content.
  • Mailbox Read Message - How to read the messages queue, called Mailbox, using the Bridge library.
  • Shell Commands - How to run linux shell commands using an Arduino Yún.
  • Temperature Web Panel - How to serve data from an analog input via the Arduino Yún's built-in webserver.
  • Time check - Gets the time from Linux via Bridge then parses out hours, minutes and seconds.
  • WiFi Status - Prints information about the status of your wifi connection.
  • Serial Terminal - Use the Yún's 32U4 processor as a serial terminal for the Linux side on the Yún.

Last revision 2015/08/12 by SM