Tuesday, March 26, 2013

Motelab Problem with Sender Address (Wireless Sensor Networks)


From last few days, I have been getting a weird problem with my research work. I had written one simple application which was sending packets from Radio To Serial. I developed the application, so that I can check channel diversity. I was getting a sender address from AMPacket.source() method. This code worked fine when I deployed application manually into 3-4 motes, but when I deployed the application in Harvard's Motelab, I got this weird error. Instead of getting actual address of motes, I got "1" as sender address. 

I did search a lot on Google, but couldn't get any satisfying answer. Finally, I received a link - which tried to put some limelight on the problem, but wait a second - the link actually just told that there is a problem with Motelab's configuration - but did not give a solution to that ( at least I couldn't understand). 

Finally, I got solution from Olaf Landsiedel, who provided me his blog's link. That's exactly I was looking for. 

So, whenever anyone gets error with Sender address in Motelab - Please use below code in your starting method and you will be done. 

call ActiveMessageAddress.setAddress 
(call ActiveMessageAddress.amGroup(), TOS_NODE_ID);

Enjoy.  Let me know your views if this resolves your issue.