Hello,
I think I have found a bug in the cc2420 stack concerning the
transmission power of the acknowledgements. Maybe someone can verify
it? I don?t know who is responsible for the stack at the moment. Is it
still David?
I am using the svn revision 5304 on the cc2420 folder.
In my setup a telosb node is continuously sending packets, requests an
ack and prints the rssi value of the ack. Another node is receiving
and prints out the rssi value of the received packet.
The problem occurs when I reduce the transmission power by setting
CFLAGS += -DCC2420_DEF_RFPOWER=1. The rssi of the acknowledgement
equals the transmission power of power level 31 and not the rssi of
the received packet.
It seems that the initial transmission power for the receiving node
was not set to DCC2420_DEF_RFPOWER. It looks like this should be done
by CC2420Control.Init.
For the maximum transmission power the rssi values of the ack and
received packet equals. The behavior occurs for SACK and HACK.
I found out, that I can fix the problem by the transmission of one
packet on the receiving node. It seems like after the SoftwareInit the
radio chip resets once more or the CC2420Config.sync() will never be
called to commit changes to TXCTRL.
Best regards,
Tobias
Some code snippets:
event void RadioControl.startDone(error_t err){
if (err == SUCCESS){
call CC2420Config.setAutoAck(1,0); //enable auto-sw-acks
call CC2420Config.sync();
}
else {
call RadioControl.start();
}
}
event void CC2420Config.syncDone(error_t error){
if (error == SUCCESS){
call Timer1.startPeriodic(600); //after 2s
}
else{
call CC2420Config.setAutoAck(1,0); //enable auto-sw-acks
call CC2420Config.sync();
}
}
event void Timer1.fired(){
am_addr_t dest = 1;
test_pkt_t* pkt = call
RadioSend.getPayload(&radio_pkt,sizeof(test_pkt_t));
seqno++;
pkt->seqno = seqno;
call Acks.requestAck(&radio_pkt);
call RadioSend.send(dest,&radio_pkt,sizeof(test_pkt_t));
}
event void RadioSend.sendDone(message_t* msg, error_t err){
if (msg==&radio_pkt && err==SUCCESS){
if (call Acks.wasAcked(msg)){
printf("ACK received seqno:%u rssi:%02d\n \n",seqno, call
CC2420Packet.getRssi(msg)-45);
}
else {
printf("Packet LOST seqno:%u \n",seqno);
}
}
printfflush();
}
event message_t* RadioReceive.receive(message_t* msg, void*
payload, uint8_t len){
test_pkt_t* pkt = payload;
printf("RECEIVED seqno:%u rssi:%02d\n \n",pkt->seqno, call
CC2420Packet.getRssi(msg)-45);
printfflush();
return msg;
}
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help