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

Issue with Homebridge as a Service with Broadlink #284

Closed
bobjoylove opened this issue Mar 11, 2018 · 6 comments
Closed

Issue with Homebridge as a Service with Broadlink #284

bobjoylove opened this issue Mar 11, 2018 · 6 comments

Comments

@bobjoylove
Copy link

bobjoylove commented Mar 11, 2018

Hey I'm having an issue with Broadlink only when I run Homebridge as a server. It works great if I run homebridge from the command line. I followed the instructions here and my JSON and service is located in var/homebridge and /usr/local/bin/homebridge as per steps 2.1 and 5

Mar 11 12:29:42 raspberrypi homebridge[8551]: [2018-3-11 12:29:42] Registering platform 'homebridge-legacy-plugins.LIFx'
Mar 11 12:29:42 raspberrypi homebridge[8551]: [2018-3-11 12:29:42] Registering platform 'homebridge-legacy-plugins.SmartThings'
Mar 11 12:29:42 raspberrypi homebridge[8551]: [2018-3-11 12:29:42] Registering platform 'homebridge-legacy-plugins.TelldusLive'
Mar 11 12:29:42 raspberrypi homebridge[8551]: [2018-3-11 12:29:42] Registering platform 'homebridge-legacy-plugins.ZWayServer'
Mar 11 12:29:42 raspberrypi homebridge[8551]: [2018-3-11 12:29:42] ---
Mar 11 12:29:43 raspberrypi homebridge[8551]: [2018-3-11 12:29:43] Loaded plugin: homebridge-smartthings
Mar 11 12:29:43 raspberrypi homebridge[8551]: [2018-3-11 12:29:43] Registering platform 'homebridge-smartthings.SmartThings'
Mar 11 12:29:43 raspberrypi homebridge[8551]: [2018-3-11 12:29:43] ---
Mar 11 12:29:44 raspberrypi homebridge[8551]: [2018-3-11 12:29:44] Loaded plugin: homebridge-smartthings-routine
Mar 11 12:29:44 raspberrypi homebridge[8551]: [2018-3-11 12:29:44] Registering accessory 'homebridge-smartthings-routine.SmartThingsRoutine'
Mar 11 12:29:44 raspberrypi homebridge[8551]: [2018-3-11 12:29:44] ---
Mar 11 12:29:44 raspberrypi homebridge[8551]: [2018-3-11 12:29:44] Loaded plugin: homebridge-smartthings-routine-triggers
Mar 11 12:29:44 raspberrypi homebridge[8551]: [2018-3-11 12:29:44] Registering accessory 'homebridge-smartthings-routine-triggers.HomebridgeRoutineTrigger'
Mar 11 12:29:44 raspberrypi homebridge[8551]: [2018-3-11 12:29:44] ---
Mar 11 12:29:45 raspberrypi homebridge[8551]: [2018-3-11 12:29:45] Loaded plugin: homebridge-broadlink-rm
Mar 11 12:29:45 raspberrypi homebridge[8551]: [2018-3-11 12:29:45] Registering platform 'homebridge-broadlink-rm.BroadlinkRM'
Mar 11 12:29:45 raspberrypi homebridge[8551]: [2018-3-11 12:29:45] ---
Mar 11 12:29:45 raspberrypi homebridge[8551]: [2018-3-11 12:29:45] Loaded config.json with 0 accessories and 2 platforms.
Mar 11 12:29:45 raspberrypi homebridge[8551]: [2018-3-11 12:29:45] ---
Mar 11 12:29:45 raspberrypi homebridge[8551]: [2018-3-11 12:29:45] Loading 2 platforms...
Mar 11 12:29:45 raspberrypi homebridge[8551]: [2018-3-11 12:29:45] [SmartThings] Initializing homebridge-smartthings.SmartThings platform...
Mar 11 12:29:45 raspberrypi homebridge[8551]: [2018-3-11 12:29:45] [SmartThings] Fetching Smart Things devices.
Mar 11 12:29:45 raspberrypi homebridge[8551]: [2018-3-11 12:29:45] [Broadlink RM] Initializing BroadlinkRM platform...
Mar 11 12:29:45 raspberrypi homebridge[8551]: /usr/lib/node_modules/homebridge-broadlink-rm/node_modules/mkdirp/index.js:90
Mar 11 12:29:45 raspberrypi homebridge[8551]: throw err0;
Mar 11 12:29:45 raspberrypi homebridge[8551]: ^
Mar 11 12:29:45 raspberrypi homebridge[8551]: Error: EACCES: permission denied, mkdir '/home/homebridge'
Mar 11 12:29:45 raspberrypi homebridge[8551]: at Object.fs.mkdirSync (fs.js:905:18)
Mar 11 12:29:45 raspberrypi homebridge[8551]: at sync (/usr/lib/node_modules/homebridge-broadlink-rm/node_modules/mkdirp/index.js:71:13)
Mar 11 12:29:45 raspberrypi homebridge[8551]: at sync (/usr/lib/node_modules/homebridge-broadlink-rm/node_modules/mkdirp/index.js:77:24)
Mar 11 12:29:45 raspberrypi homebridge[8551]: at Function.sync (/usr/lib/node_modules/homebridge-broadlink-rm/node_modules/mkdirp/index.js:77:24)
Mar 11 12:29:45 raspberrypi homebridge[8551]: at LocalStorage.parseStorageDirSync (/usr/lib/node_modules/homebridge-broadlink-rm/node_modules/node-persist/src/local-storage.js:619:2
Mar 11 12:29:45 raspberrypi homebridge[8551]: at LocalStorage.initSync (/usr/lib/node_modules/homebridge-broadlink-rm/node_modules/node-persist/src/local-storage.js:142:14)
Mar 11 12:29:45 raspberrypi homebridge[8551]: at Object.nodePersist.initSync (/usr/lib/node_modules/homebridge-broadlink-rm/node_modules/node-persist/src/node-persist.js:37:32)
Mar 11 12:29:45 raspberrypi homebridge[8551]: at Object.init (/usr/lib/node_modules/homebridge-broadlink-rm/node_modules/homebridge-platform-helper/helpers/persistentState.js:10:15)
Mar 11 12:29:45 raspberrypi homebridge[8551]: at new HomebridgePlatform (/usr/lib/node_modules/homebridge-broadlink-rm/node_modules/homebridge-platform-helper/platform.js:14:21)
Mar 11 12:29:45 raspberrypi systemd[1]: homebridge.service: Main process exited, code=exited, status=1/FAILURE

Here's the content of /home

cd /home/
pi@raspberrypi:/home $ ls
pi

Thanks!

@lprhodes
Copy link
Owner

lprhodes commented Mar 13, 2018

@bobjoylove I assume you got this working given the others issues? If not, does sudo homebridge work? If so then that should give us a good starting point to determining what the issue is.

@bobjoylove
Copy link
Author

Hi lprhodes

Broadlinkrm works great if I start Homebridge from the command line.

It's when I try to autostart Homebridge as a service that I have the issue.

It just looks like a hardcoded directory issue?

@lprhodes
Copy link
Owner

@bobjoylove
Copy link
Author

Woot woot!
I made the following file changes to both JSONs

sudo nano /home/pi/.homebridge/config.json
sudo nano /var/homebridge/config.json
before:

                       "platform": "BroadlinkRM",
			"name": "Broadlink RM",
			"accessories": [

after:

                       "platform": "BroadlinkRM",
			"name": "Broadlink RM",
			"homebridgeDirectory": "/var/homebridge/",
			"accessories": [

fixed and confirmed working. Thank you!

@lprhodes
Copy link
Owner

Awesome. I'm glad it's sorted.

@cubilon
Copy link

cubilon commented Mar 14, 2018

could be useful avoiding the "homebridgeDirectory", this becouse sometimes happens to launch different homebridge instances from different users but using the same config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants