Embedded Linux implementation on Imote2 Platform Wireless Sensor Networks

Note

  • This is my English translated paper of the original Indonesian paper published at National Conference on Smart-Green Technology in Electrical and Information Systems (CSGTEIS), Bali, 14–15 November 2013.
  • The copyright has been transferred to the Department of Electrical Engineering, Faculty of Engineering, Udayana University, and based on the agreement, the author is allowed to upload this article to blogs and websites on the to provide the link to the copyright owner’s publication website, namely https://ojs.unud.ac.id/index.php/prosidingcsgteis2013/article/view/7259. This means that all of these writings are not licensed under creative commons but copyrighted © under Department of Electrical Engineering, Faculty of Engineering, Udayana University where other people must ask for permission from us for reposting.
  • Authors: Fajar Purnama, I Made Oka Widyantara, dan Nyoman Putra Sastra.

Abstract

Previously, wireless sensor network (WSN) Imote2 used the Intel Platform X, SOS, and TinyOS operating systems. Now Platform X and SOS are no longer being developed, so many researchers are using TinyOS. End users of TinyOS on the Imote2 platform encounter many limitations such as implementing complex routing. Therefore the Embedded Linux community develops embedded Linux for the Imote2 platform. This paper discusses in detail the steps to embed Linux on the target, namely the Imote2 platform WSN radio sensorboard device. Host is a Linux operating system. The developer includes 3 main components, namely the bootloader, Linux kernel, and filesystem. Embedding is done by flashing the JTAG interface using the OpenOCD software. After embedding, configuration is done on the target via serial connection. Configuration includes automatically enabling IP address, SSHD, and radio. Finally compared to the target performance using IEEE 802.11 WLAN and IEEE 802.15.4 ZigBee as transmission media. The result is that the use of IEEE 802.11 WLAN is more wasteful of memory and electricity.

Introduction

Overall this paper consists of 4 parts. The first part of “Introduction” provides a brief overview of wireless sensor networks (WSN), some of the research that has been done in the field of WSN, and what will be discussed in this paper. The second part “Intel Mote 2 (Imote2)” describes WSN devices with the Imote2 platform. In this section you can see the physical form of the tool and mention some of the operating systems that are implemented on this platform. In the third part “Embedded Linux Implementation”, the steps for installing the Linux operating system on the Imote2 platform are written. The last part is “Conclusion”.

Image for post
Image for post

Intel Mote 2 (Imote2)

Imote2 is a platform on the WSN device developed by Intel Research in the platform X research section. This device is built with low power consumption, with a PXA271 XScale CPU processor, and is integrated in IEEE 802.15.4 ZigBee [10]. This processor (Intel Xscale processor PXA271) can operate at low voltages (0.85V) and frequencies of 13MHz to 104MHz. The frequency can be increased up to 416MHz by setting the voltage [11]. In general, Imote2 consists of 4 parts as shown in Figure 2.

Image for post
Image for post

Embedded Linux Implementation

The device used is the same as the ones used in [6–9] and [13–15], the Imote2 platform multimedia sensorboard radio has (i) 256KB SRAM memory (ii) 32MB flash (iii) 32MB SDRAM (iv) integrated radio with 802.15.4 (v) optional radio from SDIO and UART (vi) 2.4GHz antenna (vii) basic and advanced connectors such as 3xUART , I2C, 2xSPI, SDIO, I2S, AC97 audio, USB host, I/F camera, mini USB GPIO. The architecture of the device can be seen in Figure 3.

