I currently have the following flow consisting of groups of nodes that all work in smaller flows, receiving a JSON string from TTN, checking what device we're talking about, and if it's the right one, then I want to convert the payload_raw value from base64 to hex and do a byteconversion to pull 10 values from the payload which is modbus with 10 registers. All 10 values must be grouped with the same timestamp and then inserted into MySQL so my table shows 10 device names that I define, with their value, and the same timestamp for all 10.
the byteconversion works, inserting the SQL works, these are all recycled bits from existing flows, but how do I extract 'payload_raw' from the json node, and send it to the base64 node, and how do I retain the timestamp until the very end of the flow? In other words, what code do I use in my empty 'parse' function node?
If you read the info panel for the Base64 node it will tell you the path often data it will convert.
(usually msg.payload but check) so if you have other things store in msg.payload.something
you need to move them out before you convert ( and move the right bit to msg.payload)
You can use the change node to Move msg.payload.something to msg.something etc
Well, ukmoose already explained how to ensure you extract the correct data from the json. Based on the picture you posted I presume that the properties you need to extract are: msg.payload_raw and msg.metadata.time.
I created a small flow to fake your data, extract the interesting information from the JSON data and decode the base64 to hex.
Good reference on how to decode base64 the simple way without using a contrib node (tks shrickus).`
If it works for you then it is missing only to handle the time information.
Indeed, as a matter of fact I was typing a (long) response and posted without reading the intermediate post. I was not referring specifically to node-red-node-base64 .
Edit: I guess I jumped to quickly to coding. The flow in the OP was already using a base64 node (it is showing too small in my already small screen), which is a great node. No need to make things more complicated using JS functions for the conversion. I apologize the confusion.