Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HB won't start after install #65

Closed
twynne opened this issue Aug 3, 2020 · 15 comments
Closed

HB won't start after install #65

twynne opened this issue Aug 3, 2020 · 15 comments

Comments

@twynne
Copy link

twynne commented Aug 3, 2020

Describe the bug
After installing this plugin via Config UI X, Homebridge repeatedly crashes during startup.

Specifications
What hardware and OS is your Homebridge running on?
Mac OS
Homebridge 1.2.0b33 (any issues with current beta?)

What Unifi hardware are you using
CKG2+
Flex-G3 camera

In case you have issues with streaming via FFMpeg, have you tried with https://www.npmjs.com/package/homebridge-camera-ffmpeg first, if not, do this first!
Will try

Logging
Debug is not showing any additional information. I can't even see the plugin loading in logs.

To Reproduce
Steps to reproduce the behavior:
I have checked that

  • Canvas is installed
  • RTSP is enabled on the camera
  • Snapshot is enabled on the camera
  • Camera is fully working via UI Protect

Additional context
My homebridge install is otherwise stable and has been for many months. The Unifi camera is new, but is otherwise working perfectly. Is there any reason to suspect issues with the HB beta and this plugin?

@twynne
Copy link
Author

twynne commented Aug 3, 2020

This is all I'm seeing in the logs following installing/configuring the plugin:

