Cannot connect to Sensebender Ethernet Gateway

Tags: #<Tag:0x00007f328a4b2f58>

Hi there.
I’m trying to get a Sensebender Ethernet Gateway to work with Home Assistant.
But I get following error:

2020-11-17 09:23:26 INFO (MainThread) [mysensors.gateway_tcp] Trying to connect to ('192.168.178.48', 5003)
2020-11-17 09:23:26 ERROR (MainThread) [mysensors.gateway_tcp] Failed to connect to socket at ('192.168.178.48', 5003)
2020-11-17 09:23:26 INFO (MainThread) [mysensors.gateway_tcp] Waiting 10.0 secs before trying to connect again

Here my configs:

mysensors:
  version: 2.3
  optimistic: false
  persistence: true
  gateways:
    - device: '192.168.178.48'
      tcp_port: 5003

Sketch:

/**
* The MySensors Arduino library handles the wireless radio link and protocol
* between your home built sensors/actuators and HA controller of choice.
* The sensors forms a self healing radio network with optional repeaters. Each
* repeater and gateway builds a routing tables in EEPROM which keeps track of the
* network topology allowing messages to be routed to nodes.
*
* Created by Henrik Ekblad <[email protected]>
* Copyright (C) 2013-2018 Sensnology AB
* Full contributor list: https://github.com/mysensors/MySensors/graphs/contributors
*
* Documentation: http://www.mysensors.org
* Support Forum: http://forum.mysensors.org
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
*
*******************************
*
* DESCRIPTION
* The ArduinoGateway prints data received from sensors on the serial link.
* The gateway accepts input on serial which will be sent out on radio network.
*
* This GW code is designed for Sensebender GateWay / (Arduino Zero variant)
*
* Wire connections (OPTIONAL):
* - Inclusion button should be connected to SW2
*
* LEDs on board (default assignments):
* - Orange: USB RX/TX - Blink when receiving / transmitting on USB CDC device
* - Yellow: RX  - Blink fast on radio message received. In inclusion mode will blink fast only on presentation received
* - Green : TX  - Blink fast on radio message transmitted. In inclusion mode will blink slowly
* - Red   : ERR - Fast blink on error during transmission error or receive crc error
* - Blue  : free - (use with LED_BLUE macro)
*
*/

#define SKETCH_VERSION "1.2"
// Enable debug prints to serial monitor
#define MY_DEBUG
#define MY_SPECIAL_DEBUG

// Enable and select radio type attached
#define MY_RADIO_RF24
//#define MY_RADIO_NRF5_ESB
//#define MY_RADIO_RFM69
//#define MY_RADIO_RFM95

// Set LOW transmit power level as default, if you have an amplified NRF-module and
// power your radio separately with a good regulator you can turn up PA level.
#define MY_RF24_PA_LEVEL RF24_PA_LOW

// Enable gateway ethernet module type
#define MY_GATEWAY_W5100

#define MY_GATEWAY_MAX_CLIENTS 4
//#define MY_RX_MESSAGE_BUFFER_FEATURE
//#define MY_RX_MESSAGE_BUFFER_SIZE 200

// Enable Soft SPI for NRF radio (note different radio wiring is required)
// The W5100 ethernet module seems to have a hard time co-operate with
// radio on the same spi bus.
#if !defined(MY_W5100_SPI_EN) && !defined(ARDUINO_ARCH_SAMD)
#define MY_SOFTSPI
#define MY_SOFT_SPI_SCK_PIN 14
#define MY_SOFT_SPI_MISO_PIN 16
#define MY_SOFT_SPI_MOSI_PIN 15
#endif

#define MY_IP_ADDRESS 192,168,178,48

//#define MY_MAC_ADDRESS 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED

// The port to keep open on node server mode / or port to contact in client mode
#define MY_PORT 5003

// When W5100 is connected we have to move CE/CSN pins for NRF radio
#ifndef MY_RF24_CE_PIN
#define MY_RF24_CE_PIN 5
#endif
#ifndef MY_RF24_CS_PIN
#define MY_RF24_CS_PIN 6
#endif

// Define a lower baud rate for Arduinos running on 8 MHz (Arduino Pro Mini 3.3V & Sensebender)
#if F_CPU == 8000000L
#define MY_BAUD_RATE 38400
#endif
#define MY_BAUD_RATE 115200

// Enable inclusion mode
//#define MY_INCLUSION_MODE_FEATURE
// Enable Inclusion mode button on gateway
//#define MY_INCLUSION_BUTTON_FEATURE

// Inverses behavior of inclusion button (if using external pullup)
//#define MY_INCLUSION_BUTTON_EXTERNAL_PULLUP

// Set inclusion mode duration (in seconds)
//#define MY_INCLUSION_MODE_DURATION 60
// Digital pin used for inclusion mode button
//#define MY_INCLUSION_MODE_BUTTON_PIN  3

// Set blinking period
#define MY_DEFAULT_LED_BLINK_PERIOD 300

// Inverses the behavior of leds
//#define MY_WITH_LEDS_BLINKING_INVERSE

// Flash leds on rx/tx/err
// Uncomment to override default HW configurations
#define MY_DEFAULT_ERR_LED_PIN LED_RED  // Error led pin
#define MY_DEFAULT_RX_LED_PIN  LED_BLUE  // Receive led pin
#define MY_DEFAULT_TX_LED_PIN  LED_YELLOW  // the PCB, on board LED

#if defined(MY_USE_UDP)
#include <EthernetUdp.h>
#endif
#include <Ethernet.h>
#include <SD.h>
#include <MySensors.h>
Sd2Card card;

#define EEPROM_VERIFICATION_ADDRESS 0x01

static uint8_t num_of_leds = 5;
static uint8_t leds[] = {LED_BLUE, LED_RED, LED_GREEN, LED_YELLOW, LED_ORANGE};

void setup()
{
  Serial.println("setup");
  //preHwInit();
    // Setup locally attached sensors
}

void presentation()
{
    // Present locally attached sensors
}

void loop()
{
    // Send locally attached sensor data here
}

Output from GW:

Sensebender GateWay test routine
MySensors core version : 2.3.2
GateWay sketch version : 1.2
----------------------------------

-> analog : 49 Failed
417699 MCO:BGN:INIT GW,CP=RNNGS---,FQ=48,REL=255,VER=2.3.2
417728 TSF:LRT:OK
417728 TSM:INIT
417729 TSF:WUR:MS=0
417734 TSM:INIT:TSP OK
417734 TSM:INIT:GW MODE
417734 TSM:READY:ID=0,PAR=0,DIS=0
417735 MCO:REG:NOT NEEDED
418295 GWT:TIN:IP=192.168.178.48
419296 MCO:BGN:STP
setup
419296 MCO:BGN:INIT OK,TSP=1
419296 TSM:READY:NWD REQ
419299 ?TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=20,pt=0,l=0,sg=0,ft=0,st=OK: