bropat / eufy-security-ws

Small server wrapper around eufy-security-client library to access it via a WebSocket.
MIT License
184 stars 29 forks source link

[Bug]: after firmware update 3.3.0.1h everything seems to be read-only #250

Closed nhulsch closed 1 year ago

nhulsch commented 1 year ago

Version

1.6.2

Node version

18.17.0

Operating System type

Docker

Operating system version

Raspbian 11.7

Describe the bug

After HomeBase 2 was updated to firmware version 3.3.0.1h it looks like everything is read-only from now. I can set the guardMode that is being confirmed, but it doesn't switch the actual alarm mode. I can issue a reboot command thats being confirmed but station doesn't reboot.

When I switch the guardMode with the app I can see alarm mode changes in the server. When I reboot the station from the app, I can see it rebooting.

To reproduce

Let the update be installed and try reboot.

Screenshots & Logfiles

Log from server with DEBUG=1 when issuing reboot command

2023-08-17 10:23:33.604 DEBUG [Station.rebootHUB] Sending reboot command to station T8010NXXXXXXXX 2023-08-17 10:23:33.608 DEBUG [P2PClientProtocol._sendCommand] Sending p2p command... { station: 'T8010NXXXXXXXX', sequence: 5, commandType: 1034, channel: 255, retries: 0, messageStatesSize: 1 } 2023-08-17 10:23:33.628 DEBUG [P2PClientProtocol.handleMsg] Station T8010NXXXXXXXX - ACK DATA - received from host x.x.x.x:23072 for sequence 5 2023-08-17 10:23:33.640 DEBUG [P2PClientProtocol.handleMsg] Station T8010NXXXXXXXX - DATA DATA - received from host x.x.x.x:23072 - Processing sequence 5... 2023-08-17 10:23:33.642 DEBUG [P2PClientProtocol.parseDataMessage] Station T8010NXXXXXXXX - Received data { seqNo: 5, header: { commandId: 1034, bytesToRead: 132, channel: 255, signCode: 0, type: 1 }, bytesRead: 132, bytesToRead: 132, firstPartMessage: true, messageSize: 148 } 2023-08-17 10:23:33.647 DEBUG [P2PClientProtocol.handleData] Station T8010NXXXXXXXX - Received data { commandIdName: 'CMD_HUB_REBOOT', commandId: 1034, resultCodeName: 'ERROR_PPCS_SUCCESSFUL', resultCode: 0, message: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', data: '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', seqNumber: 6, energySavingDeviceP2PDataSeqNumber: 0, offsetDataSeqNumber: 0 } 2023-08-17 10:23:33.654 DEBUG [P2PClientProtocol.handleData] Station T8010NXXXXXXXX - Result data for command received { message: { sequence: 5, commandType: 1034, nestedCommandType: undefined, channel: 255, acknowledged: true, retries: 0, returnCode: -133, data: <Buffer d1 00 00 05 58 5a 59 48 0a 04 84 00 00 00 01 00 ff 00 00 00 00 00 00 00 38 31 66 34 35 31 37 39 62 30 39 31 38 36 66 39 30 61 61 39 35 30 37 38 63 39 ... 102 more bytes>, customData: { command: { name: 'stationReboot' } } }, resultCodeName: 'ERROR_PPCS_SUCCESSFUL', resultCode: 0 } 2023-08-17 10:23:33.659 DEBUG [Station.onCommandResponse] Got p2p command response { station: 'T8010NXXXXXXXX', commandType: 1034, channel: 255, returnCodeName: 'ERROR_PPCS_SUCCESSFUL', returnCode: 0, customData: { command: { name: 'stationReboot' } } } 2023-08-17 10:23:33.667 DEBUG [P2PClientProtocol.handleMsg] Station T8010NXXXXXXXX - DATA DATA - Received expected sequence (expectedSeqNo: 6 seqNo: 5 queuedData.size: 0) 2023-08-17 10:23:33.671 DEBUG [P2PClientProtocol.handleMsg] Station T8010NXXXXXXXX - DATA DATA - received from host x.x.x.x:23072 - Processing sequence 5... 2023-08-17 10:23:33.673 DEBUG [P2PClientProtocol.handleMsg] Station T8010NXXXXXXXX - DATA DATA - Received already processed sequence (expectedSeqNo: 6 seqNo: 5 queuedData.size: 0)

Additional context

No response

kvanbiesen commented 1 year ago

just to mention, my homebase is Firmware: 3.2.9.5h and everything is working as normal. So defently somethin changed with the new firmware

bropat commented 1 year ago

As @kvanbiesen points out, something has been changed with the latest firmware version and that is that P2P encryption has been made mandatory. Until then, the firmware supported and accepted unencrypted P2P communication. I had known for some time that some P2P commands are now sent encrypted, but as long as there was something else to implement and it was not mandatory to encrypt, I did not invest any time in it. Now I have also partially implemented this part (see here).

In the next release, P2P communication will work again.

bropat commented 1 year ago

Fixed in version 1.6.3.

ronaldt80 commented 1 year ago

Wow .. don't know what happened but suddenly my rtsp cameras respond so much quicker, better than it ever was. Hope it lasts and eufy won't break it again.

Many thanks!