Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HMLGW] Automatic reconnect does not work if hmlangw is used #29

Open
andyboeh opened this issue Jun 12, 2021 · 0 comments
Open

[HMLGW] Automatic reconnect does not work if hmlangw is used #29

andyboeh opened this issue Jun 12, 2021 · 0 comments

Comments

@andyboeh
Copy link

I use a HM-MOD-UART on a CP210x USB-serial converter on an OpenWrt router. I successfully compiled hmlangw for OpenWrt (https://github.com/andyboeh/hmlangw). This is fine as long as the gateway does not crash or reboot. If the gateway is restarted, Homegear has troubles reconnecting:

06/12/21 11:01:53.645 HM-LGW "Cube1": Error: No init packet received.
06/12/21 11:01:54.486 HM-LGW "Cube1": Warning: !!!Not!!! sending (Port 2001): K04
06/12/21 11:01:54.677 HM-LGW "Cube1": Warning: Connection closed. Trying to reconnect...
06/12/21 11:01:54.677 HM-LGW "Cube1": Info: No AES key specified in homematicbidcos.conf for communication with your HM-LGW. Disabling AES.
06/12/21 11:01:54.681 HM-LGW "Cube1": Connected to HM-LGW with hostname archerc7.lan on port 2000.
06/12/21 11:01:54.681 HM-LGW "Cube1": Info: Init packet received: H05,01,Revilo-HM-LGW,0.0.2,REQ0913185
S06,BidCoS-over-LAN-1.0
06/12/21 11:01:55.486 HM-LGW "Cube1": Info: Keep alive init packet received: H05,01,Revilo-HM-LGW,0.0.2,REQ0913185
06/12/21 11:02:24.681 HM-LGW "Cube1": Error: No init packet received.

This goes on for several minutes until it eventually succeeds.

On the OpenWrt-side, I can see the following log if it works:

Written serial number REQ0913185 to /tmp/serialnumber.txt
serial fd 3 name /dev/ttyHM
reset fd -1 gpio port -1
bidcosThread started!
keepAliveThread started!
Client 192.168.17.157 connected to BidCos port!
Client 192.168.17.157 connected to keepalive port!
Received 9 bytes from sockFd
sync data: >02,0000
received 9 bytes: >00,0000
received 15 bytes: L00,02,00FF,00
received 4 bytes: K01
Received 8 bytes from sockFd
0000: fd 00 03 00 00 03 18 0a  ........
Received 9 bytes from serial
0000: fd 00 04 00 00 04 01 99 3d  ........=
Received 18 bytes from serial
0000: fd 00 0d 00 00 00 43 6f 5f 43 50 55 5f 41 70 70  ......Co_CPU_App
0010: d8 31  .1
Received 8 bytes from sockFd
0000: fd 00 03 00 01 02 1e 0c  ........
Received 15 bytes from serial
0000: fd 00 0a 00 01 04 02 01 00 03 01 04 01 be 8a  ...............
Received 9 bytes from sockFd
0000: fd 00 04 00 02 0a 00 3d 10  .......=.
Received 9 bytes from serial
0000: fd 00 04 00 02 04 01 19 16  .........
Received 8 bytes from sockFd
0000: fd 00 03 00 03 0b 92 39  .......9
Received 19 bytes from serial
0000: fd 00 0e 00 03 04 02 52 45 51 30 39 31 33 31 38  .......REQ091318
0010: 35 66 46  5fF

...and if it doesn't succeed in reconnecting...

Written serial number REQ0913185 to /tmp/serialnumber.txt
serial fd 3 name /dev/ttyHM
reset fd -1 gpio port -1
bidcosThread started!
keepAliveThread started!
Client 192.168.17.157 connected to BidCos port!
Client 192.168.17.157 connected to keepalive port!
received 9 bytes: >07,0000
received 15 bytes: L00,02,00FF,00
received 4 bytes: K01
received 4 bytes: K02
received 4 bytes: K03
BidCos client closed connection.
Keepalive client closed connection.
Client 192.168.17.157 connected to BidCos port!
Client 192.168.17.157 connected to keepalive port!
received 9 bytes: >04,0000
received 15 bytes: L00,02,00FF,00
received 4 bytes: K01
received 4 bytes: K02
received 4 bytes: K03
BidCos client closed connection.
Keepalive client closed connection.
Client 192.168.17.157 connected to BidCos port!
Client 192.168.17.157 connected to keepalive port!
received 9 bytes: >04,0000
received 15 bytes: L00,02,00FF,00
received 4 bytes: K01
received 4 bytes: K02
received 4 bytes: K03
BidCos client closed connection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant