Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Troubleshooting
  3. MY_GATEWAY_MQTT_CLIENT

MY_GATEWAY_MQTT_CLIENT

Scheduled Pinned Locked Moved Troubleshooting
4 Posts 2 Posters 68 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    keithJ
    wrote on last edited by
    #1

    Hi,

    I am trying to setup a MQTT (client) ethernet gateway using an UNO R3, W5100 ethernet shield, and Adafruit RFM69HCW.

    The nodes are communicating well with gateway using #define MY_GATEWAY_W5100; but I am having no luck when i change it to #define MY_GATEWAY_MQTT_CLIENT, and am getting the following error :

    34779 GWT:TPC:IP=192.168.1.177
    35781 GWT:RMQ:CONNECTING...
    37785 !GWT:RMQ:FAIL
    
    // Enable gateway ethernet module type
    //#define MY_GATEWAY_W5100
    #define MY_GATEWAY_MQTT_CLIENT
    
    // Set this node's subscribe and publish topic prefix
    #define MY_MQTT_PUBLISH_TOPIC_PREFIX "mygateway1-out"
    #define MY_MQTT_SUBSCRIBE_TOPIC_PREFIX "mygateway1-in"
    
    // Set MQTT client id
    #define MY_MQTT_CLIENT_ID "mysensors-1"
    
    #define SD_SS_PIN (4)  // chip-select for SD card (normally unused, pull high!, see code!) 
    
    // Enable these if your MQTT broker requires username/password
    //#define MY_MQTT_USER "username"
    //#define MY_MQTT_PASSWORD "password"
    
    // Enable MY_IP_ADDRESS here if you want a static p address (no DHCP)
    #define MY_IP_ADDRESS 192,168,1,177   // If this is disabled, DHCP is used to retrieve address
    #define MY_MAC_ADDRESS 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
    
    // If using static ip you can define Gateway and Subnet address as well
    #define MY_IP_GATEWAY_ADDRESS 192,168,1,1
    //#define MY_IP_SUBNET_ADDRESS 255,255,255,0
    
    // MQTT broker ip address or url. Define one or the other.
    //#define MY_CONTROLLER_URL_ADDRESS "m20.cloudmqtt.com"
    #define MY_CONTROLLER_IP_ADDRESS 192, 168, 1, 225
    
    // The MQTT broker port to to open
    //#define MY_PORT 1883
    

    I can connect to the MQTT broker (which is my openhab instance on 192.168.1.225)
    without username and password)

    I have read lots but become even more confused :/

    In addition to #define MY_GATEWAY_MQTT_CLIENT, what else should be set? How can i see if there is even an attempt to contact the broker?

    many thanks

    1 Reply Last reply
    0
    • K Offline
      K Offline
      keithJ
      wrote on last edited by
      #2

      OMG!!! i feel such a fool!

      Spent a good hour searching - and immediately after posting the above - realised the ethernet cable was unplugged!!!!

      facepalm!

      :blush:

      1 Reply Last reply
      1
      • K Offline
        K Offline
        keithJ
        wrote on last edited by
        #3

        actually it was longer than that :/

        1 Reply Last reply
        0
        • electrikE Offline
          electrikE Offline
          electrik
          wrote on last edited by
          #4

          This is a good tip to add to the build instructions. Check if you plugged the cable 😂

          1 Reply Last reply
          1
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          16

          Online

          11.7k

          Users

          11.2k

          Topics

          113.1k

          Posts


          Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • MySensors
          • OpenHardware.io
          • Categories
          • Recent
          • Tags
          • Popular