niceboygithub / AqaraGateway

Aqara Gateway/Hub integration for Home Assistant
523 stars 66 forks source link

G2H Pro telnet logged failed #173

Closed Faultiness closed 7 months ago

Faultiness commented 1 year ago

Hi,

I'm using G2H Pro (ZNSXJ15LM) with firmware 3.3.4_0016.0004. I've enabled telnet access using aQRootG3. And I've also enabled mqtt with:

mkdir /data/bin
cd /data/bin
wget -O /tmp/curl "http://master.dl.sourceforge.net/project/aqarahub/binutils/curl?viasf=1"; chmod +x /tmp/curl
/tmp/curl -s -k -L -o /data/bin/mosquitto https://raw.githubusercontent.com/niceboygithub/AqaraCameraHubfw/main/binutils/mosquitto_e1; chmod a+x /data/bin/mosquitto

The HASS is running in Docker with --network=host and I can connect to the camera using telnet on the host. 图片

However, the status in the system_health suggests HASS cannot connect to the camera via telnet while mqtt is ok: 图片

I've tried to reboot the camera and HASS docker and reload AqaraGateway but useless. The log of HASS that may relate to this issue is: 图片

I've tried to change line 44, timeout=10 to a larger one, say 30. But still not working.

May I ask what could be the reason for this? And how should I fix it? Thanks to anyone with suggestions.

Faultiness commented 1 year ago

Update: The error happened on line 44, which is the login part belonging to TelnetShell class, not TelnetShellG2HPro. Failed to login due to different login methods. I copied the login() part from TelnetShellG3 and replaced then it works fine. 图片 And then: 图片

ps: The device name of my gateway is lumi.camera.agl001, which matches the config in aqara_gateway/core/utils.py: 图片 图片

niceboygithub commented 7 months ago

The telnet login was imporoved in 0.2.4. Please have a try.