rbultman/raspberry-jam

Add blynk app as a service in next image release

Closed this issue · 5 comments

I have been running the blynk app as a service by following these instructions:

https://www.raspberrypi.org/documentation/linux/usage/systemd.md

It works fine, but can make troubleshooting more difficult since it is more difficult to get the output of the app

It doesn't need to be a service. The pi can be set up to auto-logon to the pi account and the app can be run from .bashrc or another login script.

I looked into rc.local, and there was a reason that it didn't seem like a good fit, but I don't recall what it was. Systemd was the only other thing I came across when googling autostarting stuff on the pi.

rc.local is the system startup file. .bashrc is the users start up file. That's how the hearth oven works...

Systemd is great for things that may need to be restarted after boot time. rc.local is only run at boot time, so it's best for one-time/always-on tasks. I'm pretty good with systemd, so pull me in if you need a hand with anything.

I had thought of a design using systemd as part of the the 'phone-home' concept, where the parameters are stored in a central server, and the RJam unit calls in for session-specific parameters and then uses those in the restart via systemd. I got sidetracked trying to get all the things working, but it's still a viable model for this sort of thing.

For now, the web server and blynk program are started at run time within the pi user account. The session parameters, sound card selection, etc are stored in a sqlite database on the pi.