FYI: I got the cause of error(s).
I should've send the messages to the "AM_BROADCAST_ADDR", not to
"AM_REQUESTSAMPLEMSG" or "AM_SAMPLERETURNMSG".
Then I forgot to return from the Receive.receive() function with msg,
which caused segmentation fault when I wanted to transmit between
bidirectional links.
2013.11.15. 11:37 keltezéssel, Csatári János írta:
And an other question: should I use a different AM channel for each
packet type?
2013.11.14. 11:10 keltezéssel, Csatári János írta:
Hi!
First of all, thank you for your response!
The example files in the TOSSIM worked fine, so I believe the problem
is in my code. I've placed debug instructions into the code, however
it still doesn't receive the package. Here are some important parts
of the code, could you have a look at it where could be the problem?
*SamplingSensorAppC.nc:*
[..]
implementation {
[...]
components ActiveMessageC;
components new AMSenderC(AM_REQUESTSAMPLEMSG) as SendRequest;
components new AMReceiverC(AM_REQUESTSAMPLEMSG) as ReceiveRequest;
components new AMSenderC(AM_SAMPLERETURNMSG) as SendReturn;
components new AMReceiverC(AM_SAMPLERETURNMSG) as ReceiveReturn;
components new AMReceiverC(AM_SETTINGUPVALUESMSG) as ReceiveSetup;
[...]
SamplingSensorC.RequestPacket -> SendRequest;
SamplingSensorC.ReturnPacket -> SendReturn;
SamplingSensorC.ReceiveRequest -> ReceiveRequest;
SamplingSensorC.SendRequest -> SendRequest;
SamplingSensorC.ReceiveReturn -> ReceiveReturn;
SamplingSensorC.SendReturn -> SendReturn;
SamplingSensorC.ReceiveSetup -> ReceiveSetup;
SamplingSensorC.AMControl -> ActiveMessageC;
[...]
}
*SamplingSensorC.h:*
enum {
AM_REQUESTSAMPLEMSG = 6,
AM_SAMPLERETURNMSG = 7,
AM_SETTINGUPVALUESMSG = 8,
};
[...]
*SamplingSensorC.nc:*
[...]
interface Packet as RequestPacket;
interface Packet as ReturnPacket;
interface Receive as ReceiveRequest;
interface AMSend as SendRequest;
interface Receive as ReceiveReturn;
interface AMSend as SendReturn;
interface Receive as ReceiveSetup;
interface SplitControl as AMControl;
[...]
*Simulate.py:*
[...]
for i in range(len(fromid)):
r.add(int(fromid[i]), int(toid[i]), -60.0)
noise = open("meyer-heavy-short.txt", "r")
for line in noise:
str1 = line.strip()
if str1:
val = int(str1)
for i in range(len(nodeid)):
t.getNode(i).addNoiseTraceReading(val)
for i in range(len(nodeid)):
print "Creating noise model for node ", i;
t.getNode(i).createNoiseModel()
[...]
Apart from this message problem, everything works, I can inject
packets with the TOSSIM and the network topology is also correctly
set up. The problem is, the 'ReceiveRequest.receive()' has never been
called. Maybe there is an error in the AM-channel setup?
Thank you for your help and sorry for the long message!
Greetings,
János
2013.11.09. 18:36 keltezéssel, Djemaa Adel írta:
Hi,
To insure that your packets are transmitted from source Node to
destination node, you can for example set a counter for each node,
one for counting transmitted packets, and the other for counting
received packets.
You can do it directely in your TinyOS Code programm.
The noise file is good, dont worry about it. Also, there is no
others parameters to change in tossim.
I hope that my answer will give you some clarification about your
question.
Good luck.
2013/11/6 Csatári János <[email protected]
<mailto:[email protected]>>
Hi everybody!
I am creating a sensor application in TinyOS where the loss of
packets
is not a concern. The test of algorithm is done using TOSSIM.
My question is, how could I ensure that there is a 100% sure packet
transmission in TOSSIM?
Also, in my current Python script I am unable to transfer any
packet. I
think it is because of radio settings.
I use the meyer-heavy-txt for noise model with 140 lines and
values from
-93 to -99. The connection gain between the nodes is set to -60.
Sending
the message is successful, however there is no sing of receiving any
packet apart from the TOSSIM injected ones.
Could you please tell me what values to set in TOSSIM?
Greetings,
János
_______________________________________________
Tinyos-help mailing list
[email protected]
<mailto:[email protected]>
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help