# MQTT with Arduino Nano + NodeRed

**URL:** https://discourse.nodered.org/t/mqtt-with-arduino-nano-nodered/37351
**Category:** General
**Created:** [11 December 2020 13:22 UTC](https://discourse.nodered.org/t/mqtt-with-arduino-nano-nodered/37351 "2020-12-11T13:22:03Z")
**Posts on this page:** 1
**Showing post:** 24

<div class="post-metadata">

### Author: ![PizzaProgram](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/pizzaprogram/32/19431_2.png) [@PizzaProgram](https://discourse.nodered.org/u/PizzaProgram)
#### Post date: [23 December 2020 09:13 UTC](https://discourse.nodered.org/t/mqtt-with-arduino-nano-nodered/37351/24 "2020-12-23T09:13:40Z")

</div>

@knolleary  
@JGKK  
Thank you for both of you about the recommendations! That gave me an idea to search with other keywords, and came up with +2 more possibilities. To summarise:

1. There is [Serial2Mqtt](https://github.com/vortex314/serial2mqtt) and [Mqtt2Serial](https://github.com/vortex314/mqtt2serial)

- PRO: easy to give names to the boards (devices) so no error possible to address a wrong one.
- PRO: Can work with Serial-ETH IP too.

- CON: the gateway is not auto-searching ports.
- CON: No failsafe mechanisms. (If serial disconnects, no serial parity etc.)
- CON: only C++ examples

1. [SerialToTCP](https://github.com/RoanBrand/ArduinoSerialToTCPBridgeClient)

- PRO: Seems to have better error-handling and fail safety. (CRC32, Timeout, ...)
- PRO: downloadable .INO example
- CON: only 1 man developed it, last time 2017
- CON: not too much documentation
- CON: not sure how to handle multiple boards with it.

1. [Ardulink has an MQTT gateway](http://www.ardulink.org/how-ardulink-mqtt-works/#comment-309) too!

- PRO: Seems to be a well tested "ready-to-use" solution
- PRO: Works with AtTiny85 boards too
- PRO: Unique Serialnumber can be added to each board (But no auto-check)

- CON: Too much JAVA spec, but pure step-by-step real use-case examples. Trying to put infos together how to make it work.
- CON: serial com has Zero safety protocol.
- CON: not enough infos yet. (will edit later)

1. And found an extremely robust 1wire protocol called [PJON](https://www.pjon.org) that can use a Nano board as gateway.  
**It has a [gRPC](https://github.com/Halytskyi/PJON-gRPC/tree/master/server) subproject, and there is a ready-to-use [gRPC Node](https://flows.nodered.org/node/node-red-contrib-grpc) already.**  
_I know it's not MQTT, but on this example video it seems to work very well!_

- PRO: the PJON protocol gives a very very stable wiring possibility up to 2000m ([See...](https://youtu.be/GWlhKD5lz5w))
- PRO: up to 256 devices on 1 wire
- 
- PRO: [gRPC](https://en.wikipedia.org/wiki/GRPC) is well tested too
- PRO: Unique Serialnumber and also worldwide MAC can be added to each board and can be addressed by those !!!
- PRO: AtTiny85 support

- CON: only 3KB/sec transfer rate, (but that's fine for IO ports + sensors)
- CON: Need some Arduino boards to sacrifice to work as gateways only, not as actors. (But they are cheap 😃 )
- CON: lot's of infos to learn.

> **[Halytskyi/PJON-gRPC](https://github.com/Halytskyi/PJON-gRPC)**
>
> gRPC server-client for PJON bus. Contribute to Halytskyi/PJON-gRPC development by creating an account on GitHub.

See also: 2 router setup to speed up communication [example (link)](https://github.com/Halytskyi/PJON-gRPC/tree/master/examples/devices/two_routers).

---

_[View the full topic](https://discourse.nodered.org/t/mqtt-with-arduino-nano-nodered/37351)._