Image for post
Image for post
Image for post
Image for post
tar xzvf /file-location/file-name.tar.gz
tar xjvf /file-location/file-name.tar.bz2
chmod –R 777 /lokasi-directory/namadirectory
tar xzvf linux-gcc-4.1.2-arm-xscale-linux-gnu-glibc-2.3.3.tgz 
chmod –R 777 arm-xscale-linux-gnu
apt-get install libncurses5-dev libusb-dev libftdi1 libftdi-dev ldconfig mtd-tools ssh
cd /Linux-kernel-directory-location 
export ARCH=arm
export CROSS_COMPILE=/cross-compiler-directory-location/bin-location/cross-compiler-name
tar xzvf linux-2.6.29.1.tar.gz  
chmod –R 777 linux-2.6.29.1
cd linux-2.6.29.1
export ARCH=arm
export CROSS_COMPILE= ../arm-xscale-linux-gnu/bin/arm-xscale-linux-gnu-
cp /Linux-kernel-directory-location/imote2-linux_defconfig-file-location/imote2-linux_defconfig /root/.config
cp arch/arm/configs/imote2-linux_defconfig /root/.config
make menuconfig
make image-type
make zImage
make module 
make INSTALL_MOD_PATH=$PWD/modules modules_install
mkfs.jffs2 --squash-uid -r ./linux-rootfs -o rootfs.jffs2 -e 0x20000 --pad=0x01000000
mkfs.jffs2 --squash-uid -r ./linux-rootfs -o rootfs.jffs2 -e 0x20000 --pad=0x01DC0000
./configure --enable-ft2232_libftdi 
make
make install
chmod –R 777 /installed-openocd-locations
openocd -f /configuration-file-location -f /configurationintelmote-file-location
tar xjvf openocd-0.4.0-rc1.tar.bz2 
cd openocd-0.4.0-rc1
./configure --enable-ft2232_libftdi
make
make install
chmod –R 777 /usr/local/bin/openocd
openocd -f /location/file/configuration –f /location/file/configuration-intelmote
openocd –f /usr/local/share/openocd/scripts/interface/ jtagkey.cfg –f board/crossbow_tech_IMote2.cfg 
telnet localhost 4444
reset halt
flash protect 0 0 258 off
flash erase_sector 0 0 258
flash write_image blob-im2 0x0 bin
flash write_image linux-2.6.29.1/arch/arm/boot/zImage /zImage
0x00040000 bin
flash write_image rootfs.jffs2 0x00240000 bin
Image for post
Image for post
  • /dev/ttyUSB1 (atau 0)
  • Speed 115200
  • Data bit: 8
  • Stop bit: 1
  • Parity: none
  • Flow control: XON/OFF
ln -s /etc/init.d/networking /etc/rc2.d/S10networking 
ln -s /etc/init.d/sshd /etc/rc2.d/S11sshd
ln -s /etc/init.d/networking /etc/rc5.d/S10networking
ln -s /etc/init.d/sshd /etc/rc5.d/S11sshd
vi /etc/init.d/networking (ganti IP address)
vi /etc/network/interfaces (ganti IP address)
#!/bin/sh 
insmod /lib/modules/2.6.29.1_r1.1/kernel/arch/arm/mach-pxa/ssp.ko
insmod /lib/modules/2.6.29.1_r1.1/kernel/drivers/tosmac/tos_mac.lo
mknod /dev/tosmac c 240 0
ln –s /root/tosmac/loaddriver /etc/rc2.d/S12loaddriver 
ln –s /root/tosmac/loaddriver /etc/rc5.d/S12loaddriver
ln –s /root/tosmac/CntToLeds /etc/rc2.d/S14Transmitter (automatic data sender)
ln –s /root/tosmac/CntToLeds /etc/rc5.d/S14Transmitter (automatic data sender)
Image for post
Image for post
Image for post
Image for post
//baris pertama
#include <mach/ohci.h>
//isi
/*
* Configure USB Host (OHCI)
* For Imote2 the following configuration is used:
* USB Port 1 is used as USB Host
* USB Port 2 is used as USB Gadget (as default for Imote2)
*/
static int imote2_ohci_init(struct device *dev) {
return 0;
}
static struct pxaohci_platform_data imote2_ohci_platform_data = {
.port_mode = PMM_NPS_MODE,
.init = imote2_ohci_init,
.flags = ENABLE_PORT1 | NO_OC_PROTECTION,
.port_mode = PMM_PERPORT_MODE,
.power_budget = 150, //300
};
//baris terakhir
pxa_set_ohci_info(&imote2_ohci_platform_data);
1\. Configure the USB-Host module. 
Device Drivers >USB support >Support for Host-side USB <*>
>USB device filesystem [*]
>USB device class-device (DEPRECATED)[*]
>USB Monitor<*>
>OHCI HCD support<*>
2\. Configure the 802.11 Wireless LAN module.
Networking support >wireless >Improved wireless configuration API (M)
>nl80211 new netlink interface support [*]
>Wireless extensions sysfs files [*]
>Common routines for IEEE802.11 drivers (M)
>Generic IEEE 802.11 Networking (M)
>Enable LED triggers [*]
Device Drivers >Network device Support >Wireless LAN
>Wireless LAN (IEEE 802.11) [*]
3\. TP-Link WN-321G (rt73) driver module configuration.
Device Drivers >Network Device Support>Wireless LAN
>Ralink driver support [M]
>Ralink rt2501/rt73 (usb0 support) [M]
>Ralink debug output [*]
tar xvf TpLink_TL_WN321G_in_Linux.tar  
cd TpLink_TL_WN321G_in_Linux/Module/
gedit Makefile
  1. Omitting lines “PLATFORM=PC” and “PLATFORM=CMPC”.
  2. Manages links from compiled kernel sources.
