I referenced the [Configure a Raspberry Pi and connect it to Watson IoT Platform]
In that, I am using Node-RED of Raspberry Pi 3 and send the data to IBM Cloud.
I use the Function Node for transform to Watson IoT Format, So, I write the code in function node.
msg.payload={'d':{'temp':msg.payload.replace("temp=","").replace("'C\n","")}}
However, it has the result that represent {d:obeject}
I want to represent {"d":{"temp":"45.5"}}
Did I miss something?
I attached image file.
The Debug sidebar shows a structured, interactive, view of the message.
If you click on the {d: object }
line it will expand to reveal its structure.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.