Closed jensenoz closed 5 months ago
Hi Jensen(?),
Have you built your Pi from the Homebridge Raspbian Image, as NPM should have been pre-installed.
It's mentioned in Step 1 in the setup.md pre-req's.
- G.
Hi Greig,
Did indeed. I installed the Homebridge product from the imaging software. It looks like an update has just been applied.
The odd thing is that I had to also manually install the Homebridge CUBS plugin and I'm also getting this message when running the step 2 command.
Assuming project name = JACKT, and setting C-Gate project.start & project.default values accordingly. '/usr/local/bin/cgate/tag\JACKT.xml' -> '/usr/local/bin/cgate/tag/JACKT.xml' Skipped: already in config.json Warning: Stopping homebridge.service, but it can still be activated by: homebridge.timer Exited step 2 OK.
Hope that helps.
I should say I'm building this on a different network to where my CBUS CNI is based (do some work in the office and home is where the CBUS network is). I don't know if that matters to the beautiful product you created.
Regards,
John Jensen
If it helps I've formated by sd card and re-run the process. Here is the actual error message.
download jq: Reading package lists... Done Building dependency tree... Done Reading state information... Done jq is already the newest version (1.6-2.1). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
download homebridge-cbus: ./setup.sh: line 43: npm: command not found
The odd thing is that I had to also manually install the Homebridge CUBS plugin ...
That's to be expected as NPM was meant to have installed it.
I wonder if this is your issue: https://www.reddit.com/r/homebridge/comments/o0eicr/suddenly_getting_npm_not_found_on_homebridge_via/
sudo apt-get update && apt-get upgrade
was this person's fix.
- G.
Hi Greig,
My thanks for the suggestion.
I tried your suggested command:
sudo apt-get update && apt-get upgrade
and got the following response.
**_pi@homebridge:~ $ sudo apt-get update && apt-get upgrade
Get:1 https://repo.homebridge.io stable InRelease [3,242 B]
Get:2 http://archive.raspberrypi.org/debian bullseye InRelease [23.7 kB]
Get:3 http://raspbian.raspberrypi.org/raspbian bullseye InRelease [15.0 kB]
Get:4 https://repo.homebridge.io stable/main armhf Packages [570 B]
Get:5 http://archive.raspberrypi.org/debian bullseye/main armhf Packages [279 kB]
Get:6 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf Packages [13.2 MB]
Fetched 13.5 MB in 19s (708 kB/s)
Reading package lists... Done
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
Next, I look at the provided command and assumed what you meant was the following (found at step 20 in your doco):
sudo apt-get update && sudo apt-get upgrade -y
I had success with the above command.
Lastly, I continued on with steps 21 to 25 but got the same error message again.
download jq: Reading package lists... Done Building dependency tree... Done Reading state information... Done jq is already the newest version (1.6-2.1). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
download homebridge-cbus: ./setup.sh: line 43: npm: command not found_**
To be completely transparent I'm running the above testing on a raspberry pi 4
Regards,
John Jensen
@greiginsydney I will run an install tomorrow and have a look.
Hi @greiginsydney @jensenoz I struck the same problem with NPM and Node not appearing to be installed using the latest image on github and also direct from raspberry pi imager.
Hello @greiginsydney @jensenoz From this link https://github.com/homebridge/homebridge-raspbian-image/issues/87#issuecomment-1175079866
"They are included as part of the Homebridge APT package for exclusive use by homebridge. If you need Node/NPM for other things, you can install then whatever way you like, it won't impact the Homebridge installation.
If you want to access the homebridge node environment via SSH, run sudo hb-shell and it will drop you into it."
There is a few changes to raspberry pi OS and Homebridge which will need a little attention in the instructions. The default “pi” user is being removed https://www.raspberrypi.com/news/raspberry-pi-bullseye-update-april-2022/ pi user and password can be added with raspberry pi imager tool before image is written to sd.
@greiginsydney In raspberry pi imager select Homebridge image. In advanced settings, setup user pi and a password. Set hostname now is not a bad idea eg "homebridge" I wouldn't do any other settings here especially not wifi. Write image to SD.
After first boot SSH to pi.
Update and reboot.
sudo apt update && sudo apt upgrade -y
sudo reboot
Enable "Wait For Network At Boot"
sudo raspi-config nonint do_boot_wait 0
Install homebridge-cbus
Enter hb shell
sudo hb-shell
sudo hb-service add homebridge-cbus
Exit hb shell
exit
Transfer xml to /home/pi
Install subversion
sudo apt install subversion -y
Download Greig's script
svn export https://github.com/DarylMc/Homebridge-cbus-installer/trunk/code/ ~ --force
sudo chmod +x setup.sh
sudo -E -H ./setup.sh step1
After the reboot take a break for 5-10 minutes.
Run the next script
sudo -E ./setup.sh copy
A huge thanks @DarylMc for all the work and @greiginsydney for managing the ticket. For less than techie people like myself, I'm bloody grateful. I have access to a CNI-based CBUS network and multiple SD cards with a spare pi that I'm happy to run a test client against when it's ready to go. One question that I do have @DarylMc whilst you are here. ;) Do you know if a very vanilla Homebridge install with the homebridge-cbus addon instead of all of the above is needed if you have a CBUS 5500AC2? https://www.se.com/ww/en/product/5500AC2/application-controller-spacelogic-cbus-rs232-485-ethernet-din-mount-24v-dc/
I am not familiar with the device but I believe you would also use one of the built in CNI and connect via TCP like a regular CNI. So then yes you need all the setup as per Greig's instructions.
Damn. Ahh well, I thought I would ask. LOL!!! The 5500AC2 is an upgrade to the 5500SHAC (https://www.se.com/ww/en/product/5500SHAC/wiser-for-cbus-automation-controller-rs232-485-ethernet-din-mount-24v-dc/) and I hoped it was more than just a combo USB, RS232 and RJ45 with a web server box. I remember the days when each of those devices were I THINK $500 ish each. OUCH!!! I get the 5500SHAC had more than that as well but again I hoped the CNI concept had been replaced. I still dream of a day when they will finally support Homekit. :) One can hope but then not even Wiser does yet. :(
The SHAC can do some things a lot better than Homebridge and HomeKit.
https://github.com/greiginsydney/Homebridge-cbus-installer/issues/22#issuecomment-1175601119
@greiginsydney I think this will work but I don't have a CBus network to test at the moment. After first boot SSH to pi, update and reboot.
sudo apt update && sudo apt upgrade -y && sudo reboot
Install homebridge-cbus Enter hb shellsudo hb-shell
sudo hb-service add homebridge-cbus
Exit hb shellexit
Transfer xml to /home/pi Install subversionsudo apt install subversion -y
Download Greig's scriptsvn export https://github.com/greiginsydney/Homebridge-cbus-installer/trunk/code/ ~ --force
Delete homebridge-cbus installation lines 41-44 in setup.shsudo nano setup.sh
echo "" echo ">> download homebridge-cbus:" npm install -g homebridge-cbus echo "======================================="
Save changes to setup.sh ctrl x y enter
sudo chmod +x setup.sh
sudo -E -H ./setup.sh step1
I setup a small CBus network and tested this method today. Seems OK
@greiginsydney @jensenoz I edited the comment above to assist setting up with the latest image. https://github.com/greiginsydney/Homebridge-cbus-installer/issues/22#issuecomment-1175601119
@jensenoz Thanks for your help. This issue has been addressed by the following updates and can be closed. https://github.com/greiginsydney/Homebridge-cbus-installer/pull/26 https://github.com/greiginsydney/Homebridge-cbus-installer/pull/24
Hello Greig, I have been using this plugin for a while now and it's awesome!!!
Yesterday I was redoing Homebridge on a new pi and Greig's script seems to have disappeared?
svn export https://github.com/DarylMc/Homebridge-cbus-installer/trunk/code/ ~ --force
Hello Greig,
I have been using this plugin for a while now and it's awesome!!!
Yesterday I was redoing Homebridge on a new pi and Greig's script seems to have disappeared?
svn export https://github.com/DarylMc/Homebridge-cbus-installer/trunk/code/ ~ --force
I think you have my fork in that link. I haven't looked in a while but you should follow Greigs setup info and links.
As per @DarylMc 's comment yesterday @Maccacca , I don't believe you're referencing this (my) repo.
As per @DarylMc 's comment yesterday @Maccacca , I don't believe you're referencing this (my) repo.
All sorted, I have just done something stupid at my end. I followed Greigs setup info and it worked perfectly. Thanks!
When running the following command:
sudo -E -H ./setup.sh step1
An error message pops up saying that the NPM package is not installed. It references line 43 and if install NPM and re-run the command it works fine.