homebridge-eufy-security / plugin

Homebridge plugin to control certain Eufy Security devices
Apache License 2.0
166 stars 24 forks source link

[Bug]: Updating to Node.js 20.11.1 causes ffmpeg to not start, camera not found etc. #516

Closed cytan299 closed 5 months ago

cytan299 commented 6 months ago

What happened?

After updating to Node.js 20.11.1, ffmpeg would not start, P2P times out etc. Backdating to 20.11.0 fixes the problem.

More info on setup: Plugin version 2.2.21 Homebridge version: 1.7.0 NodeJS version: 20.11.1 is broken!!!! 20.11.0 is ok Operating system: Linux homebridge 6.1.0-rpi6-rpi-v8 #1 SMP PREEMPT Debian 1:6.1.58-1+rpt2 (2023-10-27) aarch64 GNU/Linux

Device Type

Indoor Camera (Supported)

Plugin Version

v2.0.x (Supported)

HomeBridge Version

other (UnSupported)

NodeJS Version

v18 (Supported)

Operating System

Raspbian 10+ (Supported)

Relevant log output

39m ERROR    Living Room Local livestream didn't start in time. Abort livestream request.
[02/16/2024, 21:58:20]  [EufySecurity]    WARN Living Room Could not get snapshot from livestream!
[02/16/2024, 21:58:20]  [EufySecurity]    WARN Living Room No camera source detected.
[02/16/2024, 21:58:28]  [EufySecurity]    INFO Living Room station livestream (P2P session) for Living Room has started.
[02/16/2024, 21:58:39]  [EufySecurity]    ERROR    Kitchen Local livestream didn't start in time. Abort livestream request.
[02/16/2024, 21:58:39]  [EufySecurity]    WARN Kitchen Could not get snapshot from livestream!
[02/16/2024, 21:58:39]  [EufySecurity]    WARN Kitchen No camera source detected.
[02/16/2024, 21:58:43]  [EufySecurity]    WARN Living Room ffmpeg process timed out.
[02/16/2024, 21:58:50]  [EufySecurity]    INFO Living Room station livestream (P2P session) for Living Room has started.
[02/16/2024, 21:58:51]  [EufySecurity]    ERROR    Kitchen Local livestream didn't start in time. Abort livestream request.
[02/16/2024, 21:58:51]  [EufySecurity]    WARN Kitchen Could not get snapshot from livestream!
[02/16/2024, 21:58:51]  [EufySecurity]    WARN Kitchen No camera source detected.
[02/16/2024, 21:59:02]  [EufySecurity]    ERROR    Kitchen Local livestream didn't start in time. Abort livestream request.
[02/16/2024, 21:59:02]  [EufySecurity]    WARN Kitchen Could not get snapshot from livestream!
[02/16/2024, 21:59:02]  [EufySecurity]    WARN Kitchen No camera source detected.
[02/16/2024, 21:59:05]  [EufySecurity]    WARN Living Room ffmpeg process timed out.
[02/16/2024, 21:59:14]  [EufySecurity]    ERROR    Kitchen Local livestream didn't start in time. Abort livestream request.
[02/16/2024, 21:59:14]  [EufySecurity]    WARN Kitchen Could not get snapshot from livestream!
[02/16/2024, 21:59:14]  [EufySecurity]    WARN Kitchen No camera source detected.
[02/16/2024, 21:59:23]  [EufySecurity]    ERROR    Living Room Local livestream didn't start in time. Abort livestream request.
[02/16/2024, 21:59:23]  [EufySecurity]    WARN Living Room Could not get snapshot from livestream!
[02/16/2024, 21:59:23]  [EufySecurity]    WARN Living Room No camera source detected.
[02/16/2024, 21:59:25]  [EufySecurity]    INFO Living Room station livestream (P2P session) for Living Room has started.
[02/16/2024, 21:59:25]  [EufySecurity]    ERROR    Kitchen Local livestream didn't start in time. Abort livestream request.
[02/16/2024, 21:59:25]  [EufySecurity]    WARN Kitchen Could not get snapshot from livestream!
[02/16/2024, 21:59:25]  [EufySecurity]    WARN Kitchen No camera source detected.

config

{
    "username": "xxx",
    "password": "xxx",
    "country": "US",
    "deviceName": "",
    "stations": [
        {
            "hkHome": 1,
            "hkAway": 0,
            "serialNumber": "xxx",
            "hkNight": 3,
            "hkOff": 63
        },
        {
            "serialNumber": "xxx,
            "manualTriggerModes": []
        }
    ],
    "platform": "EufySecurity",
    "ignoreStations": [],
    "ignoreDevices": [],
    "cleanCache": true,
    "cameras": [
        {
            "serialNumber": "xxx",
            "useCachedLocalLivestream": true,
            "videoConfig": {
                "audio": true,
                "maxWidth": 640,
                "maxHeight": 480,
                "maxFPS": 15,
                "useSeparateProcesses": true
            },
            "talkback": true,
            "enableCamera": "true",
            "hsv": true,
            "hsvRecordingDuration": 90,
            "hsvConfig": {},
            "unbridge": false,
            "snapshotHandlingMethod": 2,
            "refreshSnapshotIntervalMinutes": 5
        },
        {
            "serialNumber": "xxx,
            "useCachedLocalLivestream": true,
            "videoConfig": {
                "audio": true,
                "maxWidth": 640,
                "maxHeight": 480,
                "maxFPS": 15,
                "useSeparateProcesses": true
            },
            "talkback": true,
            "enableCamera": "true",
            "hsv": true,
            "hsvRecordingDuration": 90,
            "hsvConfig": {},
            "unbridge": false,
            "snapshotHandlingMethod": 2,
            "refreshSnapshotIntervalMinutes": 5
        }
    ],
    "_bridge": {
        "username": "xxx",
        "port": 32980
    }
}
github-actions[bot] commented 6 months ago

Did you check this Common Issues pages ?

na-ma-ste commented 6 months ago

Check the Common Issue pages. Nothing from there works. Going back to node 2.11.0 like @cytan299 mentioned brings the eufy plugin back to work with ffmpeg.

Device Type

Indoor Camera (Supported), HomeBase3

Plugin Version

v2.2.21 (Supported)

HomeBridge Version

1.7.0

NodeJS Version

v20.11.0

Operating System

Raspbian 10+ (Supported)

pogi2001 commented 6 months ago

Hi, same problem at my HB. I updated the nodejs and ffmpeg is still not working unable to connect to camera. Doorbell 2C. Can someone tell me how can I downgrade the nodejs I still didn't find any infos about it. I running HB on rpi4 without any container it's pure os on pi. Thx

cytan299 commented 6 months ago

Just run the following in the HomeBridge terminal:

sudo hb-service update-node 20.11.0

Then you should be back to 20.11.0

Note: I had to "Remove bridge" from HomeKit and then re-add EUFY back to HomeKit again. I had to do this because even after going back to 20.11.0, although there were no more errors in HomeBridge, HomeKit couldn't find my EUFY cameras. You, OTOH, may not need to do the "Remove bridge" in HomeKit if everything comes back.

pogi2001 commented 6 months ago

Hello thanks for the prompt answer it's working fine with this method! Thank you very much!

na-ma-ste commented 6 months ago

Hi, since today i got the following message on the console in Homebridge:

[02/22/2024, 13:03:38] [EufySecurity] INFO Country set: DE [02/22/2024, 13:03:38] [EufySecurity] INFO Finished initializing! Error: listen EADDRINUSE: address already in use :::31910 at Server.setupListenHandle [as _listen2] (node:net:1872:16) at listenInCluster (node:net:1920:12) at Server.listen (node:net:2008:7) at EventedHTTPServer.listen (/var/lib/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/util/eventedhttp.ts:164:20) at HAPServer.listen (/var/lib/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/HAPServer.ts:377:21) at Bridge. (/var/lib/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1365:18) at step (/var/lib/homebridge/node_modules/homebridge/node_modules/tslib/tslib.js:195:27) at Object.next (/var/lib/homebridge/node_modules/homebridge/node_modules/tslib/tslib.js:176:57) at fulfilled (/var/lib/homebridge/node_modules/homebridge/node_modules/tslib/tslib.js:166:62) at processTicksAndRejections (node:internal/process/task_queues:95:5) [22.2.2024, 13:03:41] [homebridge-eufy-security] Child bridge process ended [22.2.2024, 13:03:41] [homebridge-eufy-security] Process Ended. Code: 1, Signal: null [22.2.2024, 13:03:48] [homebridge-eufy-security] Restarting Process...

