Node RED receive message

Home Forums mDot/xDot Node RED receive message

Tagged: , ,

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #12235
    John Li
    Participant

    I’ve connected mDot to my Conduit running NodeRed, and place a debug node to display the “msg.payload”. But I received the payload type to be “buffer”, and the content cannot be displayed. The mbed code I used is the mDot_Sleep_Example on from MultiTech, and I revised the network name, password and subfreq as instructed. Is there anything wrong with my operation?

    #12239
    Jason Reiss
    Keymaster

    If you would like the content to be displayed, the lora-in node has the option to output a UTF-8 string instead of the buffer.

    #12265
    John Li
    Participant

    Thanks Jason for your reply. How could I output UTF-8 string in my lora node? This is the code I used, std::vector<uint8_t> data; std::string data_str = “hi”; how can I change the output into UTF-8?

    #12267
    Jason Reiss
    Keymaster

    The output is changed in Node-RED. The “lora-in” node is where packets enter the flow.

    You can either change the setting of the lora-in node to UTF-8 in Node-RED or create a function node that converts the payload from a buffer to a string.

    
    msg.payload = msg.payload.toString("utf8");
    
    return msg;
    
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.