# Error sending data from ESP

**URL:** https://discourse.nodered.org/t/error-sending-data-from-esp/62654
**Category:** General
**Created:** [15 May 2022 20:23 UTC](https://discourse.nodered.org/t/error-sending-data-from-esp/62654 "2022-05-15T20:23:54Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)
#### Post date: [16 May 2022 09:05 UTC](https://discourse.nodered.org/t/error-sending-data-from-esp/62654/4 "2022-05-16T09:05:09Z")

</div>

I suspect it is something to do with declaring the size of the variable to handle the Json string.  
I doubt if the problem is at the Node-RED end as you say it correctly receives a message of 5 lines.

One of my IoT students had a similar problem last week.  
Here's a link to the thread on the forum and the Arduino code we created and used successfuly.  
We used these Arduino libraries...

```
PubSubClient
ArduinoJson

```

> [@Controlling LEDs on a Wemos D1 Mini (Arduino code) via MQTT](https://discourse.nodered.org/t/controlling-leds-on-a-wemos-d1-mini-arduino-code-via-mqtt/62523):
>
> One of my IoT students was asking how to control a set of LEDs on a Wemos D1 Mini, that had been programmed using Arduino code, via MQTT commands from Node-RED. This is what the breadboard lash-up looks like... The red LED is connected to D8 (GPIO-15). The green LED is connected to D7 (GPIO-13) The yellow LED is connected to D6 (GPIO-12) This is the very simple test-flow we created in Node-RED. [Screen Shot 05-11-22 at 06.35 PM] [{"id":"bb2bbcc236726f09","type":"tab","label…

**Note:**  
My student's requirement was 'subscribing' to MQTT messages. I'm sure the Arduino sketch can be extended or modified to handle 'publishing' MQTT messages.

---

_[View the full topic](https://discourse.nodered.org/t/error-sending-data-from-esp/62654)._