not sure if it is related to the downgrade to node. Any ideas?

cytan299 commented 6 months ago

Hi na-ma-ste

I just rebooted to see if I see what you saw. Everything is normal:

`[02/22/2024, 18:55:17] [EufySecurity] WARN warning: planned changes, see https://github.com/homebridge-eufy-security/plugin/issues/1

[02/22/2024, 18:55:17] [EufySecurity] INFO Country set: US

[02/22/2024, 18:55:17] [EufySecurity] INFO Finished initializing!

[22/02/2024, 18:55:18] Homebridge v1.7.0 (HAP v0.11.1) (homebridge-eufy-security) is running on port 32980.`

na-ma-ste commented 6 months ago

Thanks @cytan299 . I have the problem for some days with each "child-bridge". Suddenly the threw an error and homebridge start stoping.

Eufy Security Plugin works after downgrading to 20.11.0

rippn commented 6 months ago

I'm using QNAP Container Station and v2.3.9 and it was working perfectly with NodeJS v20.11.0. I updated to vNodeJS v20.11.1 and now I'm getting the following error.

[02/24/2024, 20:45:52] [EufySecurity] WARN TypeError (0 , pick_port_1.default) is not a function error stack: • ffmpeg-params.ts Function.allocateddPort ffmpeg-params.ts:96 • ffmpeg-params.ts Function.allocateTCPPort ffmpeg-params.ts:104 • EufyClientInteractor.ts EufyClientInteractor.setupServer EufyClientInteractor.ts:52 • platform.ts EufySecurityPlatform.pluginSetup platform.ts:417 • task_queues processTicksAndRejections task_queues:95 • platform.ts HomebridgeAPI. platform.ts:309

I have downgraded NodeJS to v20.11.0, even went back to suppoted v18 versions and still getting this error. Even went as far as deleting container station and reinstalling everything from scratch and getting the error. Also if I try to access the Doorbell T8210 in homekit, it crashes the child bridge. If I revert to plugin v2.3.5 it works and loses the error above but there are other random errors that crash the bridge. Doorbell doesn't seem to work with v2.2.21.

billbazza commented 6 months ago

I had this issue too.

I had to unbridge the app, remove from home and then re-enable bridged mode from Homebridge rather than the app config. Audio even works now which has never worked before which is nice.

na-ma-ste commented 6 months ago

Thank @billbazza . This workaround does not work at my configuration (raspberry PI 3) -i have deinstalled the eufy Plugin and reinstalled. Same behaviour wirh node 2.11.1 as after the update -no ffmpeg connection

billbazza commented 6 months ago

Thank @billbazza . This workaround does not work at my configuration (raspberry PI 3) -i have deinstalled the eufy Plugin and reinstalled. Same behaviour wirh node 2.11.1 as after the update -no ffmpeg connection

Did you try node 2.11.0?

na-ma-ste commented 6 months ago

Hi,

yes, i downgraded directly to 2.11.0 after the frist post here. Eufy Security and ffmpeg works. Updating again to 2.11.1 break the Eufy Plugin again.

Nevertheless, I have sometimes dropouts without log outputs in Homebridge and then have to restart Homebrige.

I have removed child bridges because there were more frequent failures with child bridges than without.

https://github.com/homebridge-eufy-security/plugin/issues/516#issuecomment-1962300675

eengert commented 6 months ago