ifeq ($(PLATFORM),EMBEDDED)  
LINUX_SRC=../linux-2.6.29.1
endif
#export ARCH=arm
#export CROSS_COMPILE=../arm-xscale-linux-gnu/bin/arm-xscale-linux-gnu-
#make all
scp rt73.ko root@192.168.99.101:/root rt73.ko
ssh –l root 192.168.99.101 
vi /etc/rc2.d/S50StartupScript
#********************************************************* 
#********S50StartupScipt File*****************************
#********This file configures Wlan on Imote2**************
#install driver
cd /root/
insmod rt73.ko
echo -n 1 > /sys/bus/usb/devices/1-1/bConfigurationValue
#Configure Wlan
sleep 10
ifconfig rausb0 up
iwconfig rausb0 essid imote2
iwconfig rausb0 mode ad-hoc
ip link set rausb0 up
ifconfig rausb0 inet 192.168.1.2
ifconfig rausb0 netmask 255.255.255.0
ifconfig rausb0 gateway 192.168.1.1
#********EOF S50StartupScript File*************************
chmod 777 S50StartupScript
Image for post
Image for post

Conclusion

From this paper, the following conclusions can be drawn:

  1. To embed the bootloader, Linux kernel, and filesystem on the target via the JTAG interface using OpenOCD software, the process is called flashing.
  2. Target configuration includes automatic activation of IP addresses, SSHDs, and radios via serial connection, by linking to configuration scripts in RC level 2 and level 5.
  3. From research [6] and [7] use transmission media with the IEEE 802.11 WLAN standard on the Imote2 platform it is more wasteful of memory and power than using transmission media with the IEEE 802.15.4 ZigBee standard.

