Hi,
I'm using a tmote sky programmed with the tinyos2 basestation application,
plugged into a Linksys NSLU-2 network attached storage device. The
basestation returns messages from motes it detects to the serial forwarder
and subsequently the java client application i have written.
The mobile motes (tmote invents) send messages to each other
(BlinkToRadioMessages) that have a defined AM type. When a basestation
detects these (BlinkToRadioMessages) it passes them to the client java
application, which sends a message of a different type (another defined AM
type called "Gimmemsgs") to the basestation via the serial connection, which
is forwarded on via the radio (as per the basestation application
specification) and the mobile motes should therefore detect this message.
However; they do not.
here is a sample of the java code i am using to send the messages, incase
the problem is in the way i am telling the basestation to send the message
via the radio:
/*********************************************************/
GimmeMsg gimme = new GimmeMsg();
gimme.set_slugid(1);//so that they know it was from the base station
gimme.set_idfordelivery(motetocontact);//set the id of the node it is for
mote.send(MoteIF.TOS_BCAST_ADDR,gimme);//send a new gimme packet;
message("out: \t"+gimme.toString());
/*********************************************************/
Is this the correct way to send the message so that the motes should be able
to hear them? - they dont seem to be detecting them, and interestingly other
basestations nearby do not detect the messages sent by basestations either!
Also if i program the mobile tmote invents to send the "GImmemsgs" to each
other they do detect them, so i do not think it is a problem on the
receiving end, regardless here are some code snippets from there.
Here are the relevant components in the mysensorAppC.nc file:
/*********************************************************/
components new AMSenderC(AM_BLINKTORADIOMSG) as AMBlinksender;
components new AMReceiverC(AM_BLINKTORADIOMSG) as AMBlinkreceiver;
components new AMReceiverC(AM_GIMMEMSG) as AMGimmereceiver;
App.AMSend0 -> AMBlinksender;
App.Receive0 -> AMBlinkreceiver;
App.AMUpload -> AMUploader;
App.AMGimme -> AMGimmereceiver;
App.Packet -> AMBlinksender;
App.AMPacket -> AMBlinksender;
App.UpPacket -> AMUploader;
/*********************************************************/
Here are the relevant code snippets from the mysensor.nc file,incase they
offer any help in understanding the problem:
/*********************************************************/
uses interface AMPacket;
uses interface AMSend as AMSend0;
uses interface Receive as Receive0;
uses interface AMSend as AMUpload;
uses interface Receive as AMGimme;
event message_t* AMGimme.receive (message_t* msg, void* payload, uint8_t
len){
if (len == sizeof(GimmeMsg)){
//do stuff
}
return msg;
}
event message_t* Receive0.receive (message_t* msg, void* payload,
uint8_t len) {
if (len == sizeof(BlinkToRadioMsg)) {
//do stuff
}
return msg;
}
/*********************************************************/
Thanks in advance,
Greg Bigwood
PhD student,
University of St Andrews
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20080205/d7d45ef9/attachment.htm