Just today I began getting the error: Doorbell ffmpeg process timed out (issue #521 )

I downgraded NodeJS to v2.11.0, but I'm still getting this error. My doorbell camera no longer shows up in HomeKit. I tried removing the bridge from HomeKit and re-adding, but that had no impact. I've tried many different versions of the plugin, but nothing has worked.

cytan299 commented 6 months ago

@eengert Sorry to hear that removing the bridge and re-adding it didn't fix the problem for you which did for me (after downgrading back to 20.11.0) . I don't know what else to tell you. I hope that the creators of this plugin has more information about how to get you back on the air.

cytan

tteuer commented 6 months ago

I can confirm the same issue with the Eufy plugin after updating to Node 20.11.1. Downgrading Node to 20.11.0 resolved the issue without any other changes. Running the latest versions of the Eufy plugin, Homebridge, and macOS Sonoma.

eengert commented 6 months ago

After trying many different things that didn't work (including simply downgrading Node.js), I finally got it working. I think what did the trick was running an Ubuntu update/upgrade via apt.

UPDATE: I spoke too soon. It worked for a few minutes (for the first snapshot) and then started throwing the warning again.

The strange thing is that when I tap on the video feed from the doorbell in HomeKit, it opens the "live feed" but it's just a still image and not live video like it should be. But it is an updated still image at least. But when the plugin attempts to create the periodic snapshot, it fails with the ffmpeg timeout.

eengert commented 6 months ago

I'm really not sure what's going on. I've spent quite a few hours over the past couple of days trying everything I can think of. I've tried many different versions of Node.js, many different versions of this plugin, every combination of plugin settings, I've even restored to an older backup from a time when I know the doorbell camera was working. But nothing has worked reliably. Occasionally I can get the live stream to play in the Home app, but 95% of the time, it won't start and no snapshot is taken either.

Besides the "ffmpeg timed out" warning, I sometimes see this error "No camera source detected." I'm not sure what else to try. Any suggestions?

cytan299 commented 6 months ago

@eengert

I had the same problem as you after downgrading back to 20.11.0. My fix was the removal of the Eufy bridge in Homekit and then reinstalling again in HomeKit. If you already did that and it didn't work, the only solution I have is a complete reinstallation of HomeBridge and plugins. However this is a drastic fix and so I hope the developers will have a better solution.

cytan

AussieFries commented 5 months ago

Just run the following in the HomeBridge terminal:

sudo hb-service update-node 20.11.0

Then you should be back to 20.11.0

Note: I had to "Remove bridge" from HomeKit and then re-add EUFY back to HomeKit again. I had to do this because even after going back to 20.11.0, although there were no more errors in HomeBridge, HomeKit couldn't find my EUFY cameras. You, OTOH, may not need to do the "Remove bridge" in HomeKit if everything comes back.

Thank you SO much!! It worked and I didn’t have to remove the bridge!

lenoxys commented 5 months ago

Hello, this will be fixed on HKSV branch it's been 2 week I'm using 2.11.1 and no issue. I've upgrade my lab to 2.12.0 as well no more issue bear with me to be backported into main branch

Justus2017 commented 5 months ago

Reverting to 20.10.0 did not bring back the Wall Light cameras (plug in style) Homebridge Logs still states:

Wall Light Cam No camera source detected.

lenoxys commented 5 months ago

Yeah nodejs is the cause of the issue. Use 2.3.22 it will prevent plugin to work on NodeJS version which introduced the bug

na-ma-ste commented 5 months ago

Hi @lenoxys ,

I updated node.js to 20.12.2 and got with euyf version 2.33.22 the following message:

Error: Your current Node.js version (v20.12.2) is incompatible with the RSA_PKCS1_PADDING used by the plugin. Please downgrade to a compatible version by running the command likes: sudo hb-service update-node 20.11.0. Refer to https://github.com/homebridge/homebridge/wiki/How-To-Update-Node.js for upgrading/downgrading Node.js Refer to https://nodejs.org/en/blog/vulnerability/february-2024-security-releases#nodejs-is-vulnerable-to-the-marvin-attack-timing-variant-of-the-bleichenbacher-attack-against-pkcs1-v15-padding-cve-2023-46809---medium for more information.

any ideas?

lenoxys commented 5 months ago

See my last comment above. It's pretty clear you need to downgrade Nodejs version

na-ma-ste commented 5 months ago

Ok. so I will take eufy Version 2.2.30-hksv and node 20.12.0. yes?

na-ma-ste commented 5 months ago

hmm... i can onyl access version v2.3.11 in homebridge for the eurfy plugin on a PI 5 with homebridge 1.70 and node js 20.11.0

na-ma-ste commented 5 months ago

Hi @lenoxys ,

I have installed the eufy plugin in version 2.3.22 as you mentioned. Node is on version 20.11.0; homebridge on 1.7.0 and homebrige ui runs on 4.56.1.

I get no Errors in the homebridge console. I can see the "devices" in homebridge devices. But they dont appear in Homekit. I have encapsulated the plugin in an under-brdige and when adding it to homekit I get the info that the bridge is not compatible. This means that the characteristics of the individual devices appear to be faulty.

Do you have any ideas?

na-ma-ste commented 5 months ago

Hi @lenoxys ,

I have restarted the access data process at Miele. That seems to have helped.