Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrongly calcutated packet size in CoojaRadio #96

Open
maxime-peim opened this issue May 15, 2022 · 0 comments
Open

Wrongly calcutated packet size in CoojaRadio #96

maxime-peim opened this issue May 15, 2022 · 0 comments

Comments

@maxime-peim
Copy link

Hi all,

Recently, I have been experiencing a weird situation when a Cooja mote sends a packet to a z1 one.
Upon reception, the z1 mote was always measuring a RSSI of -100 dBm, even if the motes were close (using the UDGM radio medium).

I found out that z1 mote defined in apps/mspsim/src/org/contikios/cooja/mspmote/Z1Mote.java uses the Msp802154Radio radio type, which simulates the reception of a packet by delivering it byte by byte in the method setReceivedPacket.
However, before sending the bytes to the radio object, the packet received from a Cooja mote is converted using the class CC2420RadioPacketConverter, which adds 6 additional bytes of header (preamble + synch + length).

Now, if we take a look at the code for a new transmission in a java/org/contikios/cooja/contikimote/interfaces/CoojaRadio.java, we can see that 2 additional footer bytes (lines 373 & 374) are not taken into account in the size.

Hence, the variable size in CoojaRadio does not count 8 bytes received by the simulated mote. Since size is used to determine the time needed for a Cooja mote to sleep before advertising the end of a transmission, the transmission is announced as finished earlier.
When it happens, the RSSI is resetted to -100 dBm by the UDGM.updateSignalStrengths method, while the z1 mote's radio is still receiving 8 bytes, which is sufficient enough to have a falsy computed value by Msp802154Radio.setCurrentSignalStrength.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant