Federico Vanzati
Arduino Yún: Internet for makers

f.vanzati@arduino.cc - Officine Arduino Torino
What is Arduino?
Federico Vanzati

f.vanzati@arduino.cc - Officine Arduino Torino

Arduino is an electronic prototyping pl...
Physical to Internet?
Federico Vanzati

Ethernet Shield

f.vanzati@arduino.cc - Officine Arduino Torino

WiFi Shield
Federico Vanzati

Limited number of connections
and modest performances
because all the code is
processed from the AVR

Cl...
Arduino Yún
Federico Vanzati

Https
SSL

SSH

AR9331
running OpenWRT

Usual Arduino experience
32U4
[Leonardo]

Tools offe...
Internet of Things (IoT)
Federico Vanzati

f.vanzati@arduino.cc - Officine Arduino Torino

Arduino: one of the first platf...
Internet of Things (IoT)
Federico Vanzati

f.vanzati@arduino.cc - Officine Arduino Torino

●

Enviroment (radiation level,...
Internet of Things (IoT)
Federico Vanzati

f.vanzati@arduino.cc - Officine Arduino Torino

In a few years certainly these ...
What's on board?
Federico Vanzati

f.vanzati@arduino.cc - Officine Arduino Torino

Thanks to the Linux processor you have ...
Hardware Summary
Federico Vanzati

f.vanzati@arduino.cc - Officine Arduino Torino

Atmega32U4 (Leonardo)

AR9331 (OpenWRT)...
Processors Cooperation
Federico Vanzati

f.vanzati@arduino.cc - Officine Arduino Torino
Bridge Concept
Federico Vanzati

f.vanzati@arduino.cc - Officine Arduino Torino

As is common on Linux system, the console...
Bridge Features – communication protocol
Federico Vanzati

f.vanzati@arduino.cc - Officine Arduino Torino

The Bridge libr...
Bridge Features – Shared Storage
Federico Vanzati

f.vanzati@arduino.cc - Officine Arduino Torino

With the Bridge library...
Bridge Features – Process
Federico Vanzati

f.vanzati@arduino.cc - Officine Arduino Torino

Process is the base class for ...
Bridge Features – Console
Federico Vanzati

f.vanzati@arduino.cc - Officine Arduino Torino

Console, based on Bridge, enab...
Bridge Features – FileIO
Federico Vanzati

f.vanzati@arduino.cc - Officine Arduino Torino

FileIO is the base class for ma...
Bridge Features – Mailbox
Federico Vanzati

f.vanzati@arduino.cc - Officine Arduino Torino

Mailbox Class allows you to ex...
Bridge Features – Client/Server
Federico Vanzati

f.vanzati@arduino.cc - Officine Arduino Torino

HttpClient:
HttpClient e...
WiFi Upload
Federico Vanzati

f.vanzati@arduino.cc - Officine Arduino Torino
“www” folder
Federico Vanzati

f.vanzati@arduino.cc - Officine Arduino Torino
Out of the Box experience
Federico Vanzati

f.vanzati@arduino.cc - Officine Arduino Torino
Temboo
Federico Vanzati

f.vanzati@arduino.cc - Officine Arduino Torino
Sands Project
Federico Vanzati

f.vanzati@arduino.cc - Officine Arduino Torino

Social&Smart is a research project using t...
Demo
Federico Vanzati

f.vanzati@arduino.cc - Officine Arduino Torino
Upcoming SlideShare
Loading in...5
×

[codemotion] Arduino Yun: internet for makers

2,431

Published on

The Arduino Yún is an Arduino platform that adds to the traditional Arduino experience the capabilities to connect to Internet. It has an on board small Linux system who manages the Ethernet and the WiFi communication. The Arduino Yún gives you enhanced possibilities to make objects speak each other using Internet protocols.

Published in: Technology, Business

[codemotion] Arduino Yun: internet for makers

  1. 1. Federico Vanzati Arduino Yún: Internet for makers f.vanzati@arduino.cc - Officine Arduino Torino
  2. 2. What is Arduino? Federico Vanzati f.vanzati@arduino.cc - Officine Arduino Torino Arduino is an electronic prototyping platform that can sense the environment by receiving input from a variety of sensors and can affect its surroundings by controlling lights, motors, and other actuators. COMMUNICATION INPUT USB Serial TWI SPI Analog Digital OUTPUT Analog Digital
  3. 3. Physical to Internet? Federico Vanzati Ethernet Shield f.vanzati@arduino.cc - Officine Arduino Torino WiFi Shield
  4. 4. Federico Vanzati Limited number of connections and modest performances because all the code is processed from the AVR Client Server Managing the connection f.vanzati@arduino.cc - Officine Arduino Torino TCP/IP stack only can't handle secure connections natively
  5. 5. Arduino Yún Federico Vanzati Https SSL SSH AR9331 running OpenWRT Usual Arduino experience 32U4 [Leonardo] Tools offered by the Linux system f.vanzati@arduino.cc - Officine Arduino Torino Advanced connectivity capabilities thanks to Linux
  6. 6. Internet of Things (IoT) Federico Vanzati f.vanzati@arduino.cc - Officine Arduino Torino Arduino: one of the first platform to offer the possibility to connect sensors and actuators to Internet. Many projects in different categories, for example: ● Smart metering (photovoltaic, water flow and level, electrical comsumption)
  7. 7. Internet of Things (IoT) Federico Vanzati f.vanzati@arduino.cc - Officine Arduino Torino ● Enviroment (radiation level, earthquake, air pollution) ● Security & Emergencies (intrusion detection, fire/gas detection)
  8. 8. Internet of Things (IoT) Federico Vanzati f.vanzati@arduino.cc - Officine Arduino Torino In a few years certainly these projects have influenced the definition of IoT. The Arduino Yún follows the evolution of internet answering to the new requirements of access to the web services. The Arduino Yún gives you a lot of cool features. Both WiFi and Ethernet Enhanced connectivity (speed, more protocols, …) Independent Web Server Additional peripherals (USB host, SD card
  9. 9. What's on board? Federico Vanzati f.vanzati@arduino.cc - Officine Arduino Torino Thanks to the Linux processor you have all the tools you normally use on your compurer to develop code that lives on Internet.
  10. 10. Hardware Summary Federico Vanzati f.vanzati@arduino.cc - Officine Arduino Torino Atmega32U4 (Leonardo) AR9331 (OpenWRT) Digital I/O Pins 20 Architecture MIPS @400MHz PWM Channels 7 Ethernet IEEE 802.3 10/100Mbit/s Analog Input Channels 12 WiFi IEEE 802.11b/g/n Flash Memory 28 KB aval. USB SRAM 2.5 KB Card Reader Micro-SD only EEPROM 1 KB RAM Clock Speed 16 MHz Flash Mem.16 MB Operating voltage: 5V Type-A 2.0 Host/Device 64 MB DDR2
  11. 11. Processors Cooperation Federico Vanzati f.vanzati@arduino.cc - Officine Arduino Torino
  12. 12. Bridge Concept Federico Vanzati f.vanzati@arduino.cc - Officine Arduino Torino As is common on Linux system, the console to access to the environment is exposed on the Serial port. The Arduino microcontroller (32U4) can control the Linux system through the Serial port. The Bridge Library has been developed to simplify the way the sketch can manage the processes and the tools on the Linux side. Arduino Library Bridge Python process on the Linux side Started by the sketch
  13. 13. Bridge Features – communication protocol Federico Vanzati f.vanzati@arduino.cc - Officine Arduino Torino The Bridge library simplify the communication between the two processors using a protocol that numbers the packets, manage retrasmission and timeout. Classes of the library: ● ● ● ● ● ● ● ● Storage Process Console FileIO Mailbox HttpClient YunServer YunClient
  14. 14. Bridge Features – Shared Storage Federico Vanzati f.vanzati@arduino.cc - Officine Arduino Torino With the Bridge library is possible to save data or variables and share it with the Linux processor using the shared storage, that has a KEY/VALUE structure.
  15. 15. Bridge Features – Process Federico Vanzati f.vanzati@arduino.cc - Officine Arduino Torino Process is the base class for all Bridge based calls for communicating with the Yun's shell. It is not called directly, but invoked whenever you use a function that relies on it. Run Process Process p;               p.begin("curl");         p.addParameter("http://arduino.cc/asciilogo.txt");    p.run(); Read Output while (p.available()>0) {     char c = p.read();     Serial.print(c);   }   Serial.flush(); }
  16. 16. Bridge Features – Console Federico Vanzati f.vanzati@arduino.cc - Officine Arduino Torino Console, based on Bridge, enables you to send information from the Yún to a computer just as you would with the serial monitor, but wirelessly. It creates a secure connection between the Yún and your computer via SSH. #include <Console.h> const int ledPin = 13; int incomingByte; void setup() { Bridge.begin(); Console.begin(); while (!Console) ; // wait for Console port to connect. Console.println("You're connected to the Console!!!!"); pinMode(ledPin, OUTPUT); } void loop() { // see if there's incoming serial data: if (Console.available() > 0) { incomingByte = Console.read(); // read the oldest byte in the serial buffer: if (incomingByte == 'H') { // if it's a capital H (ASCII 72), turn on the LED digitalWrite(ledPin, HIGH); } if (incomingByte == 'L') { // if it's an L (ASCII 76) turn off the LED digitalWrite(ledPin, LOW); } } }
  17. 17. Bridge Features – FileIO Federico Vanzati f.vanzati@arduino.cc - Officine Arduino Torino FileIO is the base class for manipulating files and directories on the Linux system directly from the 32U4. If an SD card is inserted into the slot with an empty folder in the SD root named "arduino". This will ensure that the Yún will create a link to the SD to the "/mnt/sd" path.
  18. 18. Bridge Features – Mailbox Federico Vanzati f.vanzati@arduino.cc - Officine Arduino Torino Mailbox Class allows you to exchange messages between the two processors, putting them in two separate queues.
  19. 19. Bridge Features – Client/Server Federico Vanzati f.vanzati@arduino.cc - Officine Arduino Torino HttpClient: HttpClient extends Process and acts as a wrapper for common cURL commands by creating a HTTP client in Linino YunServer: YunServer opens a listening socket on the Linino. You can choose to use it only on localhost or expose the socket on the outside (with or without password) YunClient: YunClient is a TCP/IP client, implements the same APIs to connect, read and write as in the Arduino Ethernet and WiFi Client libraries
  20. 20. WiFi Upload Federico Vanzati f.vanzati@arduino.cc - Officine Arduino Torino
  21. 21. “www” folder Federico Vanzati f.vanzati@arduino.cc - Officine Arduino Torino
  22. 22. Out of the Box experience Federico Vanzati f.vanzati@arduino.cc - Officine Arduino Torino
  23. 23. Temboo Federico Vanzati f.vanzati@arduino.cc - Officine Arduino Torino
  24. 24. Sands Project Federico Vanzati f.vanzati@arduino.cc - Officine Arduino Torino Social&Smart is a research project using the housekeeping scenario to experiment a pervasive Future Internet network that provides real services to a wide population.
  25. 25. Demo Federico Vanzati f.vanzati@arduino.cc - Officine Arduino Torino
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×