-
Notifications
You must be signed in to change notification settings - Fork 460
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
Autostart Sonos Api in a Raspberry Pi #20
Comments
I'm using pm2 to handle all of this. https://github.com/Unitech/pm2 Basically, install pm2: $ npm install -g pm2 Untested steps, I might have slipped on some commands, but you probably get the drift. |
It works like a charm! This is my code Thankyou very much. Good Job |
Hi there, I've been following these steps, and they seem to work fine without any fatal errors or anything, but after restarting the Pi, the service on port 5005 isn't running. Is there anywhere I can go to check for errors? Your suggestions are most welcome. |
I've had some experiences that the pm2.dump file is cleared when rebooting for some odd reason, and I'm not alone: Unitech/pm2#1035 However, this is not consistent, and my workaround was to run
|
I thought that they had fixed it, but apparently it is still an open issue. |
Even making the pm2.dump immutable didn't help on reboot for me. Any additional suggestions? |
@dghenderson The way I have been using PM2 with raspberry pi 3 works for me. After a reboot the sonos api autostarts. cd /your/http-api/folder/ I'm not an expert but this is how I managed to get it to work. |
@dghenderson Did you install the startup scripts using If you see the PM2 process in your process list after bootup, the startup works, but the resurrection does not. If you don't see the PM2 process at all, startup hasn't been installed correctly. It might identify the incorrect startup system, for a clean debian/raspbian jessie, it should be |
Just to let you guys know, I was a bit impatient saying it won't load on boot, because it took a few seconds, but I noticed the script was running after a reboot of the Pi by itself, and I was able to access the index page on port 5005. |
Ah @jishi I think I did NOT do the startup scripts correctly, and needed to specify systemd. Working on reboot now, thanks! Haven't needed to keep dump.pm2 immutable either (so far). |
This is no longer working anymore, I did what @GregRocket described, rebooted the Pi and the service doesn't run anymore. Is there a solid way of autostart? |
https://www.axllent.org/docs/view/nodejs-service-with-systemd/ This works for me on the RP. |
I'll try this, although looking at, I have no idea what to do. Can you output your terminal steps please? I have done what was listed above in this issue, but when restarting the Pi, the service is not running. |
File
On time thingy Enable the service Start the service Stop the service Status the service Example respons
|
@jishi Sorry, I didn't see your comment about instaling the startup scripts. I did this, which I don't remember doing before, have just rebooted, and I believe the Sonos API is running on boot now! Will do a couple more tests, but I believe I'm now sorted, thanks. FYI I think this should be added onto the main ReadMe file |
Hi
First of all I thank you for your effort.
I'm trying to autostart this API on a Raspberry Pi, but have not been successful. I can start it manually
Could you tell me how?
Best regards
The text was updated successfully, but these errors were encountered: