homebridge-eufy-security / plugin

Homebridge plugin to control certain Eufy Security devices
Apache License 2.0
168 stars 23 forks source link

[Bug]: Since V2 the EUFY Floodlight Cam 2 2K WiFi Outdoor Security Camera causes Homebridge to crash #72

Closed gdotp01 closed 2 years ago

gdotp01 commented 2 years ago

What happened?

Since V2 the EUFY Floodlight Cam 2 2K WiFi Outdoor Security Camera causes Homebridge to crash when its enabled.

Device Type

Floodlight (Supported)

Plugin Version

v2.0.x (Supported)

HomeBridge Version

v1.4.x (Supported)

NodeJS Version

v14 (Supported)

Operating System

Raspbian 10+ (Supported)

Relevant log output

[6/11/2022, 9:56:44 PM] [EufySecurity-2.0.0] ERROR: Local livestream didn't start in time. Abort livestream request.
[6/11/2022, 9:56:44 PM] [EufySecurity-2.0.0] ERROR: Garden camera Unable to start the livestream: no started livestream found
[6/11/2022, 9:56:44 PM] [EufySecurity-2.0.0] INFO:  Garden camera Starting video stream: 640x480, 30 fps, 299 kbps  (AAC-eld)
[11/06/2022, 21:56:44] TypeError: ffmpegInput is not iterable
    at StreamingDelegate.startStream (/usr/local/lib/node_modules/homebridge-eufy-security/src/accessories/streamingDelegate.ts:676:20)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
[11/06/2022, 21:56:44] Got SIGTERM, shutting down Homebridge...
[11/06/2022, 21:56:44] [Harmony] INFO - shutdown
[6/11/2022, 9:56:44 PM] [EufySecurity-2.0.0] WARN:  Push Closed!
[6/11/2022, 9:56:44 PM] [EufySecurity-2.0.0] INFO:  Finished shutdown!
[11/06/2022, 21:56:48] [homebridge-eufy-security] This plugin slows down Homebridge. The write handler for the characteristic 'Selected RTP Stream Configuration' on the accessory 'Garden camera 2726' didn't respond at all!. Please check that you properly call the callback! See https://homebridge.io/w/JtMGR for more info.
[11/06/2022, 21:56:48] [homebridge-eufy-security] Error: 
    at Accessory.sendCharacteristicWarning (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1947:14)
    at Timeout._onTimeout (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1657:16)
    at listOnTimeout (node:internal/timers:559:17)
    at processTimers (node:internal/timers:502:7)
[11/06/2022, 21:56:49] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null
[11/06/2022, 21:56:54] [HB Supervisor] Restarting Homebridge...
[11/06/2022, 21:56:54] [HB Supervisor] Starting Homebridge with extra flags: -I -D -K
[11/06/2022, 21:56:54] [HB Supervisor] Started Homebridge v1.4.1 with PID: 29329
[11/06/2022, 21:56:55] Loaded config.json with 10 accessories and 13 platforms.
github-actions[bot] commented 2 years ago

Did you check this Common Issues pages ?

thieren commented 2 years ago

Hey @gdotp01

could you try the latest beta please? Does this resolve your issue?

Furthermore if not: please provide your json config and a debug log output with a few messages before the error.

jangeja commented 2 years ago

Im experiencing the same issue. Running on the latest beta.

        {
            "platform": "EufySecurity",
            "username": "REDACTED",
            "password": "REDACTED",
            "country": "US",
            "ignoreStations": [
                "IGNORE1"
            ],
            "ignoreDevices": [
                "IGNORE1"
            ],
            "cameras": [
                {
                    "serialNumber": "Txxxxx",
                    "enableCamera": true,
                    "enableButton": true,
                    "motionButton": true,
                    "rtsp": true,
                    "unbridge": true,
                    "forcerefreshsnap": false,
                    "useCachedLocalLivestream": false,
                    "useEnhancedSnapshotBehaviour": false,
                    "snapshotHandlingMethod": 3,
                    "immediateRingNotificationWithoutSnapshot": false,
                    "delayCameraSnapshot": false,
                    "videoConfig": {
                        "audio": true
                    }
                }
            ],
            "_bridge": {
                "username": "xxxx",
                "port": 42438
            }
        }
[6/15/2022, 4:23:17 PM] [homebridge-eufy-security] Error: 
    at Accessory.sendCharacteristicWarning (/homebridge/node_modules/.pnpm/hap-nodejs@0.10.2/node_modules/hap-nodejs/src/lib/Accessory.ts:1947:14)
    at Timeout._onTimeout (/homebridge/node_modules/.pnpm/hap-nodejs@0.10.2/node_modules/hap-nodejs/src/lib/Accessory.ts:1642:14)
    at listOnTimeout (node:internal/timers:559:17)
    at processTimers (node:internal/timers:502:7)
[6/15/2022, 4:23:23 PM] [homebridge-eufy-security] This plugin slows down Homebridge. The write handler for the characteristic 'Selected RTP Stream Configuration' on the accessory 'Walkway 6CDA' didn't respond at all!. Please check that you properly call the callback! See https://homebridge.io/w/JtMGR for more info.
[6/15/2022, 4:23:23 PM] [homebridge-eufy-security] Error: 
    at Accessory.sendCharacteristicWarning (/homebridge/node_modules/.pnpm/hap-nodejs@0.10.2/node_modules/hap-nodejs/src/lib/Accessory.ts:1947:14)
    at Timeout._onTimeout (/homebridge/node_modules/.pnpm/hap-nodejs@0.10.2/node_modules/hap-nodejs/src/lib/Accessory.ts:1657:16)
    at listOnTimeout (node:internal/timers:559:17)
    at processTimers (node:internal/timers:502:7)
[6/15/2022, 4:23:24 PM] [EufySecurity-2.0.1-beta.17] ERROR: Walkway Local livestream didn't start in time. Abort livestream request.
[6/15/2022, 4:23:24 PM] [EufySecurity-2.0.1-beta.17] ERROR: Walkway Unable to start the livestream: no started livestream found
[6/15/2022, 4:23:24 PM] [EufySecurity-2.0.1-beta.17] INFO:  Walkway Starting video stream: 1280x720, 30 fps, 299 kbps  (AAC-eld)
TypeError: Cannot read properties of undefined (reading 'url')
    at StreamingDelegate.startStream (/homebridge/node_modules/.pnpm/homebridge-eufy-security@2.0.1-beta.17/node_modules/homebridge-eufy-security/src/accessories/streamingDelegate.ts:772:61)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
[6/15/2022, 4:23:24 PM] [homebridge-eufy-security] Child bridge process ended
[6/15/2022, 4:23:24 PM] [homebridge-eufy-security] Process Ended. Code: 1, Signal: null

With RTSP disabled for the floodlight

[6/15/2022, 4:37:27 PM] [homebridge-eufy-security] Error: 
    at Accessory.sendCharacteristicWarning (/homebridge/node_modules/.pnpm/hap-nodejs@0.10.2/node_modules/hap-nodejs/src/lib/Accessory.ts:1947:14)
    at Timeout._onTimeout (/homebridge/node_modules/.pnpm/hap-nodejs@0.10.2/node_modules/hap-nodejs/src/lib/Accessory.ts:1642:14)
    at listOnTimeout (node:internal/timers:559:17)
    at processTimers (node:internal/timers:502:7)
[6/15/2022, 4:37:33 PM] [homebridge-eufy-security] This plugin slows down Homebridge. The write handler for the characteristic 'Selected RTP Stream Configuration' on the accessory 'Walkway 6CDA' didn't respond at all!. Please check that you properly call the callback! See https://homebridge.io/w/JtMGR for more info.
[6/15/2022, 4:37:33 PM] [homebridge-eufy-security] Error: 
    at Accessory.sendCharacteristicWarning (/homebridge/node_modules/.pnpm/hap-nodejs@0.10.2/node_modules/hap-nodejs/src/lib/Accessory.ts:1947:14)
    at Timeout._onTimeout (/homebridge/node_modules/.pnpm/hap-nodejs@0.10.2/node_modules/hap-nodejs/src/lib/Accessory.ts:1657:16)
    at listOnTimeout (node:internal/timers:559:17)
    at processTimers (node:internal/timers:502:7)
[6/15/2022, 4:37:34 PM] [EufySecurity-2.0.1-beta.17] ERROR: Walkway Local livestream didn't start in time. Abort livestream request.
[6/15/2022, 4:37:34 PM] [EufySecurity-2.0.1-beta.17] ERROR: Walkway Unable to start the livestream: no started livestream found
[6/15/2022, 4:37:34 PM] [EufySecurity-2.0.1-beta.17] INFO:  Walkway Starting video stream: 1280x720, 30 fps, 299 kbps  (AAC-eld)
TypeError: Cannot read properties of undefined (reading 'url')
    at StreamingDelegate.startStream (/homebridge/node_modules/.pnpm/homebridge-eufy-security@2.0.1-beta.17/node_modules/homebridge-eufy-security/src/accessories/streamingDelegate.ts:772:61)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
[6/15/2022, 4:37:34 PM] [homebridge-eufy-security] Child bridge process ended
[6/15/2022, 4:37:34 PM] [homebridge-eufy-security] Process Ended. Code: 1, Signal: null
thieren commented 2 years ago

Hey @jangeja94

Thx for participating and for your feedback.

Can you enable debug log output? It's in the advanced settings in the config UI. And please include at least the messages from the stream start request. Thank you.

jangeja commented 2 years ago

Hey @thieren I enabled it. I'm also still seeing this log when the eufy-security plugin restarts, which is odd because the camera is already added in homekit.

[6/15/2022, 7:14:36 PM] Please add [Walkway 6CDA] manually in Home app. Setup Code: 184-44-208

Here are the debug logs with rtsp disabled.

6/15/2022, 7:16:35 PM] [EufySecurity-2.0.1-beta.17] DEBUG: Walkway SET DeviceEnabled: true
[6/15/2022, 7:16:35 PM] [EufySecurity-2.0.1-beta.17] DEBUG: Walkway SET HomeKitCameraActive: 1
[6/15/2022, 7:16:35 PM] [EufySecurity-2.0.1-beta.17] DEBUG: Walkway Property Changes: enabled true
[6/15/2022, 7:16:44 PM] [EufySecurity-2.0.1-beta.17] DEBUG: Walkway GET DeviceMotionDetected: false
[6/15/2022, 7:16:44 PM] [EufySecurity-2.0.1-beta.17] DEBUG: Walkway GET DeviceEnabled: true
[6/15/2022, 7:16:44 PM] [EufySecurity-2.0.1-beta.17] DEBUG: Walkway GET DeviceMotionDetection: undefined
[6/15/2022, 7:16:44 PM] [EufySecurity-2.0.1-beta.17] DEBUG: Walkway GET DeviceLight: false
[6/15/2022, 7:16:44 PM] [homebridge-eufy-security] This plugin generated a warning from the characteristic 'On': characteristic value expected boolean and received undefined. See https://homebridge.io/w/JtMGR for more info.
[6/15/2022, 7:16:44 PM] [homebridge-eufy-security] Error: 
    at On.Characteristic.characteristicWarning (/homebridge/node_modules/.pnpm/hap-nodejs@0.10.2/node_modules/hap-nodejs/src/lib/Characteristic.ts:2142:105)
    at On.Characteristic.validateUserInput (/homebridge/node_modules/.pnpm/hap-nodejs@0.10.2/node_modules/hap-nodejs/src/lib/Characteristic.ts:2014:12)
    at On.<anonymous> (/homebridge/node_modules/.pnpm/hap-nodejs@0.10.2/node_modules/hap-nodejs/src/lib/Characteristic.ts:1534:24)
    at step (/homebridge/node_modules/.pnpm/tslib@2.4.0/node_modules/tslib/tslib.js:144:27)
    at Object.next (/homebridge/node_modules/.pnpm/tslib@2.4.0/node_modules/tslib/tslib.js:125:57)
    at fulfilled (/homebridge/node_modules/.pnpm/tslib@2.4.0/node_modules/tslib/tslib.js:115:62)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
[6/15/2022, 7:16:44 PM] [EufySecurity-2.0.1-beta.17] DEBUG: Walkway GET StationCurrentMode: 0
[6/15/2022, 7:16:44 PM] [EufySecurity-2.0.1-beta.17] DEBUG: Walkway GET StationCurrentMode: 0
[6/15/2022, 7:16:48 PM] [EufySecurity-2.0.1-beta.17] DEBUG: Walkway GET EventSnapshotsActive: 0
[6/15/2022, 7:16:48 PM] [EufySecurity-2.0.1-beta.17] DEBUG: Walkway GET HomeKitCameraActive: 0
[6/15/2022, 7:16:48 PM] [EufySecurity-2.0.1-beta.17] DEBUG: Walkway GET DeviceEnabled: true
[6/15/2022, 7:16:48 PM] [EufySecurity-2.0.1-beta.17] DEBUG: Walkway GET DeviceStatusLed: true
[6/15/2022, 7:16:48 PM] [EufySecurity-2.0.1-beta.17] DEBUG: Walkway GET DeviceMotionDetected: false
[6/15/2022, 7:16:48 PM] [EufySecurity-2.0.1-beta.17] DEBUG: Walkway GET DeviceEnabled: true
[6/15/2022, 7:16:48 PM] [EufySecurity-2.0.1-beta.17] DEBUG: Walkway GET DeviceMotionDetection: undefined
[6/15/2022, 7:16:48 PM] [EufySecurity-2.0.1-beta.17] DEBUG: Walkway GET DeviceLight: false
[6/15/2022, 7:16:48 PM] [homebridge-eufy-security] This plugin generated a warning from the characteristic 'On': characteristic value expected boolean and received undefined. See https://homebridge.io/w/JtMGR for more info.
[6/15/2022, 7:16:48 PM] [homebridge-eufy-security] Error: 
    at On.Characteristic.characteristicWarning (/homebridge/node_modules/.pnpm/hap-nodejs@0.10.2/node_modules/hap-nodejs/src/lib/Characteristic.ts:2142:105)
    at On.Characteristic.validateUserInput (/homebridge/node_modules/.pnpm/hap-nodejs@0.10.2/node_modules/hap-nodejs/src/lib/Characteristic.ts:2014:12)
    at On.<anonymous> (/homebridge/node_modules/.pnpm/hap-nodejs@0.10.2/node_modules/hap-nodejs/src/lib/Characteristic.ts:1534:24)
    at step (/homebridge/node_modules/.pnpm/tslib@2.4.0/node_modules/tslib/tslib.js:144:27)
    at Object.next (/homebridge/node_modules/.pnpm/tslib@2.4.0/node_modules/tslib/tslib.js:125:57)
    at fulfilled (/homebridge/node_modules/.pnpm/tslib@2.4.0/node_modules/tslib/tslib.js:115:62)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
[6/15/2022, 7:16:48 PM] [EufySecurity-2.0.1-beta.17] DEBUG: Walkway RTSP rtspStream:false
[6/15/2022, 7:16:48 PM] [EufySecurity-2.0.1-beta.17] DEBUG: Walkway Looks like not compatible with RTSP
[6/15/2022, 7:16:48 PM] [EufySecurity-2.0.1-beta.17] DEBUG: Walkway New instance requests livestream. There were 0 instance(s) using the livestream until now.
[6/15/2022, 7:16:48 PM] [EufySecurity-2.0.1-beta.17] DEBUG: Walkway Start new station livestream (P2P Session)...
[6/15/2022, 7:16:51 PM] [homebridge-eufy-security] Error: 
    at Accessory.sendCharacteristicWarning (/homebridge/node_modules/.pnpm/hap-nodejs@0.10.2/node_modules/hap-nodejs/src/lib/Accessory.ts:1947:14)
    at Timeout._onTimeout (/homebridge/node_modules/.pnpm/hap-nodejs@0.10.2/node_modules/hap-nodejs/src/lib/Accessory.ts:1642:14)
    at listOnTimeout (node:internal/timers:559:17)
    at processTimers (node:internal/timers:502:7)
[6/15/2022, 7:16:55 PM] [EufySecurity-2.0.1-beta.17] DEBUG: Walkway Receive Apple HK Stop request{"sessionID":"19f691b7-7548-4bdd-ab43-1ac25a2eac00","type":"stop"}
[6/15/2022, 7:16:55 PM] [EufySecurity-2.0.1-beta.17] DEBUG: Stopping session with id: 19f691b7-7548-4bdd-ab43-1ac25a2eac00
[6/15/2022, 7:16:55 PM] [EufySecurity-2.0.1-beta.17] DEBUG: No session to stop.
[6/15/2022, 7:16:57 PM] [homebridge-eufy-security] This plugin slows down Homebridge. The write handler for the characteristic 'Selected RTP Stream Configuration' on the accessory 'Walkway 6CDA' didn't respond at all!. Please check that you properly call the callback! See https://homebridge.io/w/JtMGR for more info.
[6/15/2022, 7:16:57 PM] [homebridge-eufy-security] Error: 
    at Accessory.sendCharacteristicWarning (/homebridge/node_modules/.pnpm/hap-nodejs@0.10.2/node_modules/hap-nodejs/src/lib/Accessory.ts:1947:14)
    at Timeout._onTimeout (/homebridge/node_modules/.pnpm/hap-nodejs@0.10.2/node_modules/hap-nodejs/src/lib/Accessory.ts:1657:16)
    at listOnTimeout (node:internal/timers:559:17)
    at processTimers (node:internal/timers:502:7)
[6/15/2022, 7:16:58 PM] [EufySecurity-2.0.1-beta.17] ERROR: Walkway Local livestream didn't start in time. Abort livestream request.
[6/15/2022, 7:16:58 PM] [EufySecurity-2.0.1-beta.17] ERROR: Walkway Unable to start the livestream: no started livestream found
[6/15/2022, 7:16:58 PM] [EufySecurity-2.0.1-beta.17] DEBUG: Walkway VIDEOCONFIG: {"audio":true,"vcodec":"libx264","acodec":"libfdk_aac","encoderOptions":"-preset ultrafast -tune zerolatency","packetSize":1128,"forceMax":false}
[6/15/2022, 7:16:58 PM] [EufySecurity-2.0.1-beta.17] INFO:  Walkway Starting video stream: 1280x720, 30 fps, 299 kbps  (AAC-eld)
TypeError: Cannot read properties of undefined (reading 'url')
    at StreamingDelegate.startStream (/homebridge/node_modules/.pnpm/homebridge-eufy-security@2.0.1-beta.17/node_modules/homebridge-eufy-security/src/accessories/streamingDelegate.ts:772:61)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
jangeja commented 2 years ago

Hmm Shouldnt the camera config use the rtspStream property rather than rtsp ?

these lines be using the rtsp property as thats whats in the CameraConfig?

Havent read too much into the source code so I probably dont know what im talking about :)

thieren commented 2 years ago

Hmm Shouldnt the camera config use the rtspStream property rather than rtsp ?

these lines be using the rtsp property as thats whats in the CameraConfig?

Havent read too much into the source code so I probably dont know what im talking about :)

Yeah. I too am not entirely satisfied with the way the rtsp setting is working right now. But internally it makes sense: you'll have to look at the whole method First it's looked at if the device has rtsp capabilities at all. After that if the user has enabled it in the plugin. Then if it is enabled in the eufy app and finally if the plugin can get the rtsp url.

All these have to be fulfilled so that rtsp can work. But as you were right noticing the way it is done now the user thinks rtsp will be used when he just sets it to enabled in the plugin config.

I think that will be handled differently in the future.

As for your case: the rtsp setting does nothing for you, since the plugin determines that the device doesn't have the capabilities. You can see that this property is not included here (I believe the T8424 model is correct here)

If that is true, or if it is an error I can't say since I don't own that device.

However since this can't be used the plugin tries to fallback to the standard local livestream, which unfortunately also fails.

Why this is remains to be investigated. I'll come back to you on this one.

thieren commented 2 years ago

So after investigating a little further, here's what I found:

I'll implement it so that the rtmp/cloud stream will be used as fallback, if rtsp is not supported by the device.

As for the fail on p2p local live-streaming:

If it's possible for you I'd recommend you try a tool of mine here with this you are able to manually start/stop a p2p stream and also a cloud stream. You can see in the logs if this succeeded. If you could sent me the log from the tool (main menu choice 5) and the log of the underlying eufy-security-client (main menu choice 6) after you've started a p2p stream, I could try to figure out where the error is caused.

If you have any questions regarding this I'd recommend you write to me on discord or open an issue at the page of the tool (since this is out-of-scope of this plugin).

jangeja commented 2 years ago

Tried that tool and selected walkway Light and its just hanging

Start p2p livestream on Walkway... 
thieren commented 2 years ago

Yeah. Not much documentation. Just hit enter and it will go back to the devices menu. The stream will send data in the background. There will no window open up with the stream itself or something.

thieren commented 2 years ago

Did some research today and tried implementing the cloud streaming as fallback option. Unfortunately this stream option seems to be really unreliable. I got at best a 50 percent chance to start the stream. Guess there was a reason to ditch this method from the plugin in the first place.

I'd like to concentrate on why the p2p local stream is not working for you. So if you could try again with the tool, this would help (added some short instructions on the readme page).

jangeja commented 2 years ago

Heres the relevant logs for the camera when I tried to initiate p2p. I see multiple station connects/disconnects for the other 2 cameras that I have in my account without me even initiating the p2p connections via the cli, so im not sure how those are getting in there. I filtered these out by grepping for the serial of the camera in question (flood light) I also redacted some info. Plopped the hex codes in an asci converter with no luck on those hex messages. Not really sure what this all means. Also looks like the p2p was successful ? Judging from the success code returned.

