-
Notifications
You must be signed in to change notification settings - Fork 40
(RPi) Start HAP on Reboot
This page has instructions on how to start HAP-NodeJS during boot, on your Raspberry Pi!
Ensure you have setup the 'Wait for Boot' process. If you haven't, follow the steps in this link here.
###Also, ensure your HAP-NodeJS directory is /home/pi/HAP-NodeJS. If you used my video to install, you should be fine.
The first command you want to run is: cd ~
This command returns you to your home directory.
The second command you want to run is: sudo npm install forever -g
This command starts the installation process. This can take 5-10 minutes. If it takes longer, reboot your Raspberry Pi
The third command you want to run is: sudo nano /etc/rc.local
This command opens nano and allows you to edit the rc.local file
Now, you want to add code before the "exit 0" line. Add this line before "exit 0":
sudo forever start /home/pi/HAP-NodeJS/BridgedCore.js
Be sure to change BridgedCore.js to CameraCore.js/Core.js if you are using Core.js or CameraCore.js.
This tells the Raspberry Pi to start HAP-NodeJS at startup
Save and exit the rc.local file once you are done. Then, reboot your Pi and HAP-NodeJS should automatically start!
Learn more about forever here.