Blog

Posted 2007/02/20

Mote programming with a mib6000

To program motes you use programming boards. In addition to our serial programming board we have a mib600 which is an Ethernet version. I started working with the motes using the serial board because that is what most of the documentation I was using assumed you had. This post details how I got the Ethernet board working.

I wanted to manage the mib600 IP address my self rather than use the Uni to assign it one. So first I gave my Linux PC an IP alias and then configured the mib to have a static IP on the same subnet. In Gentoo Linux you assign an alias by editing /etc/conf.d/net.


mjeg@crush:~/$ cat /etc/conf.d/net
config_eth0=(
"dhcp"
"192.168.88.1 netmask 255.255.255.0 brd 192.168.88.255"
)

Now we talk to the mib and configure it with a static IP. Obviously you would alter the MAC address to match your own device.


mjeg@crush:~/$ sudo /sbin/arp -s 192.168.88.2 00:20:4A:32:FE:7C
mjeg@crush:~/$ telnet 192.168.88.2 9999
Trying 192.168.88.2...
Connected to 192.168.88.2.
Escape character is '^]'.
*** Lantronix Universal Device Server ***
Serial Number 3265148 MAC address 00204A32FE7C
Software version V5.8.0.1 (041112) LTX
Press Enter for Setup Mode

Press Enter then for sever setup, you can then assign an IP. The rest of the factory defaults were correct for uploading to a mica2 mote, which is done using this command:


mjeg@crush:~/$ uisp -dprog=stk500 -dhost=192.168.88.2 --wr_fuse_h=0xd9 -dpart=ATmega128 --wr_fuse_e=ff --erase --upload if=build/mica2/main.srec

When you want to use Java to talk to a mote via the mib600 there is a gotcha. The mib600 runs a serial forwarder over Ethernet (kind of like the serial forwarder Java program you use with the serial programming board). HOWEVER! you need to change the protocol (not just the IP and port) in the MOTECOM environment variable:


mjeg@crush:~/$ export MOTECOM=network@192.168.88.2:10002