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. [SOLVED] MQTT Ethernet shield gateway

[SOLVED] MQTT Ethernet shield gateway

Scheduled Pinned Locked Moved Troubleshooting
14 Posts 4 Posters 4.7k Views 4 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.
  • G Offline
    G Offline
    Gustafsson
    wrote on last edited by
    #5

    Anyone got a clue what can be the issue here? Would love someone to Point me in the right direction so I can continue with all my planed builds.

    1 Reply Last reply
    0
    • Thomas AugustinusT Offline
      Thomas AugustinusT Offline
      Thomas Augustinus
      wrote on last edited by
      #6

      Hi @Gustafsson
      I cannot claim to be an Expert. I did what you are doing with almost untouched v2.0 examples... so a suggestion be to upgrade to 2.0 and try again...
      Sensors must have a client id manually assigned AND Clear the eeprom with the sketch in the The mysensor - not the arduino One.
      The Gateway I just commented out the ip to get a dhcp ip. Then I updated the broker url and it Works 😀

      Good luck

      G 1 Reply Last reply
      0
      • Thomas AugustinusT Thomas Augustinus

        Hi @Gustafsson
        I cannot claim to be an Expert. I did what you are doing with almost untouched v2.0 examples... so a suggestion be to upgrade to 2.0 and try again...
        Sensors must have a client id manually assigned AND Clear the eeprom with the sketch in the The mysensor - not the arduino One.
        The Gateway I just commented out the ip to get a dhcp ip. Then I updated the broker url and it Works 😀

        Good luck

        G Offline
        G Offline
        Gustafsson
        wrote on last edited by
        #7

        @Thomas-Augustinus Thanks for your help.

        What hardware are you using? It kind of feels like something i troubling with mine. As I said before, I have to do a lot of modifications to make my radio pass the "check". Can you please describe you build of your gateway?

        Thanks

        Thomas AugustinusT 1 Reply Last reply
        0
        • G Gustafsson

          @Thomas-Augustinus Thanks for your help.

          What hardware are you using? It kind of feels like something i troubling with mine. As I said before, I have to do a lot of modifications to make my radio pass the "check". Can you please describe you build of your gateway?

          Thanks

          Thomas AugustinusT Offline
          Thomas AugustinusT Offline
          Thomas Augustinus
          wrote on last edited by
          #8

          @Gustafsson - sure,

          Gateway:
          arduino uno R3 with w5100 ethernet shield and NRF24L01 radio. All bought on ebay from some random chinese manufacturer...

          Radio with soft-spi - connected as illustrated here.
          Running the GatewayW5100MQTTClient sketch with the following changes:

          • comment out the IP to activate DHCP:
            //#define MY_IP_ADDRESS 192,168,178,87
          • Enter mqtt broker address - I use the public available hivemq demo:
            #define MY_CONTROLLER_URL_ADDRESS "broker.hivemq.com"
          • optional change mqtt settings:
            #define MY_MQTT_PUBLISH_TOPIC_PREFIX "to"
            #define MY_MQTT_SUBSCRIBE_TOPIC_PREFIX "ti"
            #define MY_MQTT_CLIENT_ID "tv50"

          Sensor
          Arduino nano with serial adaptor, NRF24L01 radio and a switch on pin 3.
          Running the BinarySwitchSleepSensor. Only change is to add this line to assign node-id:
          #define MY_NODE_ID 12
          It is only needed the first time - after that it is stored in eeprom. If you check the debug serial prints, then you should be able to find something like:
          TSP:ASSIGNID:OK (ID=11)
          If it does not get the right id then load the ClearEepromConfig, run it and go back to the binary switch sketch.

          How to test
          The above enabled me to use mqtt.fx to connect to the hivemq broker and subscribe to "to/#" which means all messages from my gateway (to is the mqtt out prefix configured on the controller).

          If it still does not work then please post a dump from the serial port - perhaps some of the champs can help decode it... :-)

          /th

          G 1 Reply Last reply
          0
          • Thomas AugustinusT Thomas Augustinus

            @Gustafsson - sure,

            Gateway:
            arduino uno R3 with w5100 ethernet shield and NRF24L01 radio. All bought on ebay from some random chinese manufacturer...

            Radio with soft-spi - connected as illustrated here.
            Running the GatewayW5100MQTTClient sketch with the following changes:

            • comment out the IP to activate DHCP:
              //#define MY_IP_ADDRESS 192,168,178,87
            • Enter mqtt broker address - I use the public available hivemq demo:
              #define MY_CONTROLLER_URL_ADDRESS "broker.hivemq.com"
            • optional change mqtt settings:
              #define MY_MQTT_PUBLISH_TOPIC_PREFIX "to"
              #define MY_MQTT_SUBSCRIBE_TOPIC_PREFIX "ti"
              #define MY_MQTT_CLIENT_ID "tv50"

            Sensor
            Arduino nano with serial adaptor, NRF24L01 radio and a switch on pin 3.
            Running the BinarySwitchSleepSensor. Only change is to add this line to assign node-id:
            #define MY_NODE_ID 12
            It is only needed the first time - after that it is stored in eeprom. If you check the debug serial prints, then you should be able to find something like:
            TSP:ASSIGNID:OK (ID=11)
            If it does not get the right id then load the ClearEepromConfig, run it and go back to the binary switch sketch.

            How to test
            The above enabled me to use mqtt.fx to connect to the hivemq broker and subscribe to "to/#" which means all messages from my gateway (to is the mqtt out prefix configured on the controller).

            If it still does not work then please post a dump from the serial port - perhaps some of the champs can help decode it... :-)

            /th

            G Offline
            G Offline
            Gustafsson
            wrote on last edited by
            #9

            @Thomas-Augustinus - Thanks

            It sounds like it's exactly as my gateway.

            I'm going to work now but the first thing tomorrow morning I will check on mine and come back to you if it works or not.

            I really appreciate all your help :+1:

            //Fredrik

            1 Reply Last reply
            0
            • Thomas AugustinusT Offline
              Thomas AugustinusT Offline
              Thomas Augustinus
              wrote on last edited by Thomas Augustinus
              #10

              Gateway:
              alt text

              Sensor:
              alt text

              G 1 Reply Last reply
              0
              • Thomas AugustinusT Thomas Augustinus

                Gateway:
                alt text

                Sensor:
                alt text

                G Offline
                G Offline
                Gustafsson
                wrote on last edited by
                #11

                @Thomas-Augustinus Thanks for the pictures.

                I checked my gateway and it's wired exactly the way yours is but still no luck.

                I reinstalled my arduinoprogram and installed the latest MySensors library again, just to be sure. The only thing I have done to the code is enable soft SPI, commented out IP to activate DHCP and also entered my MQTT IP adress.

                This i what my serial port says..

                0;255;3;0;9;Starting gateway (RNNGA-, 2.0.0)
                0;255;3;0;9;TSM:INIT
                0;255;3;0;9;!TSM:RADIO:FAIL
                0;255;3;0;9;!TSM:FAILURE
                0;255;3;0;9;TSM:PDT
                0;255;3;0;9;TSM:INIT
                0;255;3;0;9;!TSM:RADIO:FAIL
                0;255;3;0;9;!TSM:FAILURE
                0;255;3;0;9;TSM:PDT
                

                I first bought all my parts from China, but after I got this message I ordered some radios, with and without antenna, from Sweden but still no luck. I have one arduino Uno and W5100 ethernet shield.

                Is there a possibility that my Uno or W5100 is the problem?

                /Fredrik

                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  Gustafsson
                  wrote on last edited by
                  #12

                  Problem fixed.

                  Apparently my wires from Chine was the problem. Bought some new ones and now it works.

                  Thanks for all help @Thomas-Augustinus

                  1 Reply Last reply
                  0
                  • Thomas AugustinusT Offline
                    Thomas AugustinusT Offline
                    Thomas Augustinus
                    wrote on last edited by
                    #13

                    Great to hear that. I had similar problems - only with corroded pins on the w5100 shield so my proposal would have been to remove the shield, work on the radio and then when that worked return to the w5100...
                    But great! It Works 😃
                    /th

                    1 Reply Last reply
                    0
                    • G Offline
                      G Offline
                      Gustafsson
                      wrote on last edited by
                      #14

                      Good to hear that you had a plan :laughing:

                      Now the only problem is that I need to figure out how to connect everything with the sensors and then to openhab. I'm off duty tonight so I'm going to see what Google have for me :)

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


                      12

                      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