Implementasi Embedded Linux pada Jaringan Sensor Nirkabel Platform Imote2

Catatan

Abstrak

Pendahuluan

Intel Mote 2 (Imote2)

Implementasi Embedded Linux

tar xzvf /lokasi-file/nama-file.tar.gz
tar xjvf /lokasi-file/nama-file.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 /lokasi-directory-Linux-kernel 
export ARCH=arm
export CROSS_COMPILE=/lokasi-directory-cross-compiler/lokasi-bin/nama-cross-compiler-
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 /lokasi-directory-Linux-kernel/lokasi-file-imote2-linux_defconfig/imote2-linux_defconfig /root/.config
cp arch/arm/configs/imote2-linux_defconfig /root/.config
make menuconfig
make jenis-image
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 /lokasi-openocd-yang-telah-diinstalasi
openocd -f /lokasi-file-configuration -f /lokasi-file-configurationintelmote
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 /lokasi/file/configuration –f /lokasi/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
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 (pengirim data otomatis)
ln –s /root/tosmac/CntToLeds /etc/rc5.d/S14Transmitter (pengirim data otomatis)
//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\. Konfigurasi modul USB-Host. 
Device Drivers >USB support >Support for Host-side USB <*>
>USB device filesystem [*]
>USB device class-device (DEPRECATED)[*]
>USB Monitor<*>
>OHCI HCD support<*>
2\. Konfigurasi modul Wireless LAN 802.11\.
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) [*]
3Konfigurasi modul driver TP-Link WN-321G (rt73).
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
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

Simpulan

Referensi

Mirror

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