# Arduino with Json to node red to make a chart

**URL:** <https://discourse.nodered.org/t/arduino-with-json-to-node-red-to-make-a-chart/24143>\
**Category:** General\
**Created:** [3 April 2020 10:50 UTC](https://discourse.nodered.org/t/arduino-with-json-to-node-red-to-make-a-chart/24143 "2020-04-03T10:50:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JonasG](https://avatars.discourse-cdn.com/v4/letter/j/73ab20/32.png) [@JonasG](https://discourse.nodered.org/u/JonasG)\
**Post date:** [3 April 2020 10:50 UTC](https://discourse.nodered.org/t/arduino-with-json-to-node-red-to-make-a-chart/24143/1 "2020-04-03T10:50:17Z")

</div>

Hey. My task is to send some numbers to node red and make a chart with them.  
I have to use the Form {"Temperature":22.0,"Humidity":32.0}  
When I am in node red I go from the Serial Inport into a json and from that into a function with "msg.payload = msg.payload.Temperature  
return msg;"  
but it doesn't work. I got the error Unexpected token : in JSON at position 0"  
I don't know what to do.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [3 April 2020 12:34 UTC](https://discourse.nodered.org/t/arduino-with-json-to-node-red-to-make-a-chart/24143/2 "2020-04-03T12:34:42Z")

</div>

connect a debug node (set to display complete object) - see what is coming into node-red

My guess is one of 3 things...

- your data is arriving in NR badly formatted (debug msg will reveal this)
- either its ariving in NR as a string (so you need to convert to Js object)
- you should be accessing msg.Temperature not msg.payload.Temperature

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [2 June 2020 12:34 UTC](https://discourse.nodered.org/t/arduino-with-json-to-node-red-to-make-a-chart/24143/3 "2020-06-02T12:34:47Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
