The latest OpenWRT release (Chaos Calmer) has already there for a long time. It ships with Linux kernel version 3.8.21 which supports 6LowPAN via Bluetooth Low Energy (BLE). Both of them features Open WRT routers as a very good solution for the Nordic IoT SDK. This made the developers easier to consider IPv6 in BLE solutions.
The Arduino Yún is a microcontroller board based on the ATmega32u4 and the MIPS @400MHz Atheros AR9331, 64 MB RAM and 16 MB FLASH. The Atheros processor supports a Linux distribution based on OpenWrt named OpenWrt-Yun. The board has built-in Ethernet and WiFi support, a USB-A port, micro-SD card slot, 20 digital input/output pins (of which 7 can be used as PWM outputs and 12 as analog inputs), a 16 MHz crystal oscillator, a micro USB connection, an ICSP header, and a 3 reset buttons.
This blog series will summery the procedures of setting up 6LowPAN via BLE using OpenWRT and Arduino Yún. The first one will introduce how to flash a new firmware from web panel (Luci).
The version of the official OpenWRT named OpenWRT-Yun is 12.09 Attitude Adjustment and it has not been updated for a very long time. But we should thanks RedSnake64 who brings third-party Chaos Calmer support for Arduino Yún. Though not all the software packages from OpenWRT-Yun can work property, it is still enough for our test for 6LowPAN BLE.
Before we start, we should firstly introduce the hardwares:
- Arduino Yún
- BLE USB doggle
- nRF 52 DK
The firmware flashing procedures are more or less the same with installing OpenWRT in router. They involve downloading the OpenWRT image, flashing the image via webpage or U-Boot. You can also extend the root file system with the SD card later.
1. Getting image from GitHub
The firmware of Chao Calmer 15.05 for Arduino Yún is avaiable for download at https://github.com/RedSnake64/openwrt-yun/releases. The latest version is 1.2 when I write this blog. Please download the binary file with sysupgrade. By using the sysupgrade image your configurations can be reserve.
2. Flashing the image vie web panel
The default WiFi mode is AP which you could connect it as a WiFi client. But in such situation. Neither your computer and Arduino Yún can not connect the Internet. Therefore at first we should config the Arduino Yún in Client mode and connect your WiFi router.
2.1 Following Start Guide to configurate the Arduino Yun as WiFi client and log in;
2.2 Clicking CONFIGUARATION button;
![arduino_yun_webpage_index.png](https://clockworkbird9.wordpress.com/wp-content/uploads/2016/01/arduino_yun_webpage_index.png?w=584)
2.3 Clicking advanced configuration panel (luci) on the top;
![arduino_yun_webpage_configuration.png](https://clockworkbird9.wordpress.com/wp-content/uploads/2016/01/arduino_yun_webpage_configuration.png?w=584)
2.4 Selecting System -> Backup / Flashing Firmware;
![arduino_yun_web_flash_firmware.png](https://clockworkbird9.wordpress.com/wp-content/uploads/2016/01/arduino_yun_web_flash_firmware1.png?w=584)
2.5 Clicking Choose File to select the downloaded firmware and clicking Flash image … in the subsection Flash new firmware image;
![arduino_yun_web_firmware_and_flash.png](https://clockworkbird9.wordpress.com/wp-content/uploads/2016/01/arduino_yun_web_firmware_and_flash.png?w=584)
2.6 After uploading the firmware the calculating the checksum, clicking the Proceed button to start the flashing procedure;
![arduino_yun_web_flash_firmware_final.png](https://clockworkbird9.wordpress.com/wp-content/uploads/2016/01/arduino_yun_web_flash_firmware_final.png?w=584)
2.7 Have a coffee and waiting for about 5 min;
2.8 Login the Arduino Yún and checking the firmware version;
![arduino_yun_web_firmware_check.png](https://clockworkbird9.wordpress.com/wp-content/uploads/2016/01/arduino_yun_web_firmware_check.png?w=584)
References:
- https://devzone.nordicsemi.com/blogs/698/openwrt-series-1-setting-up-tp-link-wdr4300-or-n75/
- https://devzone.nordicsemi.com/blogs/663/6lowpan-for-bluetooth-low-energy-on-openwrt/
- https://developer.nordicsemi.com/nRF5_IoT_SDK/doc/0.9.0/html/a00089.html
- https://wiki.openwrt.org/doc/howto/bluetooth.6lowpan
- https://github.com/RedSnake64/openwrt-yun