Recommended setup for MQTT and RFM69



  • What is the recommended setup to use an RFM69 Module with MQTT Gateway?

    I am using an Arduino serial gateway configured for RFM69 hooked directly to the UART of an RPi.
    I would like to use MQTT to communicate with my controller (this makes it easy to send messages to the sensors via multiple sources, which is convenient for me)

    I first did this by modifying the RPi gateway code to speak to the RFM69 and directly wiring the RFM69 module to the RPi. This worked, but I was missing messages, and I wasn't sure if possibly the RPi wasn't servicing the SPI quickly enough.
    So I switched to a serial gateway, and I've had much better reliability of receiving messages (I also changed some other things at the same time, so I'm not going to claim this was actually necessary), but now I have a serial interface to the gateway, and I need a MQTT to Serial converter. the only thing I found was this:

    https://forum.mysensors.org/topic/978/raspberry-pi-mqtt-mosquitto-serial-gateway/12

    But it seems to be abandoned. In the end, I wrote a simple python utility using paho-mqtt which does the same thing as the above script, and works well, so I don't actually have any problem at the moment, but I'm wondering what the preferred way to use an RFM69 with MQTT is given that Mysensors2.1 doesn't yet officially support the RPi gateway with this module (I realize it will be likely be available in 2.2...as I said, I already implemented it myself).

    I have looked at the documentation on gateways as well as the RPi documentation, but I didn't find a clear answer to this.


  • Hardware Contributor

    @PhracturedBlue
    At the moment I am using a node.js script to publish from serial gateway to mqtt:
    https://forum.mysensors.org/topic/4599/how-to-add-a-serial-device-to-use-in-node-red/10


  • Mod

    @PhracturedBlue you could use nodered on the rpi or a mqtt ethernet or esp8266 gateway.



  • Thanks for the input.

    The node.js solution doesn't seem any different than what I already have in python. If mysensors officially supported one of these options it would seem preferable to relying on a forum post somewhere. My concerns would mostly be about long-term support as the Mysensors API may change again in the future. As noted, it seems that the previous incarnation (PerlMQTTGateway) has basically been deprecated. Having already written a serial<->MQTT bridge, there wasn't much to it, so maybe there isn't really much risk for forward compatibility though.

    It seems the ESP8266 option might be a reasonable recommendation, though I personally wanted a hardwired connection to the gateway since wireless signal is not too strong where I'd like to put the gateway.It doesn't appear that there is a serial gw<->ethernet bridge option either. So as far as I can tell, the code distributed with mysensors seems to assume to gateway is directly connected to the radio (with the exception of the 'serial' gateway running on RPi)?

    I guess most users who decide to use RFM69 just use the serial interface?


  • Mod

    Can't you make an mqtt client ethernet gateway with w5100 shield on an Arduino Uno?


Log in to reply
 

Suggested Topics

  • 87
  • 7
  • 3
  • 8
  • 7
  • 10

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts