# Node red http in node with sensor data

**URL:** <https://discourse.nodered.org/t/node-red-http-in-node-with-sensor-data/57631>\
**Category:** General\
**Created:** [2 February 2022 10:58 UTC](https://discourse.nodered.org/t/node-red-http-in-node-with-sensor-data/57631 "2022-02-02T10:58:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![amila](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@amila](https://discourse.nodered.org/u/amila)\
**Post date:** [2 February 2022 10:58 UTC](https://discourse.nodered.org/t/node-red-http-in-node-with-sensor-data/57631/1 "2022-02-02T10:58:01Z")

</div>

I use http in node & post method to receive esp 32 data as in figure 1.  
 ![1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/2/d26fc58ab23cd2964c29eaad07f07d6cc28b4a22.jpeg)  
I am getting msg.payload in debug as in figure 2.  
 ![2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/d/0d5731d8c5b02f1a1d96bef004072da80a564abd.jpeg)

My requirement is to create two separate array to display in two gauges.  
As an example in first gauge value should be **51** and next gauge value should be **29**.  
So please help me to convert above msg.payload values to two seperated arrays.  
Thank you

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [2 February 2022 11:28 UTC](https://discourse.nodered.org/t/node-red-http-in-node-with-sensor-data/57631/2 "2022-02-02T11:28:39Z")

</div>

> [@amila](#):
>
> receive esp 32 data

Hi .. are you sure the data you show in the screenshot is coming from the Debug node and  
that configuration of nodes ?

what you need is an **Http-request** node .. instead of the Http-in.

---

<div class="post-metadata">

**Author:** ![amila](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@amila](https://discourse.nodered.org/u/amila)\
**Post date:** [2 February 2022 11:40 UTC](https://discourse.nodered.org/t/node-red-http-in-node-with-sensor-data/57631/3 "2022-02-02T11:40:05Z")

</div>

Hi.. yes that data show in debug messages and it is updating after few moments. So that I want to display that values in a two separate gauges as I mentioned earlier.  
Surely I will try **Http-request** node.  
Thanks for helping me.

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [2 February 2022 12:11 UTC](https://discourse.nodered.org/t/node-red-http-in-node-with-sensor-data/57631/4 "2022-02-02T12:11:15Z")

</div>

It depends on the code you have written for the ESP32  
You have written a program on it to make a POST request to  
`http://<node-red-ip>:1880/update-sensor` ?  
then check the code on your ESP why its sending the data fragmented.

if this is how you setup the communication .. then maybe it would be better to do the opposite  
the ESP to be the Webserver and Node-red making requests to it with the http-request node.

Here is a nice tutorial of how to achieve that  
[ESP32 DHT11/DHT22 Web Server](https://randomnerdtutorials.com/esp32-dht11-dht22-temperature-humidity-web-server-arduino-ide/)

---

<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:** [3 April 2022 12:11 UTC](https://discourse.nodered.org/t/node-red-http-in-node-with-sensor-data/57631/5 "2022-04-03T12:11:52Z")

</div>

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