Hello,
I am trying to convert the following buffer out of an sensor into a Javascript Object withou any success...
Can anyone plz help me? I am trying to convert the raw data throught the following code:
var XDK_str = msg.payload.toString();
var XDK_parsed = JSON.parse(XDK_str);
return {XDK_str};
Buffer:
{"xdk2mam":[{"sensorType": "Environmental","data":[{"name":"Pressure","value":"98186"},{"name":"Temperature","value":"28030"},{"name":"Humidity","value":"37"}]},{"sensorType":"Accelerometer","data":[{"name":"x","value":"13"},{"name":"y","value":"13"},{"name":"z","value":"999"}]},{"sensorType":"Gyroscope","data":[{"name":"x","value":"-2197"},{"name":"y","value":"1342"},{"name":"z","value":"1220"}]},{"sensorType":"Inertial","data":[{"name":"x","value":"122"},{"name":"y","value":"488"},{"name":"z","value":"488"}]},{"sensorType":"Light","data":[{"name":"milliLux","value":"18900"}]},{"sensorType":"Magnetometer","data":[{"name":"x","value":"9"},{"name":"y","value":"-18"},{"name":"z","value":"-44"}]} ],"device": "XDK_MQTT","timestamp": "7717"}
Thanks !!