Node-red LORA payload format

Home Forums Conduit: AEP Model Node-red LORA payload format

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #20576
    Julien DEV
    Participant

    Hi,
    I have a problem with a payload format of “Lora In” node (Data Type= Bytes).

    If i use a debug node with complete message object, red-node debug tab show :
    { "chan": 2, "cls": 0, "codr": "4/5", "datr": "SF12BW125", "freq": "868.5", "lsnr": "8.5", "mhdr": "xxxxxxxxxxxx", "modu": "LORA", "opts": "0306", "port": 1, "rfch": 0, "rssi": -35, "seqn": 22, "size": 12, "timestamp": "2017-08-09T09:02:02.648602Z", "tmst": 859659788, "payload": [ 67, 192, 1, 0, 224, 2, 1, 90 ], "eui": "xx-xx-xx-xx-xx-xx-xx-xx", "_msgid": "83700967.7c8ff8" }

    If i use a debug node with only payload.msg, red-node debug tab show :
    43c00100e002015a

    This string is exactly what I want in my function node but I can not do it :/
    This function :

    node.warn(msg.payload);
    node.warn(msg.payload.toString());

    returns

    C��Z
    C��Z

    Could you help me to get “43c00100e002015a” in javascript ?

    Thank you for your help
    Julien.

    #20577
    Julien DEV
    Participant

    I have found the solution :
    msg.payload = msg.payload.toString('hex');

    Thanks 😉

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