mtdot-box

Home Forums mDot/xDot mtdot-box

Tagged: 

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #15721

    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
    Sindre

    #15725

    Hi Sindre,

    This explains the data format for demo mode.

    Data Packet Format

    Kind regards,
    Leon

    #15727

    Hi 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
    Sindre

    #15729

    Hi Sindre,

    Yes, if you need to alter the dot box demo mode data for TTN, you can do that in node red.

    Leon

    #15741

    Hi 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
    Sindre

    #15743

    Hi 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

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.