From 6e28c5d0e1fd9a3c82a49469636072e19aa2d96b Mon Sep 17 00:00:00 2001 From: starkillerOG Date: Mon, 21 Jun 2021 00:18:37 +0200 Subject: [PATCH] increase socket buffer size 1024->4096 (#1075) When a gateway has 30+ devices connected the message of the device list becomes bigger than 1024 bytes. That means only part of the message is read, and therefore the checksum will not match and you get an error. simply increasing the buffer size fixed this issue. See https://github.com/home-assistant/core/issues/51229 --- miio/miioprotocol.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/miio/miioprotocol.py b/miio/miioprotocol.py index 40a3b1719..1075b9642 100644 --- a/miio/miioprotocol.py +++ b/miio/miioprotocol.py @@ -190,7 +190,7 @@ def send( raise DeviceException from ex try: - data, addr = s.recvfrom(1024) + data, addr = s.recvfrom(4096) m = Message.parse(data, token=self.token) header = m.header.value