2022-06-16T19:52:16.143Z - DEBUG: Stations - element: {"station_id":1108659956,"station_sn":"T8420T6021280472","station_name":"Walkway","station_model":"T8420X","time_zone":"PST8PDT,M3.2.0,M11.1.0|1.1139","wifi_ssid":"","ip_addr":"192.168.1.26","wifi_mac":"xxxx","main_sw_version":"2.0.4.8","main_hw_version":"P1","sec_sw_version":"2.0.4.8","sec_hw_version":"P1","volume":"Anker_Security","bt_mac":"xxxx","device_type":3,"event_num":0,"sku_number":"","lot_number":"","cpuid":"","create_time":1632308601,"update_time":1655345518,"status":1,"station_status":0,"status_change_time":0,"p2p_did":"USPRAMA-146641-EDDCY","push_did":"USPRAMA-146641-EDDCY","p2p_license":"AFEYJC","push_license":"","ndt_did":"USPRAMA-146641-EDDCY","ndt_license":"","wakeup_flag":3,"p2p_conn":"xxxx","app_conn":"xxx","wipn_enc_dec_key":"","wipn_ndt_aes128key":"","query_server_did":"","prefix":"USPRAMA","wakeup_key":"xxxxx","member":{"family_id":0,"station_sn":"T8420T6021280472","admin_user_id":"xxxx","member_user_id":"xxxx","short_user_id":"0000","member_type":2,"permissions":0,"member_nick":"","action_user_id":"","fence_state":0,"extra":"","member_avatar":"","house_id":"","create_time":1655148285,"update_time":0,"status":0,"email":"","nick_name":"","avatar":"","action_user_email":"xxxx","action_user_name":"xxxx"},"params":[{"param_id":0,"station_sn":"T8420T6021280472","param_type":1224,"param_value":"0","create_time":1655148291,"update_time":1655345480,"status":1},{"param_id":1195096067,"station_sn":"T8420T6021280472","param_type":1135,"param_value":"0","create_time":1655148286,"update_time":1655345480,"status":1},{"param_id":1195096070,"station_sn":"T8420T6021280472","param_type":1253,"param_value":"0","create_time":1655148286,"update_time":1655148286,"status":1},{"param_id":0,"station_sn":"T8420T6021280472","param_type":1140,"param_value":"1","create_time":1655345490,"update_time":0,"status":1}],"devices":[{"device_id":1113987851,"is_init_complete":false,"device_sn":"T8420T6021280472","device_name":"Walkway","device_model":"T8420X","time_zone":"PST8PDT,M3.2.0,M11.1.0","device_type":3,"device_channel":0,"station_sn":"T8420T6021280472","schedule":"","schedulex":"","wifi_mac":"xxxx","main_sw_version":"2.0.4.8","main_hw_version":"P1","sec_sw_version":"2.0.4.8","sec_hw_version":"P1","sector_id":0,"event_num":0,"wifi_ssid":"Hangry","ip_addr":"192.168.1.26","volume":"Anker_Security","bind_time":1655148285,"bt_mac":"xxxx","local_ip":"","language":"en-US","sku_number":"","lot_number":"","cpuid":"","create_time":1632308601,"update_time":1655345518,"status":1}],"sensor_info":null,"is_init_complete":false,"virtual_version":"","house_id":"xxxx"} 
2022-06-16T19:52:17.155Z - DEBUG: Normalized Properties {"stationSN":"T8420T6021280472","properties":{"name":"Walkway","model":"T8420X","serialNumber":"T8420T6021280472","type":3,"hardwareVersion":"P1","softwareVersion":"2.0.4.8","lanIpAddress":"192.168.1.26","macAddress":"xxxx","timeFormat":0,"guardMode":0}} 
2022-06-16T19:52:17.592Z - DEBUG: Normalized Properties {"deviceSN":"T8420T6021280472","properties":{"motionDetected":false,"personDetected":false,"personName":"","name":"Walkway","model":"T8420X","serialNumber":"T8420T6021280472","type":3,"hardwareVersion":"P1","softwareVersion":"2.0.4.8","stationSerialNumber":"T8420T6021280472","recordingClipLength":60,"recordingRetriggerInterval":0,"recordingEndClipMotionStops":true,"lightSettingsBrightnessSchedule":100,"microphone":true,"lightSettingsBrightnessManual":100,"autoNightvision":true,"speaker":true,"light":false,"speakerVolume":80,"lightSettingsBrightnessMotion":100,"lightSettingsMotionTriggeredTimer":30,"lightSettingsMotionTriggered":true,"lightSettingsEnable":true,"statusLed":true}} 
2022-06-16T19:52:17.596Z - DEBUG: Connecting to station T8420T6021280472... {"p2pConnectionType":"QUICKEST"} 
2022-06-16T19:52:17.596Z - DEBUG: Station T8420T6021280472 DSK keys not present or expired, get/renew it {"dskKey":"","dskExpiration":null} 
2022-06-16T19:52:17.596Z - DEBUG: Request: {"method":"post","endpoint":"v1/app/equipment/get_dsk_keys","token":"xxxx","data":{"invalid_dsks":{"T8420T6021280472":""},"station_sns":["T8420T6021280472"],"transaction":"1655409137596"}} 
2022-06-16T19:52:17.973Z - DEBUG: Response: {"response":{"code":0,"msg":"Succeed.","data":{"enabled":true,"dsk_keys":[{"station_sn":"T8420T6021280472","dsk_key":"xxxxx","expiration":1655410937,"about_to_be_replaced":true}]}}} 
2022-06-16T19:52:17.973Z - DEBUG: Station T8420T6021280472 - Response: {"code":0,"msg":"Succeed.","data":{"enabled":true,"dsk_keys":[{"station_sn":"T8420T6021280472","dsk_key":"xxxxx","expiration":1655410937,"about_to_be_replaced":true}]}} 
2022-06-16T19:52:18.009Z - DEBUG: Station T8420T6021280472 - LOOKUP_RESP - Got response {"remoteAddress":"54.153.101.7","remotePort":32100,"response":{"responseCode":253}} 
2022-06-16T19:52:18.010Z - DEBUG: Station T8420T6021280472 - LOOKUP_ADDR2 - Got response {"remoteAddress":"204.236.133.68","remotePort":32100,"response":{"ip":"44.196.45.200","port":10000,"data":"12faed27"}} 
2022-06-16T19:52:18.010Z - DEBUG: Station T8420T6021280472 - CHECK_CAM2 - Connecting to host 44.196.45.200 on port 10000... 
2022-06-16T19:52:18.011Z - DEBUG: Station T8420T6021280472 - LOOKUP_RESP - Got response {"remoteAddress":"204.236.133.68","remotePort":32100,"response":{"responseCode":0}} 
2022-06-16T19:52:18.011Z - DEBUG: Station T8420T6021280472 - LOOKUP_ADDR - Got response {"remoteAddress":"204.236.133.68","remotePort":32100,"response":{"ip":"67.181.28.153","port":11941}} 
2022-06-16T19:52:18.011Z - DEBUG: Station T8420T6021280472 - QUICKEST - Try to connect to 67.181.28.153:11941... 
2022-06-16T19:52:18.012Z - DEBUG: Station T8420T6021280472 - CHECK_CAM - Connecting to host 67.181.28.153 on port 11941... 
2022-06-16T19:52:18.012Z - DEBUG: Station T8420T6021280472 - LOOKUP_ADDR - Got response {"remoteAddress":"204.236.133.68","remotePort":32100,"response":{"ip":"192.168.1.26","port":11941}} 
2022-06-16T19:52:18.012Z - DEBUG: Station T8420T6021280472 - QUICKEST - Try to connect to 192.168.1.26:11941... 
2022-06-16T19:52:18.012Z - DEBUG: Station T8420T6021280472 - CHECK_CAM - Connecting to host 192.168.1.26 on port 11941... 
2022-06-16T19:52:18.013Z - DEBUG: Station T8420T6021280472 - received unknown message {"remoteAddress":"204.236.133.68","remotePort":32100,"response":{"message":"f16900840800000000021027c82dc42c000000000000000000021027c82dc42c000000000000000000021027c82dc42c000000000000000000021027c82dc42c000000000000000000021027c82dc42c000000000000000000021027c82dc42c000000000000000000021027c82dc42c000000000000000000021027c82dc42c0000000000000000","length":136}} 
2022-06-16T19:52:18.019Z - DEBUG: Station T8420T6021280472 - CAM_ID - Connected to station T8420T6021280472 on host 192.168.1.26 port 11941 
2022-06-16T19:52:18.019Z - INFO: Connected to station T8420T6021280472 on host 192.168.1.26 and port 11941 
2022-06-16T19:52:18.019Z - DEBUG: Sending get camera infos command to station T8420T6021280472 
2022-06-16T19:52:18.019Z - DEBUG: Sending p2p command... {"station":"T8420T6021280472","sequence":0,"commandType":1103,"channel":255,"retries":0,"messageStatesSize":1} 
2022-06-16T19:52:18.029Z - DEBUG: Station T8420T6021280472 - CAM_ID - Already connected, ignoring... 
2022-06-16T19:52:18.038Z - DEBUG: Station T8420T6021280472 - CAM_ID - Already connected, ignoring... 
2022-06-16T19:52:18.054Z - DEBUG: Station T8420T6021280472 - CAM_ID - Already connected, ignoring... 
2022-06-16T19:52:18.073Z - DEBUG: Station T8420T6021280472 - received unknown message {"remoteAddress":"54.167.31.60","remotePort":32100,"response":{"message":"f16900840800000000021027c82dc42c000000000000000000021027c82dc42c000000000000000000021027c82dc42c000000000000000000021027c82dc42c000000000000000000021027c82dc42c000000000000000000021027c82dc42c000000000000000000021027c82dc42c000000000000000000021027c82dc42c0000000000000000","length":136}} 
2022-06-16T19:52:18.073Z - DEBUG: Station T8420T6021280472 - LOOKUP_ADDR - Got response {"remoteAddress":"54.167.31.60","remotePort":32100,"response":{"ip":"67.181.28.153","port":11941}} 
2022-06-16T19:52:18.073Z - DEBUG: Station T8420T6021280472 - LOOKUP_ADDR - Got response {"remoteAddress":"54.167.31.60","remotePort":32100,"response":{"ip":"192.168.1.26","port":11941}} 
2022-06-16T19:52:18.073Z - DEBUG: Station T8420T6021280472 - received unknown message {"remoteAddress":"3.131.209.36","remotePort":32100,"response":{"message":"f16900840800000000021027c82dc42c000000000000000000021027c82dc42c000000000000000000021027c82dc42c000000000000000000021027c82dc42c000000000000000000021027c82dc42c000000000000000000021027c82dc42c000000000000000000021027c82dc42c000000000000000000021027c82dc42c0000000000000000","length":136}} 
2022-06-16T19:52:18.102Z - DEBUG: Station T8420T6021280472 - LOOKUP_ADDR - Got response {"remoteAddress":"3.131.209.36","remotePort":32100,"response":{"ip":"67.181.28.153","port":11941}} 
2022-06-16T19:52:18.102Z - DEBUG: Station T8420T6021280472 - LOOKUP_ADDR - Got response {"remoteAddress":"3.131.209.36","remotePort":32100,"response":{"ip":"192.168.1.26","port":11941}} 
2022-06-16T19:52:18.142Z - DEBUG: Station T8420T6021280472 - DATA DATA - received from host 192.168.1.26:11941 - Processing sequence 0... 
2022-06-16T19:52:18.143Z - DEBUG: Station T8420T6021280472 - Received data {"seqNo":0,"header":{"commandId":1103,"bytesToRead":132,"channel":255,"signCode":0,"type":1},"bytesRead":132,"bytesToRead":132,"firstPartMessage":true,"messageSize":148} 
2022-06-16T19:52:18.145Z - DEBUG: Station T8420T6021280472 - Received data {"commandIdName":"CMD_CAMERA_INFO","commandId":1103,"resultCodeName":"ERROR_PPCS_SUCCESSFUL","resultCode":0,"message":"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000","data":"000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"} 
2022-06-16T19:52:18.146Z - DEBUG: Station T8420T6021280472 - Result data for command received {"messageState":{"sequence":0,"commandType":1103,"channel":255,"data":{"type":"Buffer","data":[209,0,0,0,88,90,89,72,79,4,4,0,0,0,1,0,255,0,0,0,255,0,0,0]},"retries":0,"acknowledged":false,"returnCode":-133,"timeout":{"_idleTimeout":-1,"_idlePrev":null,"_idleNext":null,"_idleStart":6625,"_onTimeout":null,"_repeat":null,"_destroyed":true}},"resultCodeName":"ERROR_PPCS_SUCCESSFUL","resultCode":0} 
2022-06-16T19:52:18.146Z - DEBUG: Got p2p command response {"station":"T8420T6021280472","commandType":1103,"channel":255,"returnCodeName":"ERROR_PPCS_SUCCESSFUL","returnCode":0} 
2022-06-16T19:52:18.149Z - DEBUG: Station T8420T6021280472 - DATA DATA - Received expected sequence (seqNo: 0 queuedData.size: 0) 
2022-06-16T19:52:18.150Z - DEBUG: Station T8420T6021280472 - ACK DATA - received from host 192.168.1.26:11941 for sequence 0 
2022-06-16T19:52:18.150Z - DEBUG: Station T8420T6021280472 - DATA CONTROL - received from host 192.168.1.26:11941 - Processing sequence 0... 
2022-06-16T19:52:18.150Z - DEBUG: Station T8420T6021280472 - Received data {"seqNo":0,"header":{"commandId":1103,"bytesToRead":480,"channel":0,"signCode":0,"type":0},"bytesRead":480,"bytesToRead":480,"firstPartMessage":true,"messageSize":496} 
2022-06-16T19:52:18.152Z - DEBUG: Station T8420T6021280472 - Camera info {"cameraInfo":"{\"params\":[{\"dev_type\":0,\"param_type\":1400,\"param_value\":\"0\"},{\"dev_type\":0,\"param_type\":1403,\"param_value\":\"1\"},{\"dev_type\":0,\"param_type\":1408,\"param_value\":\"1\"},{\"dev_type\":0,\"param_type\":1414,\"param_value\":\"0\"},{\"dev_type\":0,\"param_type\":1412,\"param_value\":\"100\"},{\"dev_type\":0,\"param_type\":1401,\"param_value\":\"100\"},{\"dev_type\":0,\"param_type\":1413,\"param_value\":\"100\"},{\"dev_type\":0,\"param_type\":1409,\"param_value\":\"30\"},{\"dev_type\":255,\"param_type\":1151,\"param_value\":\"0\"}]}"} 
2022-06-16T19:52:18.153Z - DEBUG: Got camera infos {"station":"T8420T6021280472","cameraInfo":{"params":[{"dev_type":0,"param_type":1400,"param_value":"0"},{"dev_type":0,"param_type":1403,"param_value":"1"},{"dev_type":0,"param_type":1408,"param_value":"1"},{"dev_type":0,"param_type":1414,"param_value":"0"},{"dev_type":0,"param_type":1412,"param_value":"100"},{"dev_type":0,"param_type":1401,"param_value":"100"},{"dev_type":0,"param_type":1413,"param_value":"100"},{"dev_type":0,"param_type":1409,"param_value":"30"},{"dev_type":255,"param_type":1151,"param_value":"0"}]}} 
2022-06-16T19:52:18.156Z - DEBUG: Station T8420T6021280472 - DATA CONTROL - Received expected sequence (seqNo: 0 queuedData.size: 0) 
2022-06-16T19:52:19.211Z - DEBUG: Station T8420T6021280472 - LOOKUP_ADDR - Got response {"remoteAddress":"204.236.133.68","remotePort":32100,"response":{"ip":"67.181.28.153","port":14113}} 
2022-06-16T19:52:19.211Z - DEBUG: Station T8420T6021280472 - LOOKUP_ADDR - Got response {"remoteAddress":"204.236.133.68","remotePort":32100,"response":{"ip":"192.168.1.26","port":14113}} 
2022-06-16T19:52:19.211Z - DEBUG: Station T8420T6021280472 - received unknown message {"remoteAddress":"192.168.1.26","remotePort":14113,"response":{"message":"f141001455535052414d410000023cd14544444359000000","length":24}} 
2022-06-16T19:52:19.211Z - DEBUG: Station T8420T6021280472 - received unknown message {"remoteAddress":"192.168.1.26","remotePort":14113,"response":{"message":"f141001455535052414d410000023cd14544444359000000","length":24}} 
2022-06-16T19:52:19.211Z - DEBUG: Station T8420T6021280472 - received unknown message {"remoteAddress":"192.168.1.26","remotePort":14113,"response":{"message":"f141001455535052414d410000023cd14544444359000000","length":24}} 
2022-06-16T19:52:19.211Z - DEBUG: Station T8420T6021280472 - received unknown message {"remoteAddress":"192.168.1.26","remotePort":14113,"response":{"message":"f141001455535052414d410000023cd14544444359000000","length":24}} 
2022-06-16T19:52:19.211Z - DEBUG: Station T8420T6021280472 - LOOKUP_ADDR - Got response {"remoteAddress":"54.167.31.60","remotePort":32100,"response":{"ip":"67.181.28.153","port":14113}} 
2022-06-16T19:52:19.211Z - DEBUG: Station T8420T6021280472 - LOOKUP_ADDR - Got response {"remoteAddress":"54.167.31.60","remotePort":32100,"response":{"ip":"192.168.1.26","port":14113}} 
2022-06-16T19:52:19.211Z - DEBUG: Station T8420T6021280472 - received unknown message {"remoteAddress":"192.168.1.26","remotePort":14113,"response":{"message":"f141001455535052414d410000023cd14544444359000000","length":24}} 
2022-06-16T19:52:19.212Z - DEBUG: Station T8420T6021280472 - LOOKUP_ADDR - Got response {"remoteAddress":"3.131.209.36","remotePort":32100,"response":{"ip":"67.181.28.153","port":14113}} 
2022-06-16T19:52:19.212Z - DEBUG: Station T8420T6021280472 - LOOKUP_ADDR - Got response {"remoteAddress":"3.131.209.36","remotePort":32100,"response":{"ip":"192.168.1.26","port":14113}} 
2022-06-16T19:52:19.212Z - DEBUG: Station T8420T6021280472 - received unknown message {"remoteAddress":"192.168.1.26","remotePort":14113,"response":{"message":"f141001455535052414d410000023cd14544444359000000","length":24}} 
2022-06-16T19:52:19.212Z - DEBUG: Station T8420T6021280472 - received unknown message {"remoteAddress":"192.168.1.26","remotePort":14113,"response":{"message":"f141001455535052414d410000023cd14544444359000000","length":24}} 
2022-06-16T19:52:19.212Z - DEBUG: Station T8420T6021280472 - received unknown message {"remoteAddress":"192.168.1.26","remotePort":14113,"response":{"message":"f141001455535052414d410000023cd14544444359000000","length":24}} 
2022-06-16T19:52:19.212Z - DEBUG: Station T8420T6021280472 - received unknown message {"remoteAddress":"192.168.1.26","remotePort":14113,"response":{"message":"f141001455535052414d410000023cd14544444359000000","length":24}} 
2022-06-16T19:52:19.213Z - DEBUG: Station T8420T6021280472 - received unknown message {"remoteAddress":"192.168.1.26","remotePort":14113,"response":{"message":"f141001455535052414d410000023cd14544444359000000","length":24}} 
2022-06-16T19:52:19.213Z - DEBUG: Station T8420T6021280472 - received unknown message {"remoteAddress":"192.168.1.26","remotePort":14113,"response":{"message":"f141001455535052414d410000023cd14544444359000000","length":24}} 
2022-06-16T19:52:19.213Z - DEBUG: Station T8420T6021280472 - received unknown message {"remoteAddress":"192.168.1.26","remotePort":14113,"response":{"message":"f141001455535052414d410000023cd14544444359000000","length":24}} 
2022-06-16T19:52:23.241Z - DEBUG: Stations - element: {"station_id":1108659956,"station_sn":"T8420T6021280472","station_name":"Walkway","station_model":"T8420X","time_zone":"PST8PDT,M3.2.0,M11.1.0|1.1139","wifi_ssid":"","ip_addr":"192.168.1.26","wifi_mac":"xxxx","main_sw_version":"2.0.4.8","main_hw_version":"P1","sec_sw_version":"2.0.4.8","sec_hw_version":"P1","volume":"Anker_Security","bt_mac":"xxxx","device_type":3,"event_num":0,"sku_number":"","lot_number":"","cpuid":"","create_time":1632308601,"update_time":1655345518,"status":1,"station_status":0,"status_change_time":0,"p2p_did":"USPRAMA-146641-EDDCY","push_did":"USPRAMA-146641-EDDCY","p2p_license":"AFEYJC","push_license":"","ndt_did":"USPRAMA-146641-EDDCY","ndt_license":"","wakeup_flag":3,"p2p_conn":"xxxx","app_conn":"xxxx","wipn_enc_dec_key":"","wipn_ndt_aes128key":"","query_server_did":"","prefix":"USPRAMA","wakeup_key":"xxxx","member":{"family_id":0,"station_sn":"T8420T6021280472","admin_user_id":"xxx","member_user_id":"xxxx","short_user_id":"0000","member_type":2,"permissions":0,"member_nick":"","action_user_id":"","fence_state":0,"extra":"","member_avatar":"","house_id":"","create_time":1655148285,"update_time":0,"status":0,"email":"","nick_name":"","avatar":"","action_user_email":"xxxxx","action_user_name":"xxxx"},"params":[{"param_id":0,"station_sn":"T8420T6021280472","param_type":1224,"param_value":"0","create_time":1655148291,"update_time":1655345480,"status":1},{"param_id":1195096067,"station_sn":"T8420T6021280472","param_type":1135,"param_value":"0","create_time":1655148286,"update_time":1655345480,"status":1},{"param_id":1195096070,"station_sn":"T8420T6021280472","param_type":1253,"param_value":"0","create_time":1655148286,"update_time":1655148286,"status":1},{"param_id":0,"station_sn":"T8420T6021280472","param_type":1140,"param_value":"1","create_time":1655345490,"update_time":0,"status":1}],"devices":[{"device_id":1113987851,"is_init_complete":false,"device_sn":"T8420T6021280472","device_name":"Walkway","device_model":"T8420X","time_zone":"PST8PDT,M3.2.0,M11.1.0","device_type":3,"device_channel":0,"station_sn":"T8420T6021280472","schedule":"","schedulex":"","wifi_mac":"xxxx","main_sw_version":"2.0.4.8","main_hw_version":"P1","sec_sw_version":"2.0.4.8","sec_hw_version":"P1","sector_id":0,"event_num":0,"wifi_ssid":"xxx","ip_addr":"192.168.1.26","volume":"Anker_Security","bind_time":1655148285,"bt_mac":"xxxx","local_ip":"","language":"en-US","sku_number":"","lot_number":"","cpuid":"","create_time":1632308601,"update_time":1655345518,"status":1}],"sensor_info":null,"is_init_complete":false,"virtual_version":"","house_id":"ID"} 
2022-06-16T19:52:23.242Z - DEBUG: Normalized Properties {"stationSN":"T8420T6021280472","properties":{"name":"Walkway","model":"T8420X","serialNumber":"T8420T6021280472","type":3,"hardwareVersion":"P1","softwareVersion":"2.0.4.8","lanIpAddress":"192.168.1.26","macAddress":"xxxx","timeFormat":0,"guardMode":0,"currentMode":0}} 
2022-06-16T19:52:25.289Z - DEBUG: Sending start livestream command to station T8420T6021280472 for device T8420T6021280472 
2022-06-16T19:52:25.289Z - DEBUG: Using CMD_START_REALTIME_MEDIA for station T8420T6021280472 (main_sw_version: 2.0.4.8) 
2022-06-16T19:52:25.290Z - DEBUG: Sending p2p command... {"station":"T8420T6021280472","sequence":1,"commandType":1003,"channel":0,"retries":0,"messageStatesSize":1} 
2022-06-16T19:52:25.304Z - DEBUG: Station T8420T6021280472 - ACK DATA - received from host 192.168.1.26:11941 for sequence 1 
2022-06-16T19:52:25.316Z - DEBUG: Station T8420T6021280472 - DATA DATA - received from host 192.168.1.26:11941 - Processing sequence 1... 
2022-06-16T19:52:25.316Z - DEBUG: Station T8420T6021280472 - Received data {"seqNo":1,"header":{"commandId":1003,"bytesToRead":132,"channel":0,"signCode":0,"type":1},"bytesRead":132,"bytesToRead":132,"firstPartMessage":true,"messageSize":148} 
2022-06-16T19:52:25.317Z - DEBUG: Station T8420T6021280472 - Received data {"commandIdName":"CMD_START_REALTIME_MEDIA","commandId":1003,"resultCodeName":"ERROR_PPCS_SUCCESSFUL","resultCode":0,"message":"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000","data":"000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"} 
2022-06-16T19:52:25.317Z - DEBUG: Station T8420T6021280472 - Result data for command received {"messageState":{"sequence":1,"commandType":1003,"channel":0,"data":{"type":"Buffer","data":[209,0,0,1,88,90,89,72,235,3,4,1,0,0,1,0,0,0,0,0,0,0,0,0,97,49,97,56,50,54,57,53,49,54,52,99,49,56,99,56,57,97,98,51,56,97,97,50,53,100,56,49,101,54,102,100,50,49,57,98,51,98,98,56,57,102,52,52,50,56,55,55,56,101,97,48,54,54,51,99,55,52,54,52,50,50,53,99,100,53,98,102,50,51,52,98,50,98,102,55,48,55,54,57,49,53,99,53,51,57,99,99,52,101,49,55,48,102,57,99,99,53,49,102,55,54,99,48,55,55,56,48,99,53,49,56,48,57,102,54,53,57,97,97,50,99,48,54,54,51,100,55,97,97,55,55,102,102,49,52,51,53,100,55,101,55,98,98,99,54,48,53,57,99,51,56,57,50,48,98,57,56,53,55,102,51,100,98,57,50,49,102,57,57,49,52,99,56,101,48,99,101,52,53,100,97,98,57,50,57,55,51,54,97,99,97,98,51,57,56,102,48,99,99,97,97,50,50,53,55,49,98,50,51,50,51,97,57,50,48,53,56,98,98,99,57,99,52,57,48,52,50,48,98,99,98,97,53,100,49,57,56,56,54,56,48,54,56,97,55,48,57,56,102,102,53,52,48,99,100]},"retries":0,"acknowledged":true,"returnCode":-133,"timeout":{"_idleTimeout":-1,"_idlePrev":null,"_idleNext":null,"_idleStart":13909,"_onTimeout":null,"_repeat":null,"_destroyed":true}},"resultCodeName":"ERROR_PPCS_SUCCESSFUL","resultCode":0} 
2022-06-16T19:52:25.317Z - DEBUG: Got p2p command response {"station":"T8420T6021280472","commandType":1003,"channel":0,"returnCodeName":"ERROR_PPCS_SUCCESSFUL","returnCode":0} 
2022-06-16T19:52:25.317Z - DEBUG: Station T8420T6021280472 - DATA DATA - Received expected sequence (seqNo: 1 queuedData.size: 0) 
2022-06-16T19:52:30.318Z - INFO: Stopping the station stream for the device T8420T6021280472, because we haven't received any data for 5000 seconds 
jangeja commented 2 years ago

