Sindre Kopland-Hansen

Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • in reply to: mtdot-box #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

    in reply to: mtdot-box #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

    in reply to: mtdot-box #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

Viewing 3 posts - 1 through 3 (of 3 total)