# Node-red communicating with Arduino using MQTT and NO Wifi?

**URL:** <https://discourse.nodered.org/t/node-red-communicating-with-arduino-using-mqtt-and-no-wifi/15471>\
**Category:** General\
**Created:** [12 September 2019 16:12 UTC](https://discourse.nodered.org/t/node-red-communicating-with-arduino-using-mqtt-and-no-wifi/15471 "2019-09-12T16:12:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Exit2Studios](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/exit2studios/32/10998_2.png) [@Exit2Studios](https://discourse.nodered.org/u/Exit2Studios)\
**Post date:** [12 September 2019 16:12 UTC](https://discourse.nodered.org/t/node-red-communicating-with-arduino-using-mqtt-and-no-wifi/15471/1 "2019-09-12T16:12:23Z")

</div>

Can someone help direct me to an example of how I can communicate with my Arduino Nano, which is directly connected to RPi running Mosquitto Broker and NR without wifi? I'm looking to elminate the reliance on wifi and prefer to go hard wired solution and want to control relays on the Arduino.

Thank you!

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [12 September 2019 16:17 UTC](https://discourse.nodered.org/t/node-red-communicating-with-arduino-using-mqtt-and-no-wifi/15471/2 "2019-09-12T16:17:09Z")

</div>

You will need to reprogram your Arduino - you can talk serial to the serialport node(s).  
Or you could use the firmata firmware and then use the arduino nodes to control the IO directly (again over serial - but now relying on the Firmata protocol rather than your own application.)

---

<div class="post-metadata">

**Author:** ![rei\_vilo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rei_vilo/32/162_2.png) [@rei\_vilo](https://discourse.nodered.org/u/rei_vilo)\
**Post date:** [12 September 2019 19:59 UTC](https://discourse.nodered.org/t/node-red-communicating-with-arduino-using-mqtt-and-no-wifi/15471/3 "2019-09-12T19:59:44Z")

</div>

How the payload of the MQTT message is formatted? Very often, it is JSON.

If so, you could use the serial port directly with JSON messages without MQTT.
