Introduction: Linux, WiFi, Ethernet , USB Shield for Arduino

Picture of Linux, WiFi, Ethernet , USB Shield for Arduino

Yun Shield is an Arduino Shield which will simply "turn" Arduino (Leonardo, UNO, MEGA2560 etc) alike a "Arduino Yun" . It provides a Linux system, WiFi, Ethernet to the Arduino board for connectivity. It also has a USB host port which connect to the Linux system, this port can be used for storage, 3G, Video purpose.

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.

Step 1: Understand the Structure of Yun Shield

Picture of Understand the Structure of Yun Shield

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.

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.

Step 2: Connect It to Arduino Leonardo and Power It Via DC Jack

Picture of Connect It to Arduino Leonardo and Power It Via DC Jack

Put the Yun Shield on top the Arduino and power it via DC jack

Step 3: Use Computer to Connect to Yun Shield

Picture of Use Computer to Connect to Yun Shield

At the first boot of Yun Shield, it will auto generate an unsecure WiFi network call Dragino2-xxxxxx

Use a 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 the computer joins the network, open web browser (recommend Firefox and Chrome) and enter 192.168.240.1 to enter the Yun Shield setting page.

Default Password for Yun Shield is Arduino.

Step 4: Set Up for Internet Access and Detect Yun Shield on Arduino IDE

Picture of Set Up for Internet Access and Detect Yun Shield on Arduino IDE

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.

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 -->Port.

Step 5: Upload Sketch

Picture of Upload Sketch

  • In the Arduino IDE, choose the Arduino Yun board type for Leonardo.
  • In Arduino IDE --> port, choose the correct port. (should be Arduino Yun port with an ip address)
  • In the Yun Shield GUI --> Sensor page, choose the Board Type: Leonardo
  • 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.

Step 6: Understand 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 Yun Bridge Library

Step 7: Example: Log Sensor Data to Xively

Picture of Example: Log Sensor Data to Xively

This example shows how to log data to the public IoT server “Xively”. The example can be found from Arduino IDE--> File --> Examples --> Bridge --> XivelyClient. Tutorial of this example can refer http://arduino.cc/en/Tutorial/YunXivelyClient.

Before upload the sketch, make sure:

  • The Yun Shield already has internet access
  • Input your FEED ID and API KEY according to the Tutorial. Note, The FEED ID should be within double quotation marks “”.

Step 8: Some Advantages for Yun Shield Over Arduino Yun

Flexible:

The Yun shield can be used with different Arduino Boards and different type of avr.

Stable WiFi performance:

Yun Shield use external Antenna to ensure for the better wifi performance, the Arduino Yun use on board antenna, while place an Arduino Shield on top of Arduino Yun, the wifi performance will be strongly decreased because the antenna is under a PCB.

Flexible WiFi design: external antenna provides the feasibility to put the device into a metal enclosure. User can also change the antenna to different antenna type for their project wise. For example, the can set up several kilometers wifi connection with an outdoor directional antenna.

Duplicable and producible:

The design of Yun Shield is open and the most complicate and difficult parts are done in the Dragino HE module. User can use the Dragino HE module to make a customized Yun style product for their products in an easy/rapid/inexpensive way.

Step 9: Documents

Step 10:

Comments

AlexeyG8 made it! (author)2016-02-15

To use this YUN SHIELD with China-clone Arduino UNO R3 (BTE14-04) you must disconnect UART line on the UNO plate - between mega328p chip & CH340G controller (see the picture).

DaleW6 (author)2015-10-11

Hi.

There is no working link to setup xively. Its been removed.

ClausK1 made it! (author)2015-06-22

Just been published:
Arduino for the Cloud:
Arduino Yún and Dragino Yún Shield
(ISBN 978-162734-035-9)

You will find it at http://www.amazon.com/exec/obidos/ASIN/1627340351/ and/or
http://www.barnesandnoble.com/w/arduino-for-the-cl...

JamesC15 (author)2015-01-12

Hi there,

I followed the instructions but when I go to the IDE (1.5.8) I do not see the option to connect to the yun shield under the tools > port menu.

Any thoughts on what I've done wrong? This is with a Arduino Uno R3.The only port that shows up is COM1.

Many thanks

edwin chen (author)JamesC152015-01-12

Hi James,
Did you try the trouble shooting as from this link:
http://wiki.dragino.com/index.php?title=Yun_Shield#Arduino_IDE_doesn.E2.80.99t_detect_Yun_Shield

edwin chen (author)edwin chen2015-01-12

Do you enable firewall in your computer? How about change a different PC?

JamesC15 (author)edwin chen2015-01-12

Hi Edwin,

Thanks for the quick response. I tried everything in the troubleshooting section but I'm still not having any luck. I am able to ssh to the yun shield and I tried running /etc/init.d/avahi-daemon restart but that did not do anything. I've also tried adding a line to the local host file but still no joy.

Any other thoughts?

lezabour (author)2015-01-05

Hi

Very good instructable

I'm trying to do the same with Arduino Uno, but don't seems to work.

I read that there is a step on arduino uno (cf.

http://wiki.dragino.com/index.php?title=Yun_Shield... but i'm not sure how to do the "shortcut" of the pins... Which will "break" on of the uno feature: upload sketch via usb. So i want to be sure of how to plugin Arduino Uno + Shield Yun

Thanks

edwin chen (author)lezabour2015-01-05

Hi, Lezabour,
You can use a jumper to shortcut. This will break the feature to upload via USB, and you will have to upload via WiFi or LAN in Arduino IDE after add the jumper.

Aleator777 (author)2014-07-14

Internet of things, here I come! Thanks for the overview.