[37m[8/3/2020, 12:00:53 PM]�[0m �[36m[HB Supervisor]�[0m Restarting Homebridge...
�[37m[8/3/2020, 12:00:53 PM]�[0m �[36m[HB Supervisor]�[0m Starting Homebridge with extra flags: -I
�[37m[8/3/2020, 12:00:53 PM]�[0m �[36m[HB Supervisor]�[0m Started Homebridge v1.2.0-beta.33 with PID: 68703
�[37m[8/3/2020, 12:00:53 PM] �[39mLoaded config.json with 3 accessories and 5 platforms.
�[37m[8/3/2020, 12:00:53 PM] �[39m---
�[37m[8/3/2020, 12:00:54 PM] �[39mLoaded plugin: [email protected]
�[37m[8/3/2020, 12:00:54 PM] �[39mRegistering accessory 'homebridge-accessory-bandwidth-quality.bandwidth-quality'
�[37m[8/3/2020, 12:00:54 PM] �[39m---
�[37m[8/3/2020, 12:00:54 PM] �[39mLoaded plugin: [email protected]
�[37m[8/3/2020, 12:00:54 PM] �[39mRegistering platform 'homebridge-config-ui-x.config'
�[37m[8/3/2020, 12:00:54 PM] �[39m---
�[37m[8/3/2020, 12:00:54 PM] �[39mLoaded plugin: [email protected]
�[37m[8/3/2020, 12:00:54 PM] �[39mRegistering platform 'homebridge-dyson-pure-cool.DysonPureCoolPlatform'
�[37m[8/3/2020, 12:00:54 PM] �[39m---
�[37m[8/3/2020, 12:00:55 PM] �[39mLoaded plugin: [email protected]
�[37m[8/3/2020, 12:00:55 PM] �[39mRegistering platform 'homebridge-harmony.HarmonyHubWebSocket'
�[37m[8/3/2020, 12:00:55 PM] �[39m---
�[37m[8/3/2020, 12:00:55 PM] �[39mLoaded plugin: [email protected]
�[37m[8/3/2020, 12:00:55 PM] �[39mRegistering platform 'homebridge-platform-wemo.BelkinWeMo'
�[37m[8/3/2020, 12:00:55 PM] �[39m---
�[37m[8/3/2020, 12:00:55 PM] �[39mLoaded plugin: [email protected]
�[37m[8/3/2020, 12:00:55 PM] �[39mRegistering accessory 'homebridge-ssh.SSH'
�[37m[8/3/2020, 12:00:55 PM] �[39m---
�[37m[8/3/2020, 12:00:55 PM] �[39mLoaded plugin: [email protected]
�[37m[8/3/2020, 12:00:55 PM] �[39mRegistering accessory 'homebridge-unifi-occupancy-sensor.UniFi Occupancy Sensor'
�[37m[8/3/2020, 12:00:55 PM] �[39m---
�[37m[8/3/2020, 12:00:56 PM]�[0m �[36m[HB Supervisor]�[0m Homebridge Process Ended. Code: null, Signal: SIGILL

My current plugin config is:

{
        "name": "Unifi protect cameras & motion sensors",
        "platform": "UnifiProtectMotion",
        "unifi": {
            "enhanced_classes": [],
            "controller": "https://192.168.1.4:7443",
            "controller_rtsp": "rtsp://192.168.1.4:7447",
            "username": "user",
            "password": "pwd",
            "motion_interval": 5000,
            "motion_repeat_interval": 30000,
            "motion_score": 0,
            "enhanced_motion": true,
            "enhanced_motion_score": 50,
            "enable_motion_trigger": true,
            "save_snapshot": false,
            "debug": true,
            "debug_network_traffic": false
        },
        "googlePhotos": {
            "upload_gphotos": false,
            "auth_redirectUrl": "http://localhost:8080/oauth2-callback"
        },
        "videoConfig": {
            "maxStreams": 2,
            "maxWidth": 1920,
            "maxHeight": 1080,
            "maxFPS": 15,
            "maxBitrate": 3000,
            "vcodec": "libx264",
            "packetSize": 376,
            "audio": false,
            "additionalCommandline": "-protocol_whitelist https,crypto,srtp,rtp,udp"
        }
    }

All of this was set via ConfigUI X and the config validated fine.

@twynne
Copy link
Author

twynne commented Aug 3, 2020

Trying with just the ffmpeg plugin, I don't see video either. The log reflects only the following:

[8/3/2020, 1:03:48 PM] [Camera FFmpeg] [Lounge-temp] An error occurred while making snapshot request: Error: spawn ffmpeg ENOENT
[8/3/2020, 1:03:48 PM] [Camera FFmpeg] [Lounge-temp] Video stream requested: 1280x720, 30 fps, 299 kbps
[8/3/2020, 1:03:48 PM] [Camera FFmpeg] [Lounge-temp] Starting video stream: 1280x720, 15 fps, 299 kbps
[8/3/2020, 1:03:48 PM] [Camera FFmpeg] [Lounge-temp] Stream command: ffmpeg -i rtsp://192.168.1.4:7447/FDZaYME3mL4DtUy5 -map 0:0 -vcodec libx264 -pix_fmt yuv420p -r 15 -f rawvideo -preset ultrafast -tune zerolatency -vf scale=1280:720 -b:v 299k -bufsize 598k -maxrate 299k -payload_type 99 -ssrc 5258608 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params AP8NGf3voMzUdxNEGgkhQDrABBKSI6DCHCJrv966 srtp://192.168.1.111:64101?rtcpport=64101&localrtcpport=64101&pkt_size=1316 -loglevel level+verbose
[8/3/2020, 1:03:48 PM] [Camera FFmpeg] [Lounge-temp] Failed to start stream: spawn ffmpeg ENOENT
[8/3/2020, 1:03:48 PM] [Camera FFmpeg] [Lounge-temp] Stopped video stream.
[8/3/2020, 1:03:49 PM] [Camera FFmpeg] [Lounge-temp] Snapshot requested: 1280x720
[8/3/2020, 1:03:49 PM] [Camera FFmpeg] [Lounge-temp] Sending snapshot: 1280x720
[8/3/2020, 1:03:49 PM] [Camera FFmpeg] [Lounge-temp] Snapshot command: ffmpeg -i rtsp://192.168.1.4:7447/FDZaYME3mL4DtUy5 -frames:v 1 -vf scale=1280:720 -f image2 -
[8/3/2020, 1:03:49 PM] [Camera FFmpeg] [Lounge-temp] An error occurred while making snapshot request: Error: spawn ffmpeg ENOENT

Viewing the feed via the camera's rtsp address, in a browser, works fine.

I assume therefore that the issue is ffmpeg, but I understood that this plugin had it's own deployment of ffmpeg. What else should I check?

@twynne
Copy link
Author

twynne commented Aug 3, 2020

Got a bit further... installed camera-ffmpeg plugin, then installed/updated ffmpeg externally and was able to get the video to stream. Reinstalled the protect-motion plugin and it still fails, but the log now shows the following:

[37m[8/3/2020, 3:45:37 PM] �[39m�[31mERROR LOADING PLUGIN homebridge-unifi-protect-camera-motion:�[39m
�[37m[8/3/2020, 3:45:37 PM] �[39m�[31mError: Cannot find module 'axios'�[39m
�[31mRequire stack:�[39m
�[31m- /usr/local/lib/node_modules/homebridge-unifi-protect-camera-motion/src/unifi/unifi.js�[39m
�[31m- /usr/local/lib/node_modules/homebridge-unifi-protect-camera-motion/src/unifi-protect-motion-platform.js�[39m
�[31m- /usr/local/lib/node_modules/homebridge-unifi-protect-camera-motion/src/index.js�[39m
�[31m- /usr/local/lib/node_modules/homebridge/lib/plugin.js�[39m
�[31m- /usr/local/lib/node_modules/homebridge/lib/pluginManager.js�[39m
�[31m- /usr/local/lib/node_modules/homebridge/lib/api.js�[39m
�[31m- /usr/local/lib/node_modules/homebridge/lib/server.js�[39m
�[31m- /usr/local/lib/node_modules/homebridge/lib/cli.js�[39m
�[31m- /usr/local/lib/node_modules/homebridge/bin/homebridge�[39m
�[31m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:976:15)�[39m
�[31m at Function.Module._load (internal/modules/cjs/loader.js:859:27)�[39m
�[31m at Module.require (internal/modules/cjs/loader.js:1036:19)�[39m
�[31m at require (internal/modules/cjs/helpers.js:72:18)�[39m
�[31m at Object. (/usr/local/lib/node_modules/homebridge-unifi-protect-camera-motion/src/unifi/unifi.js:25:15)�[39m
�[31m at Module._compile (internal/modules/cjs/loader.js:1147:30)�[39m
�[31m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)�[39m
�[31m at Module.load (internal/modules/cjs/loader.js:996:32)�[39m
�[31m at Function.Module._load (internal/modules/cjs/loader.js:896:14)�[39m
�[31m at Module.require (internal/modules/cjs/loader.js:1036:19)�[39m
�[31m at require (internal/modules/cjs/helpers.js:72:18)�[39m
�[31m at Object. (/usr/local/lib/node_modules/homebridge-unifi-protect-camera-motion/src/unifi-protect-motion-platform.js:4:17)�[39m
�[31m at Module._compile (internal/modules/cjs/loader.js:1147:30)�[39m
�[31m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)�[39m
�[31m at Module.load (internal/modules/cjs/loader.js:996:32)�[39m
�[31m at Function.Module._load (internal/modules/cjs/loader.js:896:14)�[39m
�[31m at Module.require (internal/modules/cjs/loader.js:1036:19)�[39m
�[31m at require (internal/modules/cjs/helpers.js:72:18)�[39m
�[31m at Object. (/usr/local/lib/node_modules/homebridge-unifi-protect-camera-motion/src/index.js:2:41)�[39m
�[31m at Module._compile (internal/modules/cjs/loader.js:1147:30)�[39m
�[31m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)�[39m
�[31m at Module.load (internal/modules/cjs/loader.js:996:32)�[39m
�[31m at Function.Module._load (internal/modules/cjs/loader.js:896:14)�[39m
�[31m at Module.require (internal/modules/cjs/loader.js:1036:19)�[39m
�[31m at require (internal/modules/cjs/helpers.js:72:18)�[39m
�[31m at Plugin.load (/usr/local/lib/node_modules/homebridge/src/plugin.ts:181:27)�[39m
�[31m at /usr/local/lib/node_modules/homebridge/src/pluginManager.ts:120:16�[39m
�[31m at Map.forEach ()�[39m
�[31m at PluginManager.initializeInstalledPlugins (/usr/local/lib/node_modules/homebridge/src/pluginManager.ts:118:18)�[39m
�[31m at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:148:24)�[39m
�[31m at cli (/usr/local/lib/node_modules/homebridge/src/cli.ts:80:10)�[39m
�[31m at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)�[39m
�[31m at Module._compile (internal/modules/cjs/loader.js:1147:30)�[39m
�[31m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)�[39m
�[31m at Module.load (internal/modules/cjs/loader.js:996:32)�[39m
�[31m at Function.Module._load (internal/modules/cjs/loader.js:896:14)�[39m
�[31m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)�[39m
�[31m at internal/main/run_main_module.js:17:47�[39m

Any ideas what I'm missing?

@twynne
Copy link
Author

twynne commented Aug 3, 2020

Just one more thing to add, homebridge-unifi-protect is now installed and working fine. So, there is something specific to the motion plugin that seems to have an issue. Either an issue with the platform on which I'm trying to run it (MacOS native), or there's an install/config issue. I've used the same values to configure Unifi-protect and they seem to work.

It would of course be nice to get the motion detection working, so would appreciate any suggestions or feedback based on the above.

Thanks 👍

@beele
Copy link
Owner

beele commented Aug 5, 2020

Could you try with:
sudo npm i -g --unsafe-perm=true [email protected]

@twynne
Copy link
Author

twynne commented Aug 5, 2020

Hi,

Same result I'm afraid. Homebridge just fails to load successfully once that is installed and config added. Uninstalling and removing the config, all is well again.

@beele
Copy link
Owner

beele commented Aug 5, 2020

The strange thing is that you are getting a: Signal: SIGILL message ==> illegal instruction
which is kinda weird, I'm gonna try locally with the homebridge beta.
I suspect it's related to that or it might be clashing with another plugin

EDIT: just installed [email protected] on my machine (osx catalina) and it works just fine.
Could you try to spin up a different homebridge instance with only this plugin in the config, no need to add it to your home, just to see if it will start up correctly

@twynne
Copy link
Author

twynne commented Aug 5, 2020

I'm afraid I've no idea how I would go about creating a second homebridge instance. Is there guidance on that somewhere?

@beele
Copy link
Owner

beele commented Aug 5, 2020

In your second log I don't see the SIGILL but I see this: Cannot find module 'axios'
Which means that the axios dependency can not be found, which the latest beta isn't even using anymore.
This leads me to believe that the package did not update correctly. Could you try removing the folder where the plugin is installed?
use: npm root -g => prints where global npm packages are installed, enter that folder via the terminal
then remove the plugin directory with rm -rf homebridge-unifi-protect-camera-motion
then reinstall the plugin again with sudo npm i -g --unsafe-perm=true [email protected]

I added a new beta as there might have been some leftover files included in that build that might have caused this issue

@twynne
Copy link
Author

twynne commented Aug 5, 2020

No joy. You're correct that the folder was still there, which I removed.
Reinstalled using your command above, then added back the config lines (all default values).

Homebridge repeatedly fails to load until I remove the plugin (uninstall via Config UI fails, have to do via command line). Nothing useful showing in logs beyond the above.

[8/5/2020, 4:43:46 PM] [HB Supervisor] Restarting Homebridge...
[8/5/2020, 4:43:46 PM] [HB Supervisor] Starting Homebridge with extra flags: -I
[8/5/2020, 4:43:46 PM] [HB Supervisor] Started Homebridge v1.2.0-beta.33 with PID: 26678
[8/5/2020, 4:43:46 PM] Loaded config.json with 3 accessories and 6 platforms.
[8/5/2020, 4:43:46 PM] ---
[8/5/2020, 4:43:47 PM] Loaded plugin: [email protected]
[8/5/2020, 4:43:47 PM] Registering accessory 'homebridge-accessory-bandwidth-quality.bandwidth-quality'
[8/5/2020, 4:43:47 PM] ---
[8/5/2020, 4:43:47 PM] Loaded plugin: [email protected]
[8/5/2020, 4:43:47 PM] Registering platform 'homebridge-config-ui-x.config'
[8/5/2020, 4:43:47 PM] ---
[8/5/2020, 4:43:47 PM] Loaded plugin: [email protected]
[8/5/2020, 4:43:47 PM] Registering platform 'homebridge-dyson-pure-cool.DysonPureCoolPlatform'
[8/5/2020, 4:43:47 PM] ---
[8/5/2020, 4:43:48 PM] Loaded plugin: [email protected]
[8/5/2020, 4:43:48 PM] Registering platform 'homebridge-harmony.HarmonyHubWebSocket'
[8/5/2020, 4:43:48 PM] ---
[8/5/2020, 4:43:48 PM] Loaded plugin: [email protected]
[8/5/2020, 4:43:48 PM] Registering platform 'homebridge-platform-wemo.BelkinWeMo'
[8/5/2020, 4:43:48 PM] ---
[8/5/2020, 4:43:48 PM] Loaded plugin: [email protected]
[8/5/2020, 4:43:48 PM] Registering accessory 'homebridge-ssh.SSH'
[8/5/2020, 4:43:48 PM] ---
[8/5/2020, 4:43:48 PM] Loaded plugin: [email protected]
[8/5/2020, 4:43:48 PM] Registering accessory 'homebridge-unifi-occupancy-sensor.UniFi Occupancy Sensor'
[8/5/2020, 4:43:48 PM] ---
[8/5/2020, 4:43:49 PM] [HB Supervisor] Homebridge Process Ended. Code: null, Signal: SIGILL

@beele
Copy link
Owner

beele commented Aug 5, 2020

Make a basic config.json file with only this plugin configured.
Place that file in a folder you remember.
Open a terminal and execute: homebridge -D -U FULL_PATH_TO_FOLDER/
This should run a new homebridge instance using the config from that folder

@twynne
Copy link
Author

twynne commented Aug 5, 2020

Not sure if that worked, but I get the following output in terminal:

wl21:node_modules homeserver$ homebridge -D -U /Users/homeserver/homebridge2
[05/08/2020, 17:54:54] Loaded config.json with 0 accessories and 1 platforms.
[05/08/2020, 17:54:54] ---
[05/08/2020, 17:54:55] Loaded plugin: [email protected]
[05/08/2020, 17:54:55] Registering accessory 'homebridge-accessory-bandwidth-quality.bandwidth-quality'
[05/08/2020, 17:54:55] ---
[05/08/2020, 17:54:55] Loaded plugin: [email protected]
[05/08/2020, 17:54:55] Registering platform 'homebridge-config-ui-x.config'
[05/08/2020, 17:54:55] ---
[05/08/2020, 17:54:55] Loaded plugin: [email protected]
[05/08/2020, 17:54:55] Registering platform 'homebridge-dyson-pure-cool.DysonPureCoolPlatform'
[05/08/2020, 17:54:55] ---
[05/08/2020, 17:54:56] Loaded plugin: [email protected]
[05/08/2020, 17:54:56] Registering platform 'homebridge-harmony.HarmonyHubWebSocket'
[05/08/2020, 17:54:56] ---
[05/08/2020, 17:54:56] Loaded plugin: [email protected]
[05/08/2020, 17:54:56] Registering platform 'homebridge-platform-wemo.BelkinWeMo'
[05/08/2020, 17:54:56] ---
[05/08/2020, 17:54:57] Loaded plugin: [email protected]
[05/08/2020, 17:54:57] Registering accessory 'homebridge-ssh.SSH'
[05/08/2020, 17:54:57] ---
[05/08/2020, 17:54:57] Loaded plugin: [email protected]
[05/08/2020, 17:54:57] Registering accessory 'homebridge-unifi-occupancy-sensor.UniFi Occupancy Sensor'
[05/08/2020, 17:54:57] ---
Illegal instruction: 4

@beele
Copy link
Owner

beele commented Aug 8, 2020

Hmm this seems really weird => Illegal instruction: 4 which is something, if coming from my plugin, which I've never seen before.

@beele
Copy link
Owner

beele commented Aug 17, 2020

If you fully remove the plugin and reinstall it, what does the full install log say?

@beele
Copy link
Owner

beele commented Sep 26, 2020

Closing due to inactivity

@beele beele closed this as completed Sep 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants