Gateway MQTT with RFM69



  • Hello,
    I'm trying to make an MQTT gateway with an arduino uno, a HanRun HR911105A shield and an RFM69.
    I am in version 2.3.1 of MySensors.
    I realized for several years this type of gateway with NRF24 + which works without problem.
    With the RFM69, if I put the MISO cable at 12, the MQTT connection tries to wait for incomprehensible IP addresses but the RFM69 starts up well.
    If I remove the MISO, the MQTT connection is at the correct address and works but of course the RFM69 does not start.
    I tried cabling the RST on the GND of the shield but always the same.
    I looked a lot of post but I did not find anything to deal with the problem.
    Any ideas ? an advice ? an experiment ?
    Thanks in advance.


  • Mod

    @miclane HR911105A is known to have trouble sharing the SPI bus. The general recommendation is to use softspi. See https://www.mysensors.org/build/ethernet_gateway for the wiring and defines.



  • Thank you for your reply.
    But I do not see anything on the page indicated which corresponds to the pinning for an RFM69.
    I tried to compose with this page and the RFM69 pinouts but I get the same results.
    Either the ethernet part works but not the radio part.
    Either the radio part works but not the ethernet part.
    Is this configuration really operational?
    Because a lot of post does not seem to have managed to make it work.
    Cordially.


  • Mod

    @miclane yes you are right, there are no instructions for rfm69. Sorry.
    I have very little experience with rfm69, no experience with the ethernet shield, no experience with softspi and no experience with mqtt. Hopefully someone else can help.


  • Mod

    @miclane said in Gateway MQTT with RFM69:

    HanRun HR911105A

    This only tells what ethernet jack is on the board. Do you have more information on your ethernet shield? (specs, schematics, or even a picture?)

    I realized for several years this type of gateway

    What changed (apart from the mySensors library version) since then?

    Please share your sketch and a startup debug log.



    1. Yes, there is of course the RJ45 plug on the shield which fits directly by the arduino UNO. The only indications are HanRun HR911105A 15/10.
    2. What has changed is that I have always used NRF24 +. The gateway that I use in operation at home is also in version MySensors 2.3.1 with NRF24+
    3. I use the basic sketch on the site :

    #define MY_DEBUG
    #define MY_TRANSPORT_WAIT_READY_MS 10000
    #define MY_RADIO_RFM69
    #define MY_RF69_SPI_CS 9
    #define MY_GATEWAY_W5100
    #define MY_GATEWAY_MQTT_CLIENT
    #define MY_MQTT_PUBLISH_TOPIC_PREFIX "mhs-pub-1"
    #define MY_MQTT_SUBSCRIBE_TOPIC_PREFIX "mhs-sub-1"
    #define MY_MQTT_CLIENT_ID "MHS_GW_02"
    #define MY_MQTT_USER "xxxxxx"
    #define MY_MQTT_PASSWORD "yyyyyyyy"

    #define MY_IP_ADDRESS 12,9,0,101
    #define MY_IP_GATEWAY_ADDRESS 12,9,0,1
    #define MY_IP_SUBNET_ADDRESS 255,255,255,0
    #define MY_CONTROLLER_IP_ADDRESS 12,9,0,8
    #define MY_PORT 1883
    #define MY_MAC_ADDRESS 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED

    #define MY_DEFAULT_LED_BLINK_PERIOD 300

    #include <SPI.h>
    #include <Ethernet.h>
    #include <MySensors.h>

    void setup() {}

    void presentation() {}

    void loop() {}

    Thank you.



  • Hello @miclane,
    I'm currently building an MQTT Gateway with RFM69 and Wiznet W5100 module.
    0_1547398672784_mqtt-gateway-top.jpg
    Are you using the same ethernet module? Please read about the chip select/SEN issue:
    https://arduinodiy.wordpress.com/2017/04/12/the-w5100-bug/
    I've modified my module and both chips (RFM69, W5100) are starting up.
    0_1547398649172_w5100-mod.jpg

    Mapping:

    W5100-MO = RFM69-MOSI = D11
    W5100-MI = RFM69-MISO =  D12
    W5100-SCK = RFM69-SCK = D13
    W5100-NSS = D10
    RFM69-NSS = A0
    RFM69-DI00 = D02
    

    Defines:

    #define MY_RADIO_RFM69
    #define MY_IS_RFM69HW  // Mandatory if you radio module is the high power version (RFM69HW and RFM69HCW), Comment it if it's not the case
    #define MY_RF69_SPI_CS 14
    // W5100 Ethernet module SPI enable (optional if using a shield/module that manages SPI_EN signal)
    #define MY_W5100_SPI_EN 10
    #define MY_GATEWAY_MQTT_CLIENT
    


  • Thank you for your very clear answer.
    I will test by getting a MOSFET.
    Have a good day.



  • just wanted to add that my W5100/RFM69 ethernet gateway works - but I had to patch two lines in the Ethernet library (w5100.h), see
    https://forum.mysensors.org/topic/6330/still-searching-for-a-working-ethernet-gw-with-rfm69/8

    Now I'll see if the MQTT gateway works, too...


Log in to reply
 

Suggested Topics

47
Online

11.4k
Users

11.1k
Topics

112.6k
Posts