Iduino Yun Shield
Contents
- 1 Introduction
- 2 Interfaces
- 3 How to set up Iduino_Yun_Shield
- 4 Use with Arduino Board
- 5 Example
- 6 FAQ
- 6.1 The advantages of Iduino_Yun_Shield compared to official Arduino Yun
- 6.2 Is Iduino_Yun_Shield compatible with different Arduino boards?
- 6.3 How to set up /www/sd and mnt/sd?
- 6.4 What if Arduino IDE doesn’t detect Iduino_Yun_Shield?
- 6.5 Where can you find the source code of the Iduino_Yun_Shield?
- 6.6 How to upload, download or edit the files in Iduino_Yun_Shield?
- 6.7 How to reset Iduino_Yun_Shield?
- 6.8 How to recover the Iduino_Yun_Shield in case firmware crash?
- 6.9 How to get it
Introduction
Iduino_Yun_Shield, an extremely powerful development for Arduino board, is designed to solve the problems of connection and storage which exist in the Arduino board. Iduino_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 versions. Yun Shield is an ideal choice for Arduino Projects which require various internet connections and more storage.
Actually, Iduino_Yun_Shield is equal to the official Arduino Yun, but Iduino_Yun_Shield is more flexible because it can work with other Arduino board such as Uno, Duemilanove, and Mega etc. Iduino_Yun_Shield uses external antenna which provides stable connection under various environments.
The Iduino Yun is the core module of Iduino_Yun_Shield. And it requires 200mA current when in full load, so it is powered by the Arduino VIN pins to avoid overheated in the Arduino onboard 5V LD0.
Features
- Open source Linux system (OpenWrt) inside
- Low power consumption
- Compatible with Arduino IDE 1.5.4 or later versions. Users can program, debug or upload Sketch to Arduino board
- Managed by Web GUI, SSH via LAN or Wifi
- Software upgradable via network
- Support internet connection via LAN port, Wifi or 3G dongle
- Support USB flash to provide storage for Arduino projects
- Reliable design provides robust system
- Compatible with Arduino Leonardo, Uno, Duemilanove, Diecimila and Mega
Overview and Hard ware Resources
- Processor: 400MHz, 24 MIPS
- Flash: 16MB
- RAM: 64MB
- Power input: 4.75V~23V via Arduino Vin pin
- 1×10M/100M RJ45
- Connector 150M Wifi 802.11 b/g/n
- External antenna via I-Pex
- 1×USB port for USB storage or 3G connection
- 1×Reset button
- Compatible with 3.3V or 5V I/O Arduino
Size: 70mm * 53mm*24mm
Weight: 33.2g
Software Resource
Compiling environment: Arduino IDE 1.5.4 or later version
Source
The Open Source hardware of Iduino_Yun_Shield: https://github.com/dragino/modules/tree/master/hardware/YunShield
The Open Source code of Iduino_Yun_Shield: https://github.com/dragino/linino
The official webpage of Arduino Yun Bridge: http://arduino.cc/en/Reference/YunBridgeLibrary
The official forum of Arduino Yun http://forum.arduino.cc/index.php?board=93.0
Interfaces
Interface layout
Interface specifications
- RJ45, Wifi, USB port and Failsafe are connected to the Iduino Yun module directly, and the Iduino Yun module uses SPI and UART to communicate with Arduino board
- The SPI interface is used to upload the sketch coming from the Arduino IDE. SPI interface connects to Iduino Yun only in the upload time, so the Arduino SPI can still be used to connect to the other slave devices.
- The pins of two sides are respectively connected to the corresponding pins of Arduino
How to set up Iduino_Yun_Shield
Getting IP address
There is a Wifi interface a LAN port on the Iduino_Yun_Shield. And they both have an IP address for network connecting and device management.
Factory IP of Wifi port
At the first boot of Iduino_Yun_Shield, an unsecure Wifi network called Iduino-xxxxxx will automatically generate. Users can use their laptop to connect to this Wifi network and the laptop will get an IP 192.168.240.xxx. The default IP of Iduino_Yun_Shield is 192.168.240.1.
FallBack IP
The LAN port of Iduino_Yun_Shield distributes a Fall Back IP
- 172.31.255.254/255.255.255.252
If the user’s laptop IP is
- 172.31.255.253/255.255.255.252
Then you can access Yun Shield by Fall Back IP.
Detect IP from Arduino IDE
If the Ethernet port of Iduino_Yun_Shield is connected to Uplink Router or Wifi Router, the PC in the same network can use Arduino IDE to detect the IP of Iduino_Yun_Shield.
Allocation pattern
The Iduino_Yun_Shield runs Open Source Linux System. If you have a PC which is in the same network with Iduino_Yun_Shield, you can access its system by Web or Secure Shell (SSH).
Webpage access
Use browser (recommend Firefox or Chrome) to set Iduino_Yun_Shield, and you will see login page after entering 192.168.240.1.
Default password for Iduino_Yun_Shield is ‘iduino’.
SSH Access
By SSH Access, users can enter Linux system directory and customize more functions as well as applications.
SSH Access:
- IP address: IP address of Iduino_Yun_Shield
- Port: 22
- User Name: root
- Password: iduino (default)
Webpage Setting
General setting
After login, the GUI will show the WIFI/ETH status.
Click the SYSTEM button, and you can set the device password and parameter.
Settings of Iduino
Click SENSORS button and enter the settings relate to Iduino
Arduino board Type: Define the setting of bootloader/mcu type/fuse during Sketch uploading
Operation Mode: Make sure the mode is Arduino Bridge mode so that the Bridge class can work
Upgrade
You can repair bug, upgrade system, and add new function by upgrading Iduino_Yun_Shield firmware through GUI. Turn to page of GUI→Upgrade and choose correct firmware. The firmware used for webpage upgrade should be Sysupgrade Type, and you can decide to save setting or not after upgrade.
Usually, it takes 2 minutes to upgrade firmware. The Iduino_Yun_Shield will restart automatically and all the LEDs will blink together.
Use with Arduino Board
The Iduino_Yun_Shield uses SPI for uploading sketch and uses UART port for Bridge class to talk to the AVR. While connecting Iduino_Yun_Shield to Arduino board, below points should be checked:
- Whether the Arduino board is powered by DC jack;
- If the board type setting is correct in the Iduino_Yun_Shield;
- If the board type setting is correct in the Arduino IDE;
- Whether the Arduino SPI and UART is not influenced by other hardware
- Make sure the UART mode is in Arduino Bridge.
Connect to Arduino Board
Connect to Leonardo
As is shown in the follow figure, simply plug the Iduino_Yun_Shield on the top of Leonardo, and power the Leonardo via DC jack
In Arduino IDE, the board type selected should be Arduino Yun.
Connect to Arduino Uno
1) In Uno, the UART connection between mega328P and mega16u2 will influence the Bridge feature with Iduino_Yun_Shield. So we have to disconnect it by setting the mege16u2 into reset mode, as below:
Note: USB upgrade/debug won’t work after this change. User must upgrade/debug via Arduino IDE via Wifi.
2) Add board type in the file: Arduino\hardware\arduino\avr\board.txt, as below, and reopen the Arduino IDE:
unoyun.name=Arduino Uno --Iduino Yún unoyun.upload.via_ssh=true unoyun.vid.0=0x2341 unoyun.pid.0=0x0043 unoyun.vid.1=0x2341 unoyun.pid.1=0x0001 unoyun.upload.tool=avrdude unoyun.upload.protocol=arduino unoyun.upload.maximum_size=32256 unoyun.upload.maximum_data_size=2048 unoyun.upload.speed=57600 unoyun.upload.disable_flushing=true unoyun.upload.use_1200bps_touch=true unoyun.upload.wait_for_upload_port=true unoyun.bootloader.tool=avrdude unoyun.bootloader.low_fuses=0xff unoyun.bootloader.high_fuses=0xde unoyun.bootloader.extended_fuses=0x05 unoyun.bootloader.file=optiboot/optiboot_atmega328.hex unoyun.bootloader.unlock_bits=0x3F unoyun.bootloader.lock_bits=0x0F unoyun.build.mcu=atmega328p unoyun.build.f_cpu=16000000L unoyun.build.board=AVR_YUN unoyun.build.core=arduino unoyun.build.variant=standard
Connect to Arduino Duemilanove/Diecimila
1) The mega avr interface on the Duemilanove/Diecimila is connected to the FTDI chip, and we must disconnect them as the below figure:
2) Add a “Duemilanove” board type in the file: Arduino\hardware\arduino\avr\board.txt. User can use the Uno Yun board type if there is mega328P. For mega328/mega168/mega168P, they can modify the upload.maximum_data/upload.maximum_size and build.mcu accordingly.
3) Plug the Iduino_Yun_Shield on the Duemilanove and power it via DC jack.
Connect to Arduino Mega2560
1) In Mega2560, the UART between mega2560 and mega16u2 will influence the Bridge feature with Iduino_Yun_Shield. So we have to disconnect it by setting mega16u2 into reset mode, as below figure:
2) Add a “Mega2560 Yun” board type in the file: Arduino\hardware\arduino\avr\board.txt, as below, and reopen the Arduino IDE:
mega2560Yun.name=Arduino Mega 2560 -- Iduino Yún mega2560Yun.upload.via_ssh=true mega2560Yun.vid.0=0x2341 mega2560Yun.pid.0=0x0044 mega2560Yun.vid.1=0x2341 mega2560Yun.pid.1=0x003f mega2560Yun.upload.tool=avrdude mega2560Yun.upload.protocol=arduino mega2560Yun.upload.maximum_size=258048 mega2560Yun.upload.maximum_data_size=8192 mega2560Yun.upload.speed=57600 mega2560Yun.upload.disable_flushing=true mega2560Yun.upload.use_1200bps_touch=true mega2560Yun.upload.wait_for_upload_port=true mega2560Yun.bootloader.tool=avrdude mega2560Yun.bootloader.low_fuses=0xff mega2560Yun.bootloader.high_fuses=0xd8 mega2560Yun.bootloader.extended_fuses=0xfd mega2560Yun.bootloader.file=stk500v2/stk500boot_v2_mega2560.hex mega2560Yun.bootloader.unlock_bits=0x3F mega2560Yun.bootloader.lock_bits=0x0F mega2560Yun.build.mcu=atmega2560 mega2560Yun.build.f_cpu=16000000L mega2560Yun.build.board=AVR_MEGA2560 mega2560Yun.build.core=arduino mega2560Yun.build.variant=mega
3) Plug the Iduino_Yun_Shield on the Mega2560 and power it via DC jack.
Detect Iduino_Yun_Shield
Make sure your laptop and Iduino_Yun_Shield are in the same network. The Iduino_Yun_Shield will broadcast data in this network and Arduino IDE will show Iduino_Yun_Shield in Tools>Port after receiving this data.
Upload Sketch
1) In the Arduino IDE, choose correct board type for AVR module.
2) In the Arduino IDE, choose correct port (may be the address of Arduino Yun).
3) In the Iduino_Yun_Shield GUI>Sensor page, choose correct board type for uploading.
4) Compile and upload sketch to Arduino board. During uploading, the Iduino_Yun_Shield will ask you to input the password, which is “iduino” by default.
Example
Say hello to Linux
Introduction: This example is a Hello test between Arduino and Iduino_Yun_Shield, which can be found at Arduino IDE--> File --> Examples --> Bridge --> ConsoleRead. The course of this example can be checked at http://arduino.cc/en/Tutorial/ConsoleRead. The code and notes will be shown as below:
Code:
#include <Console.h>//use Console class for Arduino IDE debug over Wifi, similarto Serial class, String name; voidsetup() { // Initialize Console and wait for port to open: Bridge.begin(); Console.begin(); // Wait for Console port to connect while (!Console); Console.println("Hi, what's your name?");//Data flow: Arduino --> Yun Shield --> Arduino IDE } void loop() { if (Console.available() > 0) { char c = Console.read(); //read the next char received, data flow: IDE --> Yun Shield--> Arduino // look 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.println("! Nice to meet you!"); Console.println(); // Ask again for name and clear the old name Console.println("Hi, what's your name?"); name = ""; // clear the name string } Else { // if the buffer is empty Cosole.read() returns -1 name += c; // append the read char from Console to the name string } } }
Test Interface:
FAQ
The advantages of Iduino_Yun_Shield compared to official Arduino Yun
In Hardware Aspect
Both Arduino Yun and Iduino_Yun_Shield have the same CPU, Memory size, and RAM size for the Linux system. The Arduino Yun is an integrated of Linux part and MCU part. Iduino_Yun_Shield is designed as a shield which can be used with existing Arduino boards.
Basically, Iduino_Yun_Shield + Arduino Leonardo equal to an Arduino Yun, but Iduino_Yun_Shield is more flexible because it can be used with other Arduino boards such as Arduino Uno, Duemilanove, and Diecimila etc.
Iduino_Yun_Shield is replicable and reproducible: The design of Iduino_Yun_Shield is open and the most complicated and difficult parts are in the Dragino HE module. User can purchase the Dragino HE module separately to customize their projects and release variant Yun Solution.
Stable and flexible Wifi performance: Arduino Yun uses chip-like antenna design. If there is a shield on the top of Arduino Yun, the Wifi will be greatly shielded and lead to a poor Wifi performance. Instead, Iduino_Yun_Shield uses external antenna design. User can connect different type of antennas to the I-pex connector of Iduino_Yun_Shield and that makes the installation more flexible and the signal can transferred several kilometers.
In Software Aspect
Iduino_Yun_Shield has repaired some bugs and adds more functions as well as supports more board types.
Is Iduino_Yun_Shield compatible with different Arduino boards?
If the Arduino board is different from the supported boards, you can check the following list to check the compatibility:
1.The voltage of Vin pin to power the Iduino_Yun_Shield is 7~15V;
2.The variant has same definition and position of SPI in the ICSP header as the official board;
3.The variant has same definition and position of D0 and D1 pins as the official board
4.Check whether there are ICs connected to the AVR and the UART of SPI, and evaluate if they will influence the communication between Yun Shield and AVR.
The system structure section of Iduino_Yun_Shield well explains the working principle of it. If you are still not sure if Iduino_Yun_Shield is compatible with their boards or having trouble in the compatibility, then you can send the board info to support@dragino.com, and our team will review and check it.
How to set up /www/sd and mnt/sd?
The way to use /www/sd and /mnt/sd is as the same as Arduino Yun. User can prepare a USB flash and create directory /arduino and /arduino/www at the root of USB flash. Then input the USB flash into the Iduino_Yun_Shield and it will automatically create directory /www/sd and /mnt/sd, which link to /arduino and /arduino/www.
What if Arduino IDE doesn’t detect Iduino_Yun_Shield?
You can check the below issues:
- Whether the Arduino version is 1.5.4 or later;
- Whether you PC is in the same network with the Iduino_Yun_Shield;
- If the Iduino_Yun_Shield boots in advance than Arduino IDE, this situation may happen. So try to reboot the Iduino_Yun_Shield and check again.
Where can you find the source code of the Iduino_Yun_Shield?
The source code can be found at https://github.com/dragino/linino
How to upload, download or edit the files in Iduino_Yun_Shield?
Iduino_Yun_Shield has a built-in Linux system and supports SCP protocol. You can download or edit the Linux files using SCP tools. In Windows OS, the SCP tool is winscp. Install it and log into SCP as below:
- Host name: The IP address of Iduino_Yun_Shield
- User name: root
- Password: iduino (default)
- Protocol: SCP
There will be 2 warnings during login and just ignore it. After login, a management panel will appear.
The left part of this panel is your PC’s directories and the right part is the directories of Iduino_Yun_Shield. You can upload/download files by dragging, or double click the file to edit its content.
How to reset Iduino_Yun_Shield?
Iduino_Yun_Shield has a toggle button which can be used for reset. You can press the toggle button to reset the running Iduino_Yun_Shield.
- If pressing the toggle button and release after 5 seconds, it will reset the Wifi setting and other settings will be kept.
- If pressing the toggle button and release after 30 seconds, it will reset all the settings to factory default.
How to recover the Iduino_Yun_Shield in case firmware crash?
There are some cases that the Iduino_Yun_Shield fails to boot. For example, upgrade an improper firmware or lost power during upgrade. But you are still able to recover the Iduino_Yun_Shield by using the U-boot of Iduino_Yun_Shield. An instruction in Windows is shown as below:
Set up TFTP service
Download the TFTP service (recommend tftp32d.exe). And download the latest Yun Firmware at http://www.dragino.com/downloads/index.php?dir=motherboards/ms14/Firmware/Yun/. The firmware we need is the kernel and root-squashes files. Put these files and TFTP at the same directory. Start the TFTP service.
Download Hercules utility
Download Hercules, which is a tool used to transfer commands to Iduino_Yun_Shield under Failsafe mode. Run Hercules and input correct parameters as below:
- Protocol: UDP
- Module IP: 192.168.255.1
- Port: 6666
- Local Port: 6666
Connect the PC to Iduino_Yun_Shield
Connect the PC to Iduino_Yun_Shield via Ethernet cable. Set up PC with below LAN IP 192.168.255.2 and subnet mask 255.255.255.0. Disable PC’s firewall.
Power up Iduino_Yun_Shield to Failsafe mode
Press the Failsafe button and power up Iduino_Yun_Shield, and you will see all the LEDs blink together. Release the button after 10 seconds and some messages will pop up in the Hercules panel, which means the Iduino_Yun_Shield has been in Failsafe mode and ready to access commands.
You can type the commands to Hercules to transfer and update Iduino_Yun_Shield to the latest firmware.
The update commands are as below; replace the xxx with actual version.
Note when typing commands to Hercules: user must add <CR> at the end of each command; $ is a special char in Hercules, user should double it (key 2 $) when typing.
Upgrade Kernel
tftpboot 0x81000000 ms14-arduino-yun-kernel-xxx.bin
erase 0x9fea0000 +0x140000
cp.b 0x81000000 0x9fea0000 $filesize
Upgrade rootfs
tftpboot 0x81000000 ms14-arduino-yun--rootfs-squashfs-xxx.bin
erase 0x9f050000 +0xe50000
cp.b 0x81000000 0x9f050000 $filesize
Reset to the new firmware
Reset
- Warning: User should use correct address in the erase and cp.b. Wrong address may destroy the boot-loader of Iduino_Yun_Shield and the device won’t boot anymore, or destroy the radio data leading to a poor Wifi performance or incorrect MAC address.
Recover in Linux is similar with Windows. The different is that the tool used in Linux is nc, namely nc-kul6666. The figure below shows that the Iduino_Yun_Shield has been in Failsafe mode and detected by nc.
How to get it
Click here to buy: iduino Yun Shield