Home

Yun Shield Quick Start Guide

image

Contents

1. gt File gt Examples gt Bridge gt XivelyClient Tutorial of this example can refer http arduino cc en Tutorial YunXivelyClient Before upload the sketch make sure v The Yun Shield already has internet access v Input your FEED ID and API KEY according to the Tutorial Note The FEED ID should be within double quotation marks v Change Serial Class to Console class to fit for different AVRs Below listing the code and add some detail to understand it with the Yun Shield Code include all Libraries needed include lt Process h gt Process lib use to call Linux Commands in Yun Shield include lt Console h gt Console lib used to show debug info in Arduino IDE include passwords h contains my passwords see below Pi NOTE passwords h is not included with this repo because it contains my passwords You need to create it for your own version of this application To do so make a new tab in Arduino call it passwords h and include the following variables and constants define APIKEY foo replace your pachube api key here define FEEDID 0000 replace your feed ID define USERAGENT my project user agent is the project name set up net client info const unsigned long postingInterval 60000 delay between updates to xively com unsigned long lastRequest 0 when you last made a request String dataString void setup start console Bridge begin Conso
2. 4 75v 23v via Arduino VIN pin 1 x 10M 100M RJ45 connector 150M WiFi 802 11 b g n External Antenna via I Pex connector VV VV VV WV 1 x USB 2 0 host connector used for USB storage or 3G connection Yun Shield Quick Start Guide 3 14 G orvAcino www dragino com gt gt 1 x Reset button Compatible with 3 3v or 5v I O Arduino 1 4 Features v v v ie a Open source Linux OpenWrt inside Low power consumption Compatible with Arduino IDE 1 5 4 or later user can program debug or upload sketch to Arduino board via Arduino IDE Managed by Web GUI SSH via LAN or WiFi Software upgradable via network Built in web server Support internet connection via LAN port WiFi or 3G dongle Support USB flash to provide storage for Arduino projects Failsafe design provides robustly system Compatible with Arduino Leonardo Uno Duemilanove Diecimila Mega Yun Shield Quick Start Guide 4 14 G oracino 1 5 System Structure www dragino com Yun Shield Block Diagram c L LLM MMS Yun Shield Failsafe Button Arduino Leonardo UNO Dragino HE module POWER The Dragino HE is the core module of Yun Shield The HE module requires around 200ma current when in full load so it is powered by the Arduino VIN pins to avoid overheated in the Arduino onboard 5v LDO So when Yun shield is in used the Arduino board should be powered by DC port instead of USB port The DC input can be 7v 15v Y
3. Console begin Yun Shield Quick Start Guide 8 14 G orrAcino www dragino com 2 5 Upload Sketch 1 Inthe Arduino IDE choose the Arduino Yun board type for Leonardo 2 In Arduino IDE gt port choose the correct port should be Arduino Yun port with an ip address 3 Inthe Yun Shield GUI gt Sensor page choose the Board Type Leonardo 4 Compile the sketch and upload it to the Arduino Board During upload The Yun Shield will ask you to key in the password by default the password is arduino Blink Arduino 1 54 ee a File Edit Sketch Tools Help Compile and upload firmware to avr include Console h gt const int ledPin 8 int incomingByte void setupO Bridge beginO Console becinO Console println You re connected to the Console pinllodeQedPin OUTPUT Compile and Upload sketch in Arduino IDE amp 2 6 Bridge Library The Bridge Library simplifies the communication between the Arduino Board and Yun Shield Bridge commands from the AVR Arduino Board are interpreted by Python on the Yun Shield Its role is to execute programs on the GNU Linux side when asked by Arduino provide a shared storage space for sharing data like sensor readings between the Arduino and the Internet and receiving commands from the Internet and passing them directly to the Arduino There are detail explain and lots of example to show how to use Bridge in the Arduino Official Website Reference link i
4. G orrAcino Yun Shield Quick Start Guide www dragino com VERSION 1 0 Version Description Date 1 0 Release 2014 Jul 08 Yun Shield Quick Start Guide 1 14 G DRAGINO www dragino com Index L Introd CtiO Nesses sea Sense ea renee meee ct eres oe erent E mente E Ea 3 1 1 About this QUICK start guide aisis sccnoicninicndsasnipoictaninnsandtwodetdndandeesemionedaniwossy 3 1 2 Whatis Yun Shield as csicsiss cct cscstiaiivatysaveanetiardvadatovanssteaideadyinveanttoardeadeinvenasbiads 3 L3 Specifications ae ee cen ere rere een eet rene eee Treen ee 3 L4 Features soc nescctscnesneeveheavestansantevicansvsesentocsedeadcaasdunddeandscadeansensenaederscened endes 4 1 5 System Structure 2 ec ceeeec cee eeeeeeeneaneerceneasereeneasersenceseeteasasersenaeneerans 5 2 Setup and use Yun SHS Geico cans enc ties cencetan cone tidentesievd anebindtentetarvanebibientetaddnnbibey 7 2 1 Connect to Leonardo and POWET ccccccccccccceccececeecceccececeeceeeeceeeeeeeeeeess 7 2 2 Connect LO Yun Shield ssc once ceacicsnds sae sadeacinnadaccensadsaceudeduncen tecsactsaadancenseeanten 7 2 3 Set Up Yun Shield to access internet ccccccccccccccccccceccceceeeeeeeeeeeeeeseeeess 8 2 4 Detect Y n Shield ec case ecersacuencnette n n E 8 2 5 Upload Sk tch rencrien a 9 2 6 Bridge LIBGARY cares soecscndsccensateacancadeanensadsinaseecsanenaadeancsgatassensadsandtendaacensatances 9 3 EMAC Ss sess ck texte tn enn neh ipeat
5. else if the buffer is empty Cosole read returns 1 name c append the read char from Console to the name string Screen Shot Yun Shield Quick Start Guide 10 14 DRAGINO www dragino com ConsoleRead Arduino 15 612 a m mn File Edit Sketch Tools Help ConsoleRead Console println Hi what s your name fee Arduino at 172 31 255 254 Arduino Y n void loop if Console available 0 gt 0 Hi what s your name char ce Console readQ read the next char receiv Hi edwin Mice to meet you ff look for the newline character this is the last c if ess Ww Hi what s your name ffprint text with the name received Console print Hi Console print name Console println Nice to meet you Console printlnQ f Ask again for name and clear the old name Console println Hi what s your name name ff clear the name string else ff if the buffer is empty Cosole read ri name c append the read char from Console to Autoscroll No line ending lt Yun Shield Quick Start Guide 11 14 G orracino 3 2 Example 2 Upload data to loT Server www dragino com Introduction This example shows how to log data to the public loT server Xively The example is a modified version change Serial to Console to fit for different Arduino Board and debug over WiFi from Arduino IDE
6. le begin while Console wait for Network Serial to open Console printIn Xively client Do a first update immediately updateData sendData lastRequest millis void loop get a timestamp so you can calculate reading and sending intervals long now millis Yun Shield Quick Start Guide 12 14 G orrAcino if the sending interval has passed since your last connection then connect again and send data if now lastRequest gt postingInterval updateData sendData lastRequest now void updateData convert the readings to a String to send it dataString Temperature dataString random 10 20 add pressure dataString nPressure dataString random 5 100 this method makes a HTTP connection to the server void sendData form the string for the API header parameter String apiString X ApiKey apiString APIKEY form the string for the URL parameter String url https api xively com v2 feeds url FEEDID url csv www dragino com Send the HTTP PUT request form the linux command and use Process Class to send this command to Yun Shield s better to declare the Process here so when the sendData function finishes the resources are immediately released Declaring it global works too BTW Process xively Console print n nSending data xively begin curl xi
7. ll TP LINK edwin M AAMAS At the first boot of Yun Shield it will auto generate an unsecure WiFi network call Dragino2 xxxxxx User can use their laptop to connect to this WiFi network The laptop will get an IP 192 168 240 xxx and the Yun Shield has the default IP 192 168 240 1 Once user joins the network they can use web browser recommend Firefox and Chrome and enter 192 168 240 1 to enter the Yun Shield setting page be a a a a Sani Oar ol ar or E 192 168 200 109 diniucindpoel honap Bones o AMEANS EFLA RAR E aam PLS O R Bir ar Default Password for Yun Shield is Arduino Yun Shield Quick Start Guide 7 14 E orvAcino www dragino com 2 3 Set Up Yun Shield to access internet After log in the GUI will show the WIFI ETH interface status Click the Configure button and now user can configure Yun Shield to access internet via your WiFi router EF 192168 40 1 ey binjhwerrrrod 257M 5 oaas umes a 2 4 Detect Yun Shield Assume your laptop and Yun Shield are in the same network The Yun Shield will broadcast data in this network and Arduino IDE will receive this data and show the Yun Shield in Tools gt Port File Edit Sketch Tools Help Auto Format Ctrl T Archive Sketch Fix Encoding amp Reload include Consol Serial Monitor Ctrl Shift M const int ledPin Board gt i void setup 0 Programmer gt ff initialize Burn Bootloader Bridge begin
8. mame a eee baa teat an eetnas aa anai bane 10 3 1 Example 1 Say hello to Linx cecacstscorvacnscawetscanones covinessocanensscusdeneddeunniweause 10 3 2 Example 2 Upload data to loT Server sssssssssssesssesesesesesesererererereeeresereeee 12 Yun Shield Quick Start Guide 2 14 G orrAcino www dragino com 1 Introduction 1 1 About this quick start guide This is a quick start guide to introduce what is Yun Shield and how to use Yun Shield with Arduino Leonardo and run simple Bridge examples For more detail about Yun Shield system other features or use with other Arduino boards Please refer the Yun Shield User Manual 1 2 What is Yun Shield Yun Shield is one of the most powerful shields for Arduino Board Yun Shield is designed to solve the Internet connectivity and storage issue for Arduino Board Yun Shield runs Open Source OpenWrt system Same system as runs in Arduino Yun and it is fully compatible with Arduino IDE v1 5 4 or later Yun Shield is the ideally choice for Arduino Projects which require various internet connections and more storage Basically Yun Shield Leonardo equally to the official Arduino Yun but Yun Shield is more flexible because it can work with other Arduino board such as Uno Duemilanove Mega etc And Yun Shield uses external wifi antenna which provides stability and possibility for various environments 1 3 Specifications gt Processor 400MHz 24K MIPS Flash 16MBytes RAM 64MBytes Power Input
9. s http arduino cc en Reference YunBridgeLibrary and there are two examples in next chapter Yun Shield Quick Start Guide 9 14 G orracino www dragino com 3 Examples 3 1 Example 1 Say hello to Linux Introduction This example is a hello test between the Arduino and Yun Shield The example can be found on the Arduino IDE gt File gt Examples gt Bridge gt ConsoleRead Tutorial of this example can be found on http arduino cc en Tutorial ConsoleRead Below listing the code and add some detail to understand it with the Yun Shield Code include lt Console h gt use Console class for Arduino IDE debug over WiFi similar to Serial class String name void setup Initialize Console and wait for port to open Bridge begin Console begin Wait for Console port to connect while Console Console printIn Hi what s your name Data flow Arduino gt Yun Shield gt Arduino IDE void loop if Console available gt 0 char c Console read read the next char received data flow IDE gt Yun Shield gt Arduino ook for the newline character this is the last character in the string if c n print text with the name received Console print Hi Console print name Console printIn Nice to meet you Console printIn Ask again for name and clear the old name Console printIn Hi what s your name name clear the name string
10. un Shield Quick Start Guide 5 14 G orrAcino www dragino com The USB Host of Yun Shield gets power from the Arduino 5v pin since the 5v from Arduino comes from the 5V LDO to avoid overheated on the Arduino Board when the USB host is in used it is recommended to use 7v DC Interface The RJ45 WiFi USB Host and Failsafe are connected to the Dragino HE module directly And the Dragino HE module use SPI and UART to communicate with Arduino Board Yun Shield is compatible with 3 3v and 5v Arduino board The on board jumper SV1 is used to set the SPI and UART to 3 3v or 5v level The SPI interface is used to upload the sketches comes from the Arduino IDE SPI interface only connects to Dragino HE during uploading so the Arduino SPI can still be used to connect to other SPI slave devices The UART interface is used for the Bridge class in Arduino there are lots of examples explain how to use the bridge class in the Arduino IDE It is the core of Yun solution We must make sure the serial Interface of Arduino is not used by other hardware Yun Shield Quick Start Guide 6 14 G orrAcino www dragino com 2 Setup and use Yun Shield 2 1 Connect to Leonardo and power Simply put the Yun Shield on the top of Arduino Leonardo and Power the Leonardo via the DC Jack 2 2 Connect to Yun Shield Saree Dragino A84041136FFC Internet i414 ARE FRA SA VPN amas USB KEY DIAL WCDMA FASS a Dragino A84041136FFC Bik Ma
11. vely addParameter k xively addParameter request xively addParameter PUT xively addParameter data xively addParameter dataString xively addParameter header xively addParameter apiString xively addParameter url xively run Console printIn done f there s incoming data from the net connection send it out the Console while xively available gt 0 char c xively read Console write c Yun Shield Quick Start Guide 13 14 G oracino www dragino com Screen Shot 200 PUT feed 03 33 46 UTC Pressure 102 200 puT feed 03 32 44 UTC Test upamde ieee seconds agd Arduino at 172 31 255 254 Arduino Yan 104 Xively client 109 30 31 32 33 Sending data lt 5 minutes raw datapoints Z Edit Delete Temperature 29 degree Last updated a few seconds ago Sending data No line ending v 300 baud 2029 30 31 32 33 lt 5 minutes raw datapoints Triggers Triggers provide push capabilities by sending HTTP POST requests to a URL of your choice when a condition has been satisfied Xively Dashboard Yun Shield Quick Start Guide 14 14

Download Pdf Manuals

image

Related Search

Related Contents

Shure X100E User's Manual  Descargar PDF  18 Ga. x 2” Brad Nailer Kit Ens. de Cloueuse de Finition 18 Ja. x 2”    INHALT 1  LeapFrog PP03S Lawn Mower User Manual  

Copyright © All rights reserved.
Failed to retrieve file