I have run the examples with success..
The problem stil remains though..
I am using the Python script described in tutorial 11 (about TOSSIM), and
the respective code of interest is the following:
event message_t * Receive.receive(message_t *msg, void *payload, uint8_t
len){
if (call AMPacket.isForMe(msg)){
if(len == sizeof(msg_request_neighbours_t)) {
msg_request_neighbours_t* pkt = (msg_request_neighbours_t*)payload;
if (pkt->msg_type == REQUEST_NEIGHBOURS_MSG){
msg_send_neighbours(call AMPacket.source(msg));
}
}
}
if (call AMPacket.isForMe(msg)){
if (len == sizeof(msg_send_neighbours_t)){
msg_send_neighbours_t* pkt = (msg_send_neighbours_t*)payload;
if (pkt->msg_type == SEND_NEIGHBOURS_MSG){
dbg("TryC", "Neighbors(%hhu, %hhu).\n", call AMPacket.address(),
pkt->sending_mote);
}
}
}
return msg;
}
void msg_request_neighbours(am_addr_t target) {
msg_request_neighbours_t* pkt = (msg_request_neighbours_t*)call
Packet.getPayload(&packet, NULL);
if (pkt == NULL){
dbg("TryC", "Cannot create packet to get neighbours, node id = %hhu", call
AMPacket.address());
return;
}
pkt->msg_type = (uint8_t)REQUEST_NEIGHBOURS_MSG;
pkt->request_mote = call AMPacket.address();
if(call AMSend.send(target, &packet,
sizeof(msg_request_neighbours_t))==SUCCESS){
dbg("TryC", "Request for neighbours sent, node id = %hhu.\n", call
AMPacket.address());
}
}
void msg_send_neighbours(am_addr_t target){
msg_send_neighbours_t* pkt = (msg_send_neighbours_t*)call
Packet.getPayload(&packet, NULL);
if (pkt == NULL) {
dbg("TryC", "Cannot create packet to testify that this is a neighbouring
node, node id = %hhu.\n", call AMPacket.address());
return;
}
pkt->msg_type = (uint8_t)SEND_NEIGHBOURS_MSG;
pkt->sending_mote = call AMPacket.address();
if(call AMSend.send(target, &packet,
sizeof(msg_send_neighbours_t))==SUCCESS){
dbg("TryC", "Sending neighbors notification succeeded, node id = %hhu,
target node = %hhu.\n", call AMPacket.address(), target);
}
return;
}
The output i get is always pretty much as follows:
[EMAIL PROTECTED]:~/Documents/try/src$ ./test.py
1 2 -54.0
2 1 -55.0
1 3 -60.0
3 1 -60.0
2 3 -64.0
3 2 -64.0
Creating noise model for 1
Creating noise model for 2
Creating noise model for 3
DEBUG (1): Request for neighbours sent, node id = 1.
DEBUG (2): Request for neighbours sent, node id = 2.
DEBUG (3): Request for neighbours sent, node id = 3.
DEBUG (2): Neighbors(2, 3).
DEBUG (2): Neighbors(2, 1).
DEBUG (1): Request for neighbours sent, node id = 1.
DEBUG (2): Request for neighbours sent, node id = 2.
DEBUG (3): Request for neighbours sent, node id = 3.
DEBUG (2): Neighbors(2, 3).
DEBUG (2): Neighbors(2, 1).
DEBUG (1): Request for neighbours sent, node id = 1.
DEBUG (2): Request for neighbours sent, node id = 2.
DEBUG (3): Request for neighbours sent, node id = 3.
The previous output means that the AMSend.send never succeeds (the dbg
statement "ending neighbors notification succeeded ++" is never printed).
However, the "Neighbors(X, Y)" which appears indicates that a SEND message
has been received, but only from one of the nodes each time!
Can anyone give me a hint of how to successfully make all the nodes to
communicate?
Thank you again,
Artemis Voulkidis
---------- Forwarded message ----------
From: "João Carlos Giacomin" <[EMAIL PROTECTED]>
To: [email protected]
Date: Thu, 6 Nov 2008 14:26:14 -0300
Subject: Re: [Tinyos-help] Node Communication problem in Tossim
.
The second example you have to run is CntToLedsAndRfm.
I don't know if is read for TinyOS-2, but it works well in TinyOS-1.
When you simulate CntToLedsAndRfm, the nodes send message in broadcast
periodically, and all the others nodes receive the message.
If you can see this in CntToLedsAndRfm, probably your problem is in your
program.
*****************
João Giacomin
Prof-DCC-UFLA
*****************
*---------- Original Message -----------*
From: "Artemis Voulkidis" <[EMAIL PROTECTED]>
To: [email protected]
Sent: Thu, 6 Nov 2008 16:03:03 +0200
Subject: [Tinyos-help] Node Communication problem in Tossim
> Hello all!
>
> I am currently on a project, looking for an implementation, part of which
is the recognition of the neighboring nodes of a node.
> When the mote starts, it sends a request to AM_BROADCAST_ADDR for
neighboring nodes.
> Upon receiving such a message, a node has to transmit a similar packet,
containing some very basic info of the node.
> Though, when running a simulation with 3 active nodes, only one of them
actually receives any message each time..
> Any ideas what may be happening?
> If you need parts of the code to clarify my question, tell me to post it!!
>
> Thank you in advance,
> Artemis Voulkidis
*------- End of Original Message -------*
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help