MQTT with Arduino Nano + NodeRed

@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 and 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
  • 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 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 that can use a Nano board as gateway.
    It has a gRPC subproject, and there is a ready-to-use gRPC Node 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...)
  • PRO: up to 256 devices on 1 wire
  • PRO: 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 :smiley: )
  • CON: lot's of infos to learn.

See also: 2 router setup to speed up communication example (link).