Hi,
First of all, I am quite new to Linux and the kind of programming I have ventured into. So please bare with me.![Smile :)]()
Second, I know I could probably find what I am trying to make on GitHub, but I want to do it myself. It is more fun (and frustrating).
I am working on a headless spotify player for my kids, using a RPi 5. I have a player written in JavaScript that is run in chromium. I then have a python script to control volume with input from a rotary encoder, and a finally a python script handling the control of the player. I have a webserver running using nginx and gunicorn. Nginx and gunicorn are started as system services upon boot. It all works perfectly when logged in via VNC and starting browser plus python scripts from terminal.
However, I would like to make the system completely headless and start it all from boot. The internet suggested several methods like systemd, rc.local, and crontab. I can start it all upon boot using crontab, but it starts with errors, and nothing is working.
I have tried starting the browser in a headless state as a system service, and then manually starting the scripts. Then they start up as they should but no sound is played. I have upon suggestions from chatGPT-4o tried setting up PulseAudio but cannot get it to work.
I assume that the reason why things so far only works when logged in, and starting the browser in headfull mode, is that some to me unknown required services are not started until the GUI is loaded. I am using chatGPT-4o for troubleshooting, but I feel like I am running in circles now.
So can any of you clever people help me out?
First of all, I am quite new to Linux and the kind of programming I have ventured into. So please bare with me.

Second, I know I could probably find what I am trying to make on GitHub, but I want to do it myself. It is more fun (and frustrating).
I am working on a headless spotify player for my kids, using a RPi 5. I have a player written in JavaScript that is run in chromium. I then have a python script to control volume with input from a rotary encoder, and a finally a python script handling the control of the player. I have a webserver running using nginx and gunicorn. Nginx and gunicorn are started as system services upon boot. It all works perfectly when logged in via VNC and starting browser plus python scripts from terminal.
However, I would like to make the system completely headless and start it all from boot. The internet suggested several methods like systemd, rc.local, and crontab. I can start it all upon boot using crontab, but it starts with errors, and nothing is working.
I have tried starting the browser in a headless state as a system service, and then manually starting the scripts. Then they start up as they should but no sound is played. I have upon suggestions from chatGPT-4o tried setting up PulseAudio but cannot get it to work.
I assume that the reason why things so far only works when logged in, and starting the browser in headfull mode, is that some to me unknown required services are not started until the GUI is loaded. I am using chatGPT-4o for troubleshooting, but I feel like I am running in circles now.
So can any of you clever people help me out?
Statistics: Posted by Gormd — Sat Dec 14, 2024 1:20 pm