Just started a P2p on a camera that works with homekit natievly, and with homebridge via this plugin, and I see a different log line. I also dont see the disconnect log line that we did with the floodlight

2022-06-16T20:17:58.849Z - DEBUG: Sending start livestream command to station T8400P202031584C for device T8400P202031584C 
2022-06-16T20:17:58.850Z - DEBUG: Using CMD_DOORBELL_SET_PAYLOAD for station T8400P202031584C (main_sw_version: 2.1.1.5) 

Versuse this log line from the floodlight:

2022-06-16T19:52:25.289Z - DEBUG: Using CMD_START_REALTIME_MEDIA for station T8420T6021280472 (main_sw_version: 2.0.4.8) 
....
2022-06-16T19:52:30.318Z - INFO: Stopping the station stream for the device T8420T6021280472, because we haven't received any data for 5000 seconds 
thieren commented 2 years ago

Hey @jangeja94

Thx for the logs. Your help is much appreciated.

I see multiple station connects/disconnects for the other 2 cameras that I have in my account without me even initiating the p2p connections via the cli, so im not sure how those are getting in there.

So (if you didn't already know) the underlying connection is established through the eufy-security-client library. This will connect to the eufy cloud at startup and refresh every device. Part of this process is to get the device status/information through a local connection (p2p). That should be fairly standard. And I believe that is what your seeing here.

Also this proves that the whole issue is with the eufy-security-client library as opposed to our plugin. For you this of course doesn't make any difference since your streaming is broke but it narrows down where to look...

Just started a P2p on a camera that works with homekit natievly, and with homebridge via this plugin, and I see a different log line.

That's pretty normal as different eufy devices and software revisions do need different payloads. Why this is exactly I don't know, but if you look at the source code there are a lot of distinction between the devices to get the right commands.

Actually I've even found a comment that hints in the right direction.

I have added some code to test. Just replace eufy-test-client/eufy-security-client/src/http/station.ts with this one. Then run npm run build again in the eufy-security-client directory. After that try again with the tool. Hopefully the logs will now show an established p2p streaming connection.

Alternatively you could install the whole tool again, since I've updated the dependency with a test branch.

jangeja commented 2 years ago

Oh nice find ! I was digging through the eufy-security-client yesterday and must have missed that. Ill try this fix.

jangeja commented 2 years ago

Unfortunately That didnt resolve the issue. I still see the disconnect line for the floodlight with the latest eufy-test-client. So now the floodlight is sending that command, but it doesn't appear to be working still.

2022-06-17T13:00:48.183Z - DEBUG: Sending start livestream command to station T8420T6021280472 for device T8420T6021280472 
2022-06-17T13:00:48.184Z - DEBUG: Using CMD_START_REALTIME_MEDIA for station T8420T6021280472 (main_sw_version: 2.0.4.8) 
2022-06-17T13:00:48.186Z - DEBUG: Sending p2p command... {"station":"T8420T6021280472","sequence":1,"commandType":1003,"channel":0,"retries":0,"messageStatesSize":1} 
....
2022-06-17T13:00:53.223Z - INFO: Stopping the station stream for the device T8420T6021280472, because we haven't received any data for 5000 seconds 
thieren commented 2 years ago

Are you sure you've run npm run build again? The log should say CMD_DOORBELL_SET_PAYLOAD now. It's actually the next line in code. So it's not using this conditional branch just yet.

jangeja commented 2 years ago

:disappointed: I should have known the CMD_START_REALTIME_MEDIA was the same log line... Anyway, had to update the git submodule, I pulled the latest commit on the eufy-test-client repo, but didnt update the git submodule. It definitely works now. I can see the video being streamed in the logs. You're awesome ! Thanks for tracking that down for me. will you point this plugin to use your forked repo for a hotfix? Or should we try to get it merged in the eufy-security-client repo?

2022-06-17T14:40:44.359Z - DEBUG: Station T8420T6021280472 - CMD_AUDIO_FRAME {"dataSize":203,"metadata":{"audioType":0,"audioSeqNo":0,"audioTimestamp":1655476844089,"audioDataLength":187},"audioDataSize":187} 
2022-06-17T14:40:44.360Z - DEBUG: Station T8420T6021280472 - DATA VIDEO - Received expected sequence (seqNo: 42 queuedData.size: 0) 
2022-06-17T14:40:44.367Z - DEBUG: Station T8420T6021280472 - DATA VIDEO - received from host 192.168.1.26:22563 - Processing sequence 42... 
2022-06-17T14:40:44.367Z - DEBUG: Station T8420T6021280472 - DATA VIDEO - Received already processed sequence (seqNo: 42 queuedData.size: 0) 
2022-06-17T14:40:44.435Z - DEBUG: Station T8420T6021280472 - DATA VIDEO - received from host 192.168.1.26:22563 - Processing sequence 43... 
thieren commented 2 years ago

We rely on the master version of the eufy-security-client repo. So I'll open a PR and let @bropat check. But we'll have to wait until the fix is merged into the master until the plugin can use it.

thieren commented 2 years ago

This should be fixed with latest beta.

jangeja commented 2 years ago

I installed the latest beta and now I see this error. It continues to exit and restart.


Error: Cannot find module '../node_modules/eufy-security-client/package.json'
Require stack:
- /homebridge/node_modules/.pnpm/homebridge-eufy-security@2.1.0-beta.10/node_modules/homebridge-eufy-security/dist/platform.js
- /homebridge/node_modules/.pnpm/homebridge-eufy-security@2.1.0-beta.10/node_modules/homebridge-eufy-security/dist/index.js
- /homebridge/node_modules/.pnpm/homebridge@1.5.0/node_modules/homebridge/lib/plugin.js
- /homebridge/node_modules/.pnpm/homebridge@1.5.0/node_modules/homebridge/lib/pluginManager.js
- /homebridge/node_modules/.pnpm/homebridge@1.5.0/node_modules/homebridge/lib/api.js
- /homebridge/node_modules/.pnpm/homebridge@1.5.0/node_modules/homebridge/lib/childBridgeFork.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at new EufySecurityPlatform (/homebridge/node_modules/.pnpm/homebridge-eufy-security@2.1.0-beta.10/node_modules/homebridge-eufy-security/src/plugin/platform.ts:126:21)
    at ChildBridgeFork.startBridge (/homebridge/node_modules/.pnpm/homebridge@1.5.0/node_modules/homebridge/src/childBridgeFork.ts:150:42)
[7/19/2022, 7:41:27 AM] [homebridge-eufy-security] Child bridge process ended```
thieren commented 2 years ago

Seems like pnpm is handling the dependencies in another way completely. I will introduce a workaround in the next version but out of curiosity: what installation method for homebridge did you use?

jangeja commented 2 years ago

Running homebridge in docker.

I was able to fix it by symlinking the node_modules dir. Unfortunately, I am still getting the orginal issue where its crashing the bridge.

[7/19/2022, 9:06:26 AM] [EufySecurity-2.1.0-beta.10] DEBUG: Walkway RTSP rtspStream:false
[7/19/2022, 9:06:26 AM] [EufySecurity-2.1.0-beta.10] DEBUG: Walkway Looks like not compatible with RTSP
[7/19/2022, 9:06:26 AM] [EufySecurity-2.1.0-beta.10] DEBUG: Walkway New instance requests livestream. There were 0 instance(s) using the livestream until now.
[7/19/2022, 9:06:26 AM] [EufySecurity-2.1.0-beta.10] DEBUG: Walkway Start new station livestream (P2P Session)...
[7/19/2022, 9:06:29 AM] [homebridge-eufy-security] Error: 
    at Accessory.sendCharacteristicWarning (/homebridge/node_modules/.pnpm/hap-nodejs@0.10.2/node_modules/hap-nodejs/src/lib/Accessory.ts:1947:14)
    at Timeout._onTimeout (/homebridge/node_modules/.pnpm/hap-nodejs@0.10.2/node_modules/hap-nodejs/src/lib/Accessory.ts:1642:14)
    at listOnTimeout (node:internal/timers:559:17)
    at processTimers (node:internal/timers:502:7)
[7/19/2022, 9:06:35 AM] [homebridge-eufy-security] This plugin slows down Homebridge. The write handler for the characteristic 'Selected RTP Stream Configuration' on the accessory 'Walkway 6CDA' didn't respond at all!. Please check that you properly call the callback! See https://homebridge.io/w/JtMGR for more info.
[7/19/2022, 9:06:35 AM] [homebridge-eufy-security] Error: 
    at Accessory.sendCharacteristicWarning (/homebridge/node_modules/.pnpm/hap-nodejs@0.10.2/node_modules/hap-nodejs/src/lib/Accessory.ts:1947:14)
    at Timeout._onTimeout (/homebridge/node_modules/.pnpm/hap-nodejs@0.10.2/node_modules/hap-nodejs/src/lib/Accessory.ts:1657:16)
    at listOnTimeout (node:internal/timers:559:17)
    at processTimers (node:internal/timers:502:7)
[7/19/2022, 9:06:35 AM] [EufySecurity-2.1.0-beta.10] DEBUG: Walkway Receive Apple HK Stop request{"sessionID":"ca2657d7-7251-48fa-8e22-1e97e94fb117","type":"stop"}
[7/19/2022, 9:06:35 AM] [EufySecurity-2.1.0-beta.10] DEBUG: Stopping session with id: ca2657d7-7251-48fa-8e22-1e97e94fb117
[7/19/2022, 9:06:35 AM] [EufySecurity-2.1.0-beta.10] DEBUG: No session to stop.
[7/19/2022, 9:06:36 AM] [EufySecurity-2.1.0-beta.10] ERROR: Walkway Local livestream didn't start in time. Abort livestream request.
[7/19/2022, 9:06:36 AM] [EufySecurity-2.1.0-beta.10] ERROR: Walkway Unable to start the livestream: no started livestream found
[7/19/2022, 9:06:36 AM] [EufySecurity-2.1.0-beta.10] DEBUG: Walkway VIDEOCONFIG: {"audio":false,"vcodec":"libx264","acodec":"libfdk_aac","encoderOptions":"-preset ultrafast -tune zerolatency","packetSize":1128,"forceMax":false}
[7/19/2022, 9:06:36 AM] [EufySecurity-2.1.0-beta.10] INFO:  Walkway Starting video stream: 1280x720, 30 fps, 299 kbps 
TypeError: Cannot read properties of undefined (reading 'url')
    at StreamingDelegate.startStream (/homebridge/node_modules/.pnpm/homebridge-eufy-security@2.1.0-beta.10/node_modules/homebridge-eufy-security/src/plugin/accessories/streamingDelegate.ts:780:51)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
[7/19/2022, 9:06:36 AM] [homebridge-eufy-security] Child bridge process ended
[7/19/2022, 9:06:36 AM] [homebridge-eufy-security] Process Ended. Code: 1, Signal: null

Possible relevant config:

Walkway config is: {
  serialNumber: 'T8420xxxxxx',
  unbridge: true,
  talkback: false,
  videoConfig: { audio: false },
  enableCamera: 'true',
  name: 'Walkway',
  enableButton: true,
  motionButton: true,
  rtsp: false,
  forcerefreshsnap: false,
  useCachedLocalLivestream: false,
  immediateRingNotificationWithoutSnapshot: false,
  useEnhancedSnapshotBehaviour: true,
  delayCameraSnapshot: false,
  snapshotHandlingMethod: 3
}
thieren commented 2 years ago

Can you send me your log-lib.log? should be somewhere under /homebridge/eufysecurity/ (the exact storage path should now be written to the log at startup)

thieren commented 2 years ago

Is fixed with release of 2.1.0