gotthardp / lorawan-server

Compact server for private LoRaWAN networks
https://gotthardp.github.io/lorawan-server
MIT License
959 stars 329 forks source link

Can't get "delivered" event after successful delivering downlink message #705

Open clafix opened 4 years ago

clafix commented 4 years ago

Hi everyone!

I'm working with lorawan-server about a some weeks, and uplink messages from device works fine. I see "join" events and see correct uplink data in server web-interface (Frames) and in MQTT.fx client.

But publishing downlink messages wroks not as expected. I'm tried to send (publish) downlink messages from MQTT.fx client to device, and found 2 issues:

  1. I can't get "delivered" event anyway (even if downlink message really delivered to device). But "lost" events i see as expected. Also, in publish message: "confirmed":true, "receipt" - presented; our lora device is device of Class A.
  2. Downlink message successfuly delivering on device (and visible at server "Frames" screen) only, if publish will be fired immediately after device "join" event. Event "delivered" also don't firing here.

Proofs of this issue:

  1. Publishing message before "join" event (delivery fails): publishBeforeJoin1 After got uplink: publishBeforeJoin2 publishBeforeJoin3 Message to publish: publishMessage
  2. Publishing message after "join" event (delivery successful): publishAfterJoin1 After got uplink (and downlink): publishAfterJoin2 publishAfterJoin3 Connector screen: connector screen

This behaviour (fail delivery on publish before "join" and success delivery on publish immediately after "join") checked a lot of times. It really works as is. Event "delivered" i I have never seen at all testings time.

What i do wrong, and how i can get event "delivered"? And why message delivering successfuly, only if it will be sent only immediately after "join" (although the message is stored on the server until the "join" event)?

I would be grateful for any help, thanks in advance!

clafix commented 4 years ago

I also noticed that after a long time of work (1-2 days) the server stops accepting any published messages from mqtt clients. Messages do not appear in the device’s Downlinks, and the server even does not show an error if you send broken JSON. After the server container restart, publish starts working fine. Before container restart: Image 1 After: Image 2