Adafruit Feather M0 RFM69 with W5500 as MQTT-gateway for openhab and arduino nano with adafruit RFM69 breakout-board as sensor



  • Dear all,

    i baught a while ago the Adafruit Feather M0 RFM69 as it seemed to be an easy solution to build up a gateway. On the same online shop could i only get a W5500 ethernet module, so i wanted to give it a try.
    And when you start the Adafruit stuff i also ordered the break-out board for the RFM69 to use with the nano..

    It took me 2 days to get mysensors running on that devices - at the moment only as serial gateway. I was shocked that i need to make changes in the mysensor libraries..

    I found all information here in the forum but some have been outdated etc.. So i want to share my experience and help other people. I hope i remember everything and i do not forget something.
    Maybe somebody could update the mysensors homepage or even update the library.

    First the gateway with the Adafruit Feather M0 RFM69. Of course you need to install all libraries as described on the Adafruit homepage.

    The serialdevicee is running at baudrate of 9600 - i still dont know why..
    But the declaration in MyHwSAMD.h is wrong. For the Feather M0 you need to change. That was easy.

    #ifndef MY_SERIALDEVICE
    //#define MY_SERIALDEVICE SerialUSB
    #define MY_SERIALDEVICE Serial
    #endif
    

    In the arduion sketch need the pins to be defined

    #define MY_RADIO_RFM69
    #define MY_IS_RFM69HW
    #define MY_RFM69_FREQUENCY RFM69_868MHZ
    
    //make timeouts longer - i am not if it necessary
    #define MY_TRANSPORT_STATE_TIMEOUT_MS (20*1000ul)
    #define   MY_RFM95_TX_TIMEOUT_MS (10000ul)
    
    //Adafruit M0 RFM69
    #define MY_RFM69_CS_PIN 8
    #define MY_RFM69_IRQ_PIN 3
    #define MY_RFM69_IRQ_NUM 3
    #define MY_RFM95_RST_PIN 4
    

    Second the sensor-module with an Arduino nano replica and the Adafruit RFM69 break out board.
    The serial port is running at baudrate of 115200

    Also in this case i needed to define the pins manually depending on the hardware connection. In my case

    #define MY_RFM69_CS_PIN 4
    #define MY_RFM69_IRQ_PIN 2
    #define MY_RFM69_IRQ_NUM 0
    #define MY_RFM69_RST_PIN 3
    

    A little more tricky is the fact that the Adafruit module only works if you handle the RST pin manually MyTransportHAL.cpp

    bool transportHALInit(void)
    {
      
      pinMode(MY_RFM69_RST_PIN, OUTPUT);
      digitalWrite(MY_RFM69_RST_PIN, HIGH);
      delay(100);
      digitalWrite(MY_RFM69_RST_PIN, LOW);
      delay(100);
      
      TRANSPORT_HAL_DEBUG(PSTR("THA:INIT\n"));
    

    So as far as i remember this was everything to do that a message could be send from the node to the gateway. Next step will be to set up the W5500 for the gateway and integrate everything in openhab. And of course i want to use the bootloaader - but i fear i find some time in some weeks.. I keep you updated 😉



  • I finished the gateway some time ago. here are some pictures
    IMG_20200430_125142.jpg
    IMG_20200430_124702.jpg
    IMG_20200430_122710.jpg


Log in to reply
 

Suggested Topics

  • 17
  • 1
  • 51
  • 3
  • 1
  • 496
  • 17

127
Online

9.5k
Users

10.2k
Topics

105.6k
Posts