Cant't get MQTTGateway to work

  • Hardware Contributor

    Hell, I've been testing a MQTTGateway in my Arduino UNO and I can't get it to work, I checked and double checked, and the again, all the connections, and all is ok!

    I have a HanRun HR911105A and I'm running with SOFTSPI on! This module is powerd by 5v and I also tested it with a separated power supply!

    When I plug my Arduino I get in the serial monitor:

    0;0;3;0;9;gateway started, id=0, parent=0, distance=0

    The lights in the Ethernet Module start to blink but if I do a ping to the IP, it returns "unreachable"!

    This is my config:
    #include <DigitalIO.h>
    #include <SPI.h>

    #include <MySigningNone.h>
    #include <MyTransportRFM69.h>
    #include <MyTransportNRF24.h>
    #include <MyHwATMega328.h>
    #include <MySigningAtsha204Soft.h>
    #include <MySigningAtsha204.h>

    #include <MySensor.h>
    #include <MsTimer2.h>
    #include <Ethernet.h>
    #include "MyMQTT.h"

    #define INCLUSION_MODE_TIME 1 // Number of minutes inclusion mode is enabled
    #define INCLUSION_MODE_PIN 3 // Digital pin used for inclusion mode button

    // * Use this for IBOARD modded to use standard MISO/MOSI/SCK, see note 1 above!

    #define RADIO_CE_PIN 3 // radio chip enable
    #define RADIO_SPI_SS_PIN 8 // radio SPI serial select
    #define RADIO_ERROR_LED_PIN A2 // Error led pin
    #define RADIO_RX_LED_PIN A1 // Receive led pin
    #define RADIO_TX_LED_PIN A0 // the PCB, on board LED

    // * Use this for default configured pro mini / nano etc :

    #define RADIO_CE_PIN 5 // radio chip enable
    #define RADIO_SPI_SS_PIN 6 // radio SPI serial select
    #define RADIO_ERROR_LED_PIN 7 // Error led pin
    #define RADIO_RX_LED_PIN 8 // Receive led pin
    #define RADIO_TX_LED_PIN 9 // the PCB, on board LED*/

    #define TCP_PORT 1883 // Set your MQTT Broker Listening port.
    IPAddress TCP_IP ( 192, 168, 2, 30 ); // Configure your static ip-address here
    byte TCP_MAC[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };

    Can any one help me? This is driving me crazy!

    Thank you

  • Admin

    @Soloam said:

    HanRun HR911105A


  • Hardware Contributor

    Yes I think so! It's the one one the MySensor Store, the red one!

  • Admin

    Could you just try the W5100 Gateway sketch in the dev-branch it should be ready to run without any reconfiguration.

    The 5100 if pretty power hungry, are you able to test it with a bench power supply while testing?

  • Hardware Contributor

    Hello @hek !

    I tested the W5100 Gateway sketch but nothing happens, I don't see nothing in the serial monitor and I can't ping the IP! I tested also without defining the IP, but no DHCP request is made to my router!

    I also tested like you suggested, with a external power supply just to the W5100, no success!


    Thank You

  • Hardware Contributor

    This is so annoying! I tried this code:

    #include <SPI.h>
    #include <Ethernet.h>
    const int W5100_RESET_PIN = 8;
    byte mac[] = {
      0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
    IPAddress MY_IP(192,168,1,177);
    void setup() {
      Serial.println(F("node starting..."));
      pinMode(W5100_RESET_PIN, OUTPUT);
      digitalWrite(W5100_RESET_PIN, LOW);
      digitalWrite(W5100_RESET_PIN, HIGH);
      // give the Ethernet shield a second to initialize:
      Serial.print(F("static IP..."));
      Ethernet.begin(mac, IPAddress(MY_IP));
      Serial.print(F("local IP:"));
      Serial.println(F("node started."));
    void loop() {

    I found it online! Look at the IP (192.168.1,177)! This is the output from serial:

    node starting...
    static IP...local IP:
    node started.

    If I run it again the IP changes! =/

  • Seems, that your ip adresses dont match your network. What is the ip of your router? The first 3 numbers have to match in a normal home network...

    Are you aware how to do that?

  • Hardware Contributor

    The IP is in the range! I have several networks at my home, I tested it in all! In the case above the router IP is

    Can it be a defected network module? =/

  • Hardware Contributor

    I ordered 2 new W1500 modules to test out! Now I need to wait for them to arrive!

  • Hardware Contributor

    Hello, found a solution that solved my problem! You can use the topic as reference! I soldered the 100ohm as described and it worked 100%.

    Thank you all

  • Which total wire length is between the W5100 and the next active port (switch/router) ?

  • Hardware Contributor

    Wire Length? Way is this important? The problem was solved soldering te 2 resistors! The cable length is a normal small cable going to the router