GrumpyOldPizza / ArduinoCore-stm32l0

Arduino Core for STM32L0
125 stars 67 forks source link

Handling network server mac commands #169

Open SloMusti opened 3 years ago

SloMusti commented 3 years ago

Using this library, I have observed issues and device hangs on receiving mac commands from the network server, for example receiving something similar to this: https://lorawan-packet-decoder-0ta6puiniaut.runkit.sh/?data=0708f80084500709c8088450070a98108450070b68188450&nwkskey=&appskey=

How is this handled in this library. It appears like ti should be implemented at low level. Anyone has experience by using various public networks?

SloMusti commented 3 years ago

Requirement from a network provider provider: The “Data rate ACK” and “Power Ack” can be set to 0. The network server is only retrying the message because the Channel Mask Ack bit is set to 0 So a proper response will be with ADR OFF Data rate ACK 0 Channel Mask ACK 1 Power ACK 0

SloMusti commented 3 years ago

There appears to be necessary support here https://github.com/GrumpyOldPizza/ArduinoCore-stm32l0/blob/c845a3b4b90b8a8fe95c6fedd4fa927dae14ba45/system/STM32L0xx/Source/LoRa/Mac/LoRaMac.c#L1641, investigating if this works or what must be done for it.

SloMusti commented 3 years ago

Downlink messages are handled here and mac commands processed: https://github.com/GrumpyOldPizza/ArduinoCore-stm32l0/blob/c845a3b4b90b8a8fe95c6fedd4fa927dae14ba45/system/STM32L0xx/Source/LoRa/Mac/LoRaMac.c#L1084