mosquitto_pub question
- This topic has 7 replies, 2 voices, and was last updated 9 years, 2 months ago by .
Viewing 8 posts - 1 through 8 (of 8 total)
Viewing 8 posts - 1 through 8 (of 8 total)
- You must be logged in to reply to this topic.
Home › Forums › Conduit: mLinux Model › mosquitto_pub question
Hi:
I am trying ty send data to my LoRa device, with no luck. My device ID on the network is 33:33:33:31. I check on the lora-network log and using mosquitto_sub that I am getting messages. However, I try the following:
mosquitto_pub -t lora/33:33:33:31/down -m 'D'
To transmit only a character, with no luck. Am I missing something, or is there a way to know that the conduit is trying to send the data?
Thanks,
-Ed
Hi:
I noticed I mad a mistake, I should use the DevEui, which is 8 bytes in length. However, with that change I still do not receive messages on my device. My device is actin as Class A, and I am receiving messages on the Conduit correctly.
Thanks,
-Ed
Eduardo,
Look at the transmit section of this page:
As noted there,
The packet must be in JSON format and the data must be Base64 encoded
-Brandon
Hi Brandon:
Thanks, you are right. I did change the message to be the following:
mosquitto_pub -t lora/01:02:03:04:05:06:07:08/down -m '{ "data":"aGVsbG8=" }'
with the device EUI verified to be 01:02:03:04:05:06:07:08 as noted on node list:
Net Addr Dev EUI Joined Seq Num Up Down 1st 2nd Dropped RSSI min max avg SNR min max avg
33:33:33:32 01:02:03:04:05:06:07:08 2015-11-25T09:00:33Z 154 1173 946 923 23 0 -121 -9 -96 -16.5 13.8 -4.7
But I still do not receive anything. Is there a way to see if the Conduit has tried to send the message on the receive frames? Thanks!
Eduardo,
Sure, you should be able to see all receive and transmit activity in /var/log/lora-network-server.log
-Brandon
Brandon:
Thank you for your reply. In the device side I seem to get a response, but it does not detect a payload. Does the mosquitto command send whatever is in the “data” parameter as the payload?
Thanks!
Eduardo,
Yes the data value is transmitted as the payload.
-Brandon
Hi Brandon:
It seems that my device (Nucleo Board with the LoRaWAN-lmic-app from SemTech in mBed, available https://developer.mbed.org/teams/Semtech/code/LoRaWAN-lmic-app/) needs that we also especify the port. For example, the following code in the conduit was received correctly:
mosquitto_pub -t lora/01:02:03:04:05:06:07:08/down -m '{ "data":"aGVsbG8=", "port":6 }'
I hope this may be of use to somebody now or in the future using the same devices I am using now!