mtdot-box
Tagged: mDot Box
- This topic has 5 replies, 2 voices, and was last updated 7 years, 11 months ago by Sindre Kopland-Hansen.
-
AuthorPosts
-
November 30, 2016 at 4:12 am #15721Sindre Kopland-HansenParticipant
Hi,
I got a conduit GW connected to TTN right outside Oslo. I am testing two endpoints right now. First is a mDot running at commands via usb programmer. I can successfully join and send data via AT commands. The msgs pops up both in the TTN web gui and in the mqtt topic for the device. If I do base64 reverse on the payload from mqtt it is the original message I sent.
Then I configure the mtdot-box (blue thing) like the mDot above using AT commands. Then I disconnect it from the usb programmer. Then from it’s LCD display I choose LoRa Demo. I can see it joins successfully. Then I select trigger and send. Everything is fine and the msg arrives in the TTN. But the payload .. It is not base64 .. and I am not sure what it is or how to decode it? It might be that I need to do more configuration or that it ciphers it somehow, not sure.
The payload (hex) looks like this in ttn:
0E07FF0D080628250500530B01A1
and the corresponding payload in mqtt:
Dgf/DQgGKDkFAFgLAaA=
I guess and hope the mtdot-box sends out something right, but I´m a bit worried it does not. When I got it it had fw v2.0.0 which was mixing up frequencies. Now it got the latest v2.1.5 fixing the first issue, but could it be more? Or is it config? or me not understanding something here ..
I please hope some of you can help?
/BR
SindreNovember 30, 2016 at 8:55 am #15725Leon LindenfelserModeratorNovember 30, 2016 at 10:08 am #15727Sindre Kopland-HansenParticipantHi Leon,
Thanks a lot for the answer. This explain my mystery!
So I can connect the node red in the conduit to the ttn mqqt topic and decode it that way?
/BR
SindreNovember 30, 2016 at 10:13 am #15729Leon LindenfelserModeratorHi Sindre,
Yes, if you need to alter the dot box demo mode data for TTN, you can do that in node red.
Leon
December 1, 2016 at 2:35 am #15741Sindre Kopland-HansenParticipantHi Leon,
Connected the topic to node-red in the conduit now and can see the binary packages coming in. Is there any pre-made node in node-red that can decode it? Can’t find any so far ..
/BR
SindreDecember 1, 2016 at 9:11 am #15743Sindre Kopland-HansenParticipantHi again,
I found some useful code here:
https://www.thethingsnetwork.org/forum/t/parsing-semtech-loramote-data/938
and fixed it for the mbox-dot survey GPS:
var decoded_data = new Buffer(msg.payload.payload,’base64′);
var lat_val = decoded_data[3] << 16 | decoded_data[4] << 8 | decoded_data[5];
var lat = !(lat_val&0x800000) ? lat_val : ((0xffffff-lat_val+1)*-1)
var latitude = lat/Math.pow(2,23)*90;var lon_val = decoded_data[7] << 16 | decoded_data[8] << 8 | decoded_data[9];
var lon = !(lon_val&0x800000) ? lon_val : ((0xffffff-lon_val+1)*-1);
var longitude = lon/Math.pow(2,23)*180;var temperature = decoded_data[1];
return “lat: ” + latitude + ” lon: ” + longitude + ” temp: ” + temperature;
Just connect to the proper topic, filter json and decode.
(In case someone else should need it)
/BR
Sindre -
AuthorPosts
- You must be logged in to reply to this topic.