Skip to content

Commit

Permalink
increase socket buffer size 1024->4096 (#1075)
Browse files Browse the repository at this point in the history
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 home-assistant/core#51229
  • Loading branch information
starkillerOG committed Jun 20, 2021
1 parent 89a9ed9 commit 6e28c5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion miio/miioprotocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6e28c5d

Please sign in to comment.