Hi I am using LoRa Gateway and my LoRa Tx node sends message like this:
{“temp1”:77,“hum1”:55,“moist1”:50} and a separate LoRa RX node receives the same and confirms as {“temp1”:77,“hum1”:55,“moist1”:50}
But the LORAtoMQTT message adds backlashes on its own and the message becomes {\“temp1\”:77,\“hum1\”: 55,“moist”:50} etc.,
Please help me to get what message goes into Gateway and the same comes out as MQTT message.
With best regards, ragoth@gmail.com
Could you activate traces (set the log level to LOG_LEVEL_TRACE), and see where the backslashes are added during the message processing?
You may publish here the log output from the serial monitor.
How do I send the screen shot as your message space is not printing the backslashes while I copy and paste, but backslashes are there in the outputs.
Please advice how to send the screen shot images which has the backslashes…
Yes, I am sure, it is not added by the node because one to one communication between the nodes display perfect. Only when it comes through the gateway it is getting added.
I am using 2 TTgo Lora boards with OLED display, as node 1 and node 2. Another esp32 as openMQTTGateway. Messages from node to node is seen on TTgo LoRa’s OLED display and the Gateway out come is seen on Mobile, Mqtt Terminal.
Thank you for your reply.
I may be wrong but I assume the gateway sends it as strings with in double quotes and adds backslashes as an escape character. If it sends as JSON string everything will be fine or it can send it as a data like “snr” and “rssi” etc.,
Please think it over.
Best regards.
Hi, thank you for your time and concern. I am happy to say I solved the issue by changing the character string message into Json string message.
// Original lines beginning at Nr.66 in ZgatewayLORA.ino :
//
String packet;
packet = “”;
for (int i = 0; i < packetSize; i++) {
packet += (char)LoRa.read();
}