I'm writing a piece of software for my project on Wireless Sensor Networks. Right now I'm concerned with injecting various packets into network.
I'm using MIB520 interface board with TinyOS-2.1.2 installed on IRIS mote. I've tried various utilities from sdk/c/sf, as well as tools from net.tinyos.sf.* and net.tinyos.tools.* Java packages.
What I tried so far:
I've been using apps/BaseStation and apps/BaseStation15.4 installed on my mote, alternatively flashing it with apps/test/TestSerial. I have no issues with reading data sent from mote via USB. I can read it just fine using net.tinyos.tools.SerialForwarder or utilities from sdk/c/f or net.tinyos.tools *.
But when it comes to sending data from PC to mote nothing seems to work.I used net.tinyos.tools.Send, serialsend.c, sf.c and sfsend.c. SerialForwarder throws error message after a while, while C utilities throw "no ack" error.
After searching for an answer on TinyOS wiki and SO, I figured it might be an issue with mote sending that "ack" message. I was looking for a way to generate and send legitimate packet to mote as suggested here.
Following article on wiki I found appropriate TEP and used bits listed in it ("7e 40 09 00 be ef 05 7d 5d 06 01 02 03 04 05 7e").
I used Wireshark to sniff USB on which I sent data to mote and I saw same bits sent to mote. My theory is either mote doesn't recognize input I've sent or I use utilities incorrectly. Anyway, this specific event never gets triggered:
event message_t* UartReceive.receive(message_t* bufPtr, void* payload, uint8_t len) {
call Leds.led0On();
return bufPtr;
}
My question is, how do I go about sending data to mote from PC? Perhaps there is some ready to use utility I've overlooked? I've been following instructions in BaseStation15.4 but I'm stuck.
Edit:
From BaseStation/README.txt "BaseStation acknowledges a message arriving over the serial link only if that message was successfully enqueued for delivery to the radio link." That would explain "no ack" in serialsend.c and "write failed" in SerialForwarder.java.
But still, the UartReceive.receive() event never gets triggered, even after clearing its body (in BaseStation) and leaving only LED toggle.