Empty Packet From the Gateway
- This topic has 3 replies, 2 voices, and was last updated 7 years, 10 months ago by
Alexis Girard.
-
AuthorPosts
-
June 14, 2017 at 3:14 am #19522
Alexis Girard
ParticipantHi,
I’m having quite regularly issues when I receive packet on my mDot from the Conduit. All seems to be OK, the recv() function returns me “MDOT_OK” but the vector stays empty.
At this time as there is no error, my app keep running. Then I’m sending a new packet to the conduit and I’m supposed to receive the response which corresponds to this packet but instead I’m receiving the old packet I just missed.
(Ack is activated and retries set to 8, ack is activated on the conduit too)
Has anyone have an idea where did this come from or know how to avoid it?
June 15, 2017 at 12:30 pm #19562Ajay K
ParticipantHi Alexis,
Are you using Class A/Class C mode while transmitting data between the MDot and conduit. Because in Class A if you send a packet from the MDot to the conduit and the conduit needs to have already queued a packet in response even before the MDot packet made it to the conduit.
So what I am trying to say is if the response to the mdot packet is generated after it was received by the conduit, you will receive an empty packet if nothing was queued previously on the lora downlink queue for that mdot. So when you transmit the next packet from the mdot, the conduit will send a packet that you last queued. Hope that makes sense?
Thanks,
AjayJune 20, 2017 at 5:28 am #19604Alexis Girard
ParticipantHi Ajay,
I’m using Class A. I understand what you are saying and it makes sense but most of the time my app works. For 1270 packets sent I only have received about 50 empty packets in my last test.
So for now in Node-Red, when I received a Lora packet I cleared the “lora send” queue with the mqqt message. And after a delay I build a response with a number I get from the received packet and I sent it! My flow :
[{“id”:”aaed49fc.8415e8″,”type”:”mqtt-broker”,”broker”:”localhost”,”port”:”1883″,”clientid”:””},{“id”:”e1afc6e3.f3bd98″,”type”:”mqtt-broker”,”broker”:”10.145.1.36″,”port”:”1883″,”clientid”:””},{“id”:”568ea4ca.7304dc”,”type”:”lora in”,”name”:””,”datatype”:”utf8″,”x”:328,”y”:273,”z”:”3abaccdb.89d6ac”,”wires”:[[“11a11f9d.a9fb4″,”e62ce779.58aa3″,”ce084f78.0b1768”]]},{“id”:”a7b36fa2.74cb4″,”type”:”lora out”,”name”:””,”eui”:””,”payload”:””,”ack”:true,”port”:”0″,”x”:1076,”y”:263,”z”:”3abaccdb.89d6ac”,”wires”:[]},{“id”:”2e6d3069.5b252″,”type”:”debug”,”name”:””,”active”:true,”console”:”false”,”complete”:”payload”,”x”:1069,”y”:137,”z”:”3abaccdb.89d6ac”,”wires”:[]},{“id”:”d6d2f744.120028″,”type”:”mqtt out”,”name”:””,”topic”:”mDot”,”qos”:””,”retain”:””,”broker”:”e1afc6e3.f3bd98″,”x”:1064,”y”:204,”z”:”3abaccdb.89d6ac”,”wires”:[]},{“id”:”14be1b82.7a757c”,”type”:”function”,”name”:”Reponse”,”func”:”var nbr = msg.payload.substring(13);\nmsg.payload=\”Reponse_Test \”;\nmsg.payload += nbr;\n\nreturn msg;”,”outputs”:1,”noerr”:0,”x”:853,”y”:263,”z”:”3abaccdb.89d6ac”,”wires”:[[“a7b36fa2.74cb4″,”2e6d3069.5b252”]]},{“id”:”ce084f78.0b1768″,”type”:”mqtt out”,”name”:”MQTT Clear Node”,”topic”:”lora/00-80-00-00-00-00-d6-54/clear”,”qos”:””,”retain”:””,”broker”:”aaed49fc.8415e8″,”x”:602,”y”:442,”z”:”3abaccdb.89d6ac”,”wires”:[]},{“id”:”11a11f9d.a9fb4″,”type”:”delay”,”name”:””,”pauseType”:”delay”,”timeout”:”500″,”timeoutUnits”:”milliseconds”,”rate”:”1″,”rateUnits”:”second”,”randomFirst”:”1″,”randomLast”:”5″,”randomUnits”:”seconds”,”drop”:false,”x”:596,”y”:202,”z”:”3abaccdb.89d6ac”,”wires”:[[“14be1b82.7a757c”,”d6d2f744.120028″]]},{“id”:”e62ce779.58aa3″,”type”:”debug”,”name”:””,”active”:true,”console”:”false”,”complete”:”true”,”x”:600,”y”:151,”z”:”3abaccdb.89d6ac”,”wires”:[]}]
So if I understand well what you are telling this would never work. But it is, most of the time. And it’s a little bit strange that you should create the response before receiving a packet, no?
Thank you a lot for your help again!
AlexisJune 20, 2017 at 7:02 am #19605Alexis Girard
ParticipantThe flow I’m using in Node-Red :
(The one in the first message won’t be imported)[{"id":"aaed49fc.8415e8","type":"mqtt-broker","broker":"localhost","port":"1883","clientid":""},{"id":"e1afc6e3.f3bd98","type":"mqtt-broker","broker":"10.145.1.36","port":"1883","clientid":""},{"id":"568ea4ca.7304dc","type":"lora in","name":"","datatype":"utf8","x":328,"y":273,"z":"3abaccdb.89d6ac","wires":[["11a11f9d.a9fb4","e62ce779.58aa3","ce084f78.0b1768"]]},{"id":"a7b36fa2.74cb4","type":"lora out","name":"","eui":"","payload":"","ack":true,"port":"0","x":1076,"y":263,"z":"3abaccdb.89d6ac","wires":[]},{"id":"2e6d3069.5b252","type":"debug","name":"","active":true,"console":"false","complete":"payload","x":1069,"y":137,"z":"3abaccdb.89d6ac","wires":[]},{"id":"d6d2f744.120028","type":"mqtt out","name":"","topic":"mDot","qos":"","retain":"","broker":"e1afc6e3.f3bd98","x":1064,"y":204,"z":"3abaccdb.89d6ac","wires":[]},{"id":"14be1b82.7a757c","type":"function","name":"Reponse","func":"var nbr = msg.payload.substring(13);\nmsg.payload=\"Reponse_Test \";\nmsg.payload += nbr;\n\nreturn msg;","outputs":1,"noerr":0,"x":853,"y":263,"z":"3abaccdb.89d6ac","wires":[["a7b36fa2.74cb4","2e6d3069.5b252"]]},{"id":"ce084f78.0b1768","type":"mqtt out","name":"MQTT Clear Node","topic":"lora/00-80-00-00-00-00-d6-54/clear","qos":"","retain":"","broker":"aaed49fc.8415e8","x":602,"y":442,"z":"3abaccdb.89d6ac","wires":[]},{"id":"11a11f9d.a9fb4","type":"delay","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":596,"y":202,"z":"3abaccdb.89d6ac","wires":[["14be1b82.7a757c","d6d2f744.120028"]]},{"id":"e62ce779.58aa3","type":"debug","name":"","active":true,"console":"false","complete":"true","x":600,"y":151,"z":"3abaccdb.89d6ac","wires":[]}]
-
This reply was modified 7 years, 10 months ago by
Alexis Girard.
-
This reply was modified 7 years, 10 months ago by
Alexis Girard.
-
This reply was modified 7 years, 10 months ago by
Alexis Girard.
-
This reply was modified 7 years, 10 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.