I have two LoRa devices: a transmitter and a receiver. I hard-coded the user ID in both devices so that if the user uses this ID, the sequence number will increase to 1, 2, 3, etc. What I'm trying to do is reset the sequence number to start again from 1 every time I use a different ID.
I tried it to test it on my devises and got these massages. what I'm looking for is the same idea but instead for polling the id the user is the one how will enter the id and every time the id changes the sequence numbers will start from 1
I don't know if it will make different but I'm using Arduino uno
looks like your transmitter and receiver may have different data sizes
are the transmitter and receiver the same microcontroller?
if not you may have problems with different data type sizes and structure packing
In my test I used
// test packet - must match transmitter
struct __attribute__((packed)) Struct1 {
byte NodeID; // ID of transmitting node
int16_t seq; // sequence number
int16_t distance;
float voltage;
char text[20];
} struct1;
where int16_t is always signed 16bit integer etc
float is generally 4 bytes
int may be 2 or 4 bytes depending on processor
doubles can be 4 bytes (UNO etc) or 8bytes (ESP32, RP2040, etc)