bropat / eufy-security-ws

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

[Bug]: Only 1 of 5 eufyCam 2C's connected to HomeBase 2 work for downloading clips after upgrading to versions above 0.9.4 #175

Closed ema-dev closed 1 year ago

ema-dev commented 1 year ago

Version

1.3.0

Node version

16.14.0

Operating System type

Docker

Operating system version

Docker Desktop 4.13.0 for Windows - Engine Version: 20.10.20

Describe the bug

I have Eufy HomeBase 2 (System Version: 3.2.5.1h | Subsystem Version: 1.3.0.9) and after upgrading from bropat/eufy-security-ws 0.9.4 to any version above, only one of my eufyCam 2C's work when attempting to download clips. All eufyCam 2C's worked when downloading on 0.9.4 (only video, NOT audio). After Eufy made some recent updates, version 0.9.4 no longer works because of the 403 forbidden response when fetching the profile and/or devices. I am currently on version 1.3.0 and everything seems to work properly for my uses except downloading clips for 4 out of 5 eufyCam 2C's. I can live stream video/audio for all of them still. Downloading works for my wired doorbell and floodlights still.

I believe this could be related to 2 previous issues https://github.com/bropat/eufy-security-ws/issues/90 and https://github.com/bropat/eufy-security-ws/issues/101

To reproduce

After sending the download command for one of the eufyCam 2C's that doesn't download properly, I receive the following messages:

{ "type": "result", "success": true, "messageId": 1, "result": { "async": true } }

Followed by:

{ "type": "event", "event": { "source": "device", "event": "command result", "serialNumber": "[removed]", "command": "start_download", "returnCode": 0, "returnCodeName": "ERROR_PPCS_SUCCESSFUL", "customData": { "command": { "name": "deviceStartDownload", "value": { "path": "[removed]", "cipher_id": [removed] } } } } }

With no subsequent messages.

Screenshots & Logfiles

No response

Additional context

No response

bropat commented 1 year ago

Missing debug logs

ema-dev commented 1 year ago

@bropat I am currently on 1.3.3. I turned on debug mode and logging.

Here's the order of events:

  1. Sent -> device.start_download
  2. Received -> logging: request post - v1/app/cipher/get_ciphers
  3. Received -> logging: v1/app/cipher/get_ciphers response - succeed with data, cipher_id and key
  4. Received -> logging: Sending start download command to station [station_serialnumber] for device [device_serialnumber] with value: [filepath]
  5. Received -> logging: Sending p2p command...{ station: '[station_serialnumber]',\n sequence: 92,\n commandType: 1024,\n channel: 1,\n retries: 0,\n messageStatesSize: 1 }
  6. Received -> {"type": "result", "success": true, "messageId": 1, "result": { "async": true }}
  7. Received -> logging: Station [station_serialnumber] - ACK DATA - received from host [ip] for sequence 92
  8. Received -> logging: Station [station_serialnumber]- DATA DATA - received from host [ip]- Processing sequence 92...
  9. Received -> logging: Station [station_serialnumber]- Received data", { seqNo: 92,\n header: { commandId: 1024, bytesToRead: 132, channel: 1, signCode: 0, type: 1 },\n bytesRead: 132,\n bytesToRead: 132,\n firstPartMessage: true,\n messageSize: 148 }
  10. Received -> logging: "Station [station_serialnumber]- Received data","{ commandIdName: 'CMD_DOWNLOAD_VIDEO',\n commandId: 1024,\n resultCodeName: 'ERROR_PPCS_SUCCESSFUL',\n resultCode: 0,\n message:\n '\x009
  11. Received -> logging: Station [station_serialnumber]- Result data for command received",
  12. Received -> logging: Got p2p command response: ERROR_PPCS_SUCCESSFUL
  13. Received -> logging: Station [station_serialnumber]- DATA DATA - Received expected sequence (expectedSeqNo: 93 seqNo: 92 queuedData.size: 0)
  14. Received -> event - device command result - deviceStartDownload with path and cipher_id
  15. Received -> logging: Station [station_serialnumber]- DATA CONTROL - received from host [ip] - Processing sequence 4...
  16. Received -> logging: Station [station_serialnumber] - Received data - { seqNo: 4,\n header: { commandId: 1303, bytesToRead: 5, channel: 0, signCode: 0, type: 0 },\n bytesRead: 5,...
  17. Received -> logging: Station [station_serialnumber] - CMD_CONVERT_MP4_OK", "{ channel: 0, totalBytes: 2250199 }

Then it's just hundreds/thousands of log messages about the download, but there are no video/audio download events with the data.