Reference

  1. H. Y. Shwe, C. Wang, P. H. J. Chong, A. Kumar. “Robust Cubic-Based 3-D Localization for Wireless Sensor Networks,” wireless sensor network, vol. 5, no. 9, hal. 169–179, September 2013. [online]. Tersedia: www.scirp.org. [access on: 12 Oktober 2013]
  2. http://upload.wikimedia.org/wikipedia/commons/thumb/2/21/WSN.svg/537px-WSN.svg.png. [access on: 14 Oktober 2013]
  3. N. P. Sastra. “Wireless Sensor Network,” 18 Desember 2009. [Entri Blog]. Blog Wireless Sensor Network Nyoman Putra Sastra. Tersedia: http://staff.unud.ac.id/~putra/2009/12/18/wireless-sensor-network.html. [access on: 14 Oktober 2013].
  4. N. P. Sastra, Wirawan, G. Hendrantoro, “Virtual View Image over Wireless Visual Sensor Network,” Telkomnika, vol.9, no.3, hal. 489–496, Desember 2013. [online]. Tersedia: http://journal.uad.ac.id/index.php/TELKOMNIKA/article/view/1286/677. [access on: 14 Oktober 2013].
  5. N. P. Sastra, D. M. Wiharta, I. M. O. Widyantara, Wirawan. “Modeling Wireless Visual Sensor Network with a Low Energy Consumption for Desired Image Quality and View Point,” academia.edu shared research [online]. Tersedia: http://www.academia.edu/831948/Modeling_Wireless_Visual_Sensor_Network_with_a_Low_Energy_Consumption_for_Desired_Image_Quality_and_View_Point. [access on: 14 Oktober 2013].
  6. I. M. Wiasta, “Performasi Platform Imote2 pada Jaringan Sensor Nirkabel,” Laporan Tugas Akhir, Jurusan Teknik Elektro., Universitas Udayana, 2012.
  7. F. S. Natha, “Performasi Platform Imote2 Menggunakan Standar 802.11 pada Jaringan Sensor Nirkabel,” Laporan Tugas Akhir, Jurusan Teknik Elektro., Universitas Udayana, 2012.
  8. N. P. Sastra, Wirawan, G. Hendrantoro, “Design and Implementation of Wireless Multimedia Sensor Network Nodes Based on Linux OS,” academia.edu shared research [online]. Tersedia: http://www.academia.edu/454554/Design_and_Implementation_of_Wireless_Multimedia_Sensor_Network_Nodes_Based_on_Linux_OS. [access on: 14 Oktober 2013].
  9. N. P. Sastra. “Test Capture Image pada Intelmote 2 aka My First IMB400 Image,” 18 April 2010. [Entri Blog]. Blog Wireless Sensor Network Nyoman Putra Sastra. Tersedia: http://staff.unud.ac.id/~putra/2010/04/18/test-capture-image-pada-intelmote-2-aka-my-first-imb400-image.html. [access on: 18 September 2013].
  10. Stanford, “Imote2,” stanford.edu [online]. Tersedia: http://tinyos.stanford.edu/tinyos-wiki/index.php/Imote2 [Terakhir dimodifikasi: 15 Mei 2013, 14:07].
  11. Jorg Kasteleiner, “Principles of applying Embedded Linux on Imote2,” Diploma Thesis, Faculty of Computer Science and Engineering., University of Applied Sciences Frankfurt am Main, 2010.
  12. WSN_Imote2_HW_Bundle_Datasheet,” Crossbow Technology Inc, San Jose, California.
  13. N. P. Sastra. “Langkah-Langkah Instalasi TinyOS 2.1.0 Intel mote 2 pada Ubuntu 8.04/9.04/9.10,” 18 Desember 2009. [Entri Blog]. Blog Wireless Sensor Network Nyoman Putra Sastra. Tersedia: http://staff.unud.ac.id/~putra/2009/12/18/langkah-langkah-instalasi-tinyos-untuk-intel-mote2.html. [access on: 18 September 2013].
  14. N. P. Sastra. “Flashing Program pada Intelmote2,” 17 April 2010. [Entri Blog]. Blog Wireless Sensor Network Nyoman Putra Sastra. Tersedia: http://staff.unud.ac.id/~putra/2010/04/17/flashing-program-pada-intelmote2.html. [access on: 18 September 2013].
  15. N. P. Sastra. “Tutorial Instalasi Linux embedded system pada intel mote2 (imote2) board,” 16 Juni 2010. [Entri Blog]. Blog Wireless Sensor Network Nyoman Putra Sastra. Tersedia: http://staff.unud.ac.id/~putra/2010/06/16/tutorial-instalasi-linux-embedded-system-pada-intel-mote2-imote2-board.html. [access on: 18 September 2013].

Mirror

Written by

this blog contains all my articles licensed under creative commons attribution customized sharealike (cc-by-sa) where you can sell but mention the open one here

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store