# Emotiv push node data send them via mqtt protocol to an esp8266 and activate an output

**URL:** <https://discourse.nodered.org/t/emotiv-push-node-data-send-them-via-mqtt-protocol-to-an-esp8266-and-activate-an-output/79357>\
**Category:** General\
**Tags:** mqtt\
**Created:** [23 June 2023 03:03 UTC](https://discourse.nodered.org/t/emotiv-push-node-data-send-them-via-mqtt-protocol-to-an-esp8266-and-activate-an-output/79357 "2023-06-23T03:03:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![osman11](https://avatars.discourse-cdn.com/v4/letter/o/74df32/32.png) [@osman11](https://discourse.nodered.org/u/osman11)\
**Post date:** [23 June 2023 03:03 UTC](https://discourse.nodered.org/t/emotiv-push-node-data-send-them-via-mqtt-protocol-to-an-esp8266-and-activate-an-output/79357/1 "2023-06-23T03:03:00Z")

</div>

I am using the emotiv simulator to generate integer data from 0 to 100 through the emotiv node, in this case the push node, I need to send these data to the mosquito broker that will communicate through the MQTT protocol to esp8266 and activate an output, if I Could you help me with any ideas, thanks.  
In the flow that is observed in the range of 0-50, it shows the value of the integer value and the text opens prosthesis and greater than 50 shows the text closes prosthesis

 ![node red](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/b/4b299ae24906783783d8b70542856ff393d51282.png)  
 ![nod-red-push](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/0/306f72344c1cf78638322f9909921b82733fc10f.png)

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [23 June 2023 09:02 UTC](https://discourse.nodered.org/t/emotiv-push-node-data-send-them-via-mqtt-protocol-to-an-esp8266-and-activate-an-output/79357/2 "2023-06-23T09:02:20Z")

</div>

If I understand you correctly, you want to send the numeric value via MQTT. So add a mqtt-out node to your flow and configure it to connect to your mqtt broker. Set a topic (that the esp8266 will subscribe to) and since the value is already I msg.payload, it should work.

If you add an mqtt-in node subscribing to teh topic, ou can check that the msg is being send and received by subscribers.

---

<div class="post-metadata">

**Author:** ![osman11](https://avatars.discourse-cdn.com/v4/letter/o/74df32/32.png) [@osman11](https://discourse.nodered.org/u/osman11)\
**Post date:** [25 June 2023 13:05 UTC](https://discourse.nodered.org/t/emotiv-push-node-data-send-them-via-mqtt-protocol-to-an-esp8266-and-activate-an-output/79357/3 "2023-06-25T13:05:30Z")

</div>

I do it by testing a mqtt input and output, as you suggested, for the moment I am seeing that if it sends the data, now I want that depending on the value of the data sent, activate an output in the esp8266

 ![comando push](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/5/55acdb753caac41cee757bd285cc195aecb0ca35.png)

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [25 June 2023 14:45 UTC](https://discourse.nodered.org/t/emotiv-push-node-data-send-them-via-mqtt-protocol-to-an-esp8266-and-activate-an-output/79357/4 "2023-06-25T14:45:10Z")

</div>

Your image of the arduino code is cut off. Copy the code and paste it into a reply

In order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote `````)

````auto
``` 
   code goes here 
```

````

You can edit and correct your post by clicking the pencil ✏ icon.

See this post for more details - [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506)

---

<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:** [24 August 2023 14:45 UTC](https://discourse.nodered.org/t/emotiv-push-node-data-send-them-via-mqtt-protocol-to-an-esp8266-and-activate-an-output/79357/5 "2023-08-24T14:45:56Z")

</div>

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