HM-LGW gets Connection closed (2) 3 seconds after initiating a new connection

Crosspost from Github

Since the last docker pull (latest) (Homegear 0.9.0-3672) I ran (Oct. 3rd) homegear connects to my HM-LGW but is being disconnected ~3 seconds later. While being connected it revceives and sends Bidcos Messages.

10/04/24 10:16:31.751 HM-LGW "LanGateway_NEQ0382244": Info: Firmware version: 1.4.1
10/04/24 10:16:31.776 HM-LGW "LanGateway_NEQ0382244": Info: Init queue completed. Sending peers...
10/04/24 10:16:32.680 HM-LGW "LanGateway_NEQ0382244": Info: Peer sending completed.
10/04/24 10:16:38.762 HM-LGW "LanGateway_NEQ0382244": Warning: Connection closed (2).
10/04/24 10:16:38.776 HM-LGW "LanGateway_NEQ0382244": Warning: Connection closed (2).
10/04/24 10:16:49.762 HM-LGW "LanGateway_NEQ0382244": Warning: Connection closed. Trying to reconnect...
10/04/24 10:16:49.765 HM-LGW "LanGateway_NEQ0382244": Connected to HM-LGW with hostname 192.168.42.42 on port 2000.
10/04/24 10:16:57.695 HM-LGW "LanGateway_NEQ0382244": Info: Firmware version: 1.4.1
10/04/24 10:16:57.721 HM-LGW "LanGateway_NEQ0382244": Info: Init queue completed. Sending peers...
10/04/24 10:16:58.619 HM-LGW "LanGateway_NEQ0382244": Info: Peer sending completed.
10/04/24 10:17:01.237 Module HomeMatic BidCoS: Info: 10/04/24 10:17:01.237 Packet received (LanGateway_NEQ0382244, RSSI: -48 dBm): 0F7A86103C42F40000000AB8FB094F00
10/04/24 10:17:01.237 Info: Peer 4 is reachable again.
10/04/24 10:17:01.250 Module HomeMatic BidCoS: Info: ACTUAL_TEMPERATURE on channel 4 of HomeMatic BidCoS peer 4 with serial number MEQ0787003 was set to 0x00FB.
10/04/24 10:17:01.250 Module HomeMatic BidCoS: Info: BATTERY_STATE on channel 4 of HomeMatic BidCoS peer 4 with serial number MEQ0787003 was set to 0x09.
10/04/24 10:17:01.250 Module HomeMatic BidCoS: Info: BOOST_STATE on channel 4 of HomeMatic BidCoS peer 4 with serial number MEQ0787003 was set to 0x00.
10/04/24 10:17:01.250 Module HomeMatic BidCoS: Info: CONTROL_MODE on channel 4 of HomeMatic BidCoS peer 4 with serial number MEQ0787003 was set to 0x00.
10/04/24 10:17:01.250 Module HomeMatic BidCoS: Info: FAULT_REPORTING on channel 4 of HomeMatic BidCoS peer 4 with serial number MEQ0787003 was set to 0x00.
10/04/24 10:17:01.253 Module HomeMatic BidCoS: Info: PARTY_START_TIME on channel 4 of HomeMatic BidCoS peer 4 with serial number MEQ0787003 was set to 0x00.
10/04/24 10:17:01.253 Module HomeMatic BidCoS: Info: SET_TEMPERATURE on channel 4 of HomeMatic BidCoS peer 4 with serial number MEQ0787003 was set to 0x2E.
10/04/24 10:17:01.253 Module HomeMatic BidCoS: Info: VALVE_STATE on channel 4 of HomeMatic BidCoS peer 4 with serial number MEQ0787003 was set to 0x4F.
10/04/24 10:17:04.762 HM-LGW "LanGateway_NEQ0382244": Warning: Connection closed (2).
10/04/24 10:17:04.776 HM-LGW "LanGateway_NEQ0382244": Warning: Connection closed (2).

The behavior is reproduceable from 2 different machines (Ubuntu/Debian).

Is there any chance to pull an older version of the homegear image, as the docker hub only lists the 4 most recent ones (latest, stable, testing, nightly)?

Regards

1 Like

Sorry that i cant help you, but in can confirm the exact same problem since the last docker update.
The problem is that they did not publish tags with versions numbers, so you cant go back to an earlier version.

I hope @sathya can help :slight_smile:

Fortunatley v 07.51-3 sth. is still available in the package repo. I managed to build a new image with that version that works fine afaict, minus a few error messages that haven’t been there before. If you want the docker file to build it yourself I can post it tomorrow.

The Dockerfile would be nice. Some errors are better than nothing at the moment.
My experience with the actual version is that some devices work and other produce errors. Did you see the same?

Did you base your dockerfile on the original homegear file?:

Yes I did. Basically the only things I did was to remove packages that I don’t need and put the respective versions into the apt command.

FROM debian:bullseye-slim
RUN apt-get update && apt-get -y install apt-transport-https wget ca-certificates apt-utils gnupg libzip4 libavahi-client3 libavahi-client-dev insserv locales lsb-release
RUN \
    touch /tmp/HOMEGEAR_STATIC_INSTALLATION; \
    touch /.dockerenv; \
    sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen; \
    locale-gen; \
    wget https://apt.homegear.eu/Release.key && apt-key add Release.key && rm Release.key; \
    echo 'deb https://apt.homegear.eu/debian/bullseye/homegear/stable/ bullseye main' >> /etc/apt/sources.list.d/homegear.list; \
    apt-get update && apt-get -y install \
	libhomegear-node=0.1.8-60 libhomegear-base=0.7.51-3497 homegear=0.7.51-3497 homegear-management=0.7.51-3497 \
	homegear-webssh=0.7.51-3497 homegear-adminui=0.2.0-1300 homegear-ui=0.1.0-388 \
	homegear-homematicbidcos=0.7.51-3497 homegear-ccu=0.7.51-3497; \
    rm -f /etc/homegear/dh1024.pem; \
    rm -f /etc/homegear/homegear.crt; \
    rm -f /etc/homegear/homegear.key; \
    cp -a /etc/homegear /etc/homegear.config; \
    cp -a /var/lib/homegear /var/lib/homegear.data; \
    apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8

VOLUME ["/etc/homegear", "/var/lib/homegear", "/var/log/homegear"]

COPY start.sh /start.sh
RUN chmod +x /start.sh
ENTRYPOINT ["/bin/bash", "-c", "/start.sh"]

EXPOSE 80 443 2001 2002 2003

For me the actual version does work with all devices but only inside that 3 seconds timeframe till the connection to the lan gw is dropped. And in most cases this isn’t enough time to send any queued commands.

I used docker exec to downgrade homegear direct in the docker. A little bit dirty, but worked (had to kill the homegear process manually, add the add the release key etc (line with “wget” in in the dockerfile and than used apt install with your versions selected).
This fixed the problem for me at the moment.