Gateway Downlink Programming

This document deals with the downlink that is prgrammed in the gateway code. It appears that it is very difficult to get this code right, partly because of the timing of the ESP which is not accurate, and partly because we made errors with the code.

Getting downlink to work reliably is very difficult. IN order to get the timing right, we have mofieid the timing in the gateway slightly as folliws:

  1. The gateway received a message from the sensor node. If will read the values and send all info UP to the handler.
  2. Based on the parameters set by the device it may open a receipt window TX1 or TX2 after sending out its messsage. As the gateway includes it own timing, the gateway timing is also sent to the LoRa hander over MQTT.
  3. If the gateway is selected(!) it receives a downlink message from the LoRa Handler which needs to be sent to the device node based on the gateway timing previously sent.

As the gateway needs a lot of time to compose a message UP, the handler time is sent 650,000 uSecs highter by the gatway