-
Notifications
You must be signed in to change notification settings - Fork 10
Mercator Firmware
The same Mercator firmware runs on each mote during an experiment.
serial +------+
+----| mote |-<
+------+ | +------+
| |--+ .
| PC | . wireless
| |--+ .
+------+ | +------+
+----| mote |-<
serial +------+
The PC running the experiment drives each mote through its serial port:
- The PC can tell a mote to transmit.
- The PC can tell a mote to listen. The mote then reports all received packets over its serial port.
You can download the firmware in the code/
directory of this repository.
Alternatively, since it is part of the standard OpenWSN release, you can rebuild it: Build the Firmware
The file you can load onto the IoT-LAB testbed is at \openwsn-fw\firmware\openos\projects\common\01bsp_mercator_prog.ihex
.
The Serial protocol is used by the PC to drive the mote, and by the mote to notify the PC when it receives a packet or when if it done sending.
All serial frames are framed using HDLC (RFC1662). The format of an HDLC-framed frame is:
flag | payload | crc | flag |
---|---|---|---|
1B | variable | 2B | 1B |
All multi-byte fields are encoded big-endian.
Each serial frame starts with a type
byte, which can have the following value
value | name | direction | description |
---|---|---|---|
1 | TYPE_REQ_ST |
PC->mote | what is your status |
2 | TYPE_RESP_ST |
mote->PC | this is my status |
3 | TYPE_REQ_IDLE |
PC->mote | switch off radio |
4 | TYPE_REQ_TX |
PC->mote | start transmitting |
5 | TYPE_IND_TXDONE |
mote->PC | I am done transmitting packets |
6 | TYPE_REQ_RX |
PC->mote | start receiving |
7 | TYPE_IND_RX |
mote->PC | I received a packet |
8 | TYPE_IND_UP |
mote->PC | I am up, ready to work |
type |
---|
1B (TYPE_REQ_ST ) |
type |
status |
numnotifications |
mac |
---|---|---|---|
1B (TYPE_RESP_ST ) |
1B | 2B | 8B |
The status
can take one of the following values:
value | name | description |
---|---|---|
1 | ST_IDLE |
radio off |
2 | ST_TX |
actively busy transmitting |
3 | ST_TXDONE |
done transmitting |
4 | ST_RX |
radio listening or receiving |
numnotifications
is a counter which indicates how many TYPE_IND_TXDONE
and TYPE_IND_RX
were sent by the mote. This counter is reset when the mote receives a TYPE_REQ_TX
or TYPE_REQ_RX
request.
type |
---|
1B (TYPE_REQ_IDLE ) |
type |
frequency |
txpower |
transctr |
txnumpk |
txifdur |
txlength |
txfillbyte |
---|---|---|---|---|---|---|---|
1B (TYPE_REQ_TX ) |
1B | 1B (signed) | 2B | 2B | 2B | 1B | 1B |
type |
---|
1B (TYPE_IND_TXDONE ) |
type |
frequency |
srcmac |
transctr |
txlength |
txfillbyte |
---|---|---|---|---|---|
1B (TYPE_REQ_RX ) |
1B | 8B | 2B | 1B | 1B |
type |
length |
rssi |
flags |
pkctr |
---|---|---|---|---|
1B (TYPE_IND_RX ) |
1B | 1B | 1B | 2B |
Where flags
is a bitmap of the following flags
position | name | decription |
---|---|---|
0 | FLG_CRC |
set iff the CRC passes |
1 | FLG_MINE |
set iff this is an expected packet |
mac |
transctr |
pkctr |
payload |
---|---|---|---|
8B | 1B | 2B |
txlength -11 repetitions of the txfillbyte byte |
- error led on when actively transmitting
- radio led on when radio on listening/receiving
- sync led on when in UART ISR
Firmware:
Software:
Experiment:
- What is an experiment ?
- Run an experiment with IoT-lab
- Update motes states and locations
- Committing and experiment
Dataset:
Web Application: