maxi07 / Teams-Presence

Displays the current Microsoft Teams presence as LED with a raspberry pi.
MIT License
40 stars 16 forks source link

Auto start teams-presence.py #11

Closed AwesomeWaffle closed 2 years ago

AwesomeWaffle commented 2 years ago

I have this setup and working with a UnicorHD LED hat. But I have to SSH in to start teams-presence.py and it quits working if I close out of the SSH session. I'd like to have this auto start when the Pi boots, and run indefinitely. I've tried using auto-start like this https://www.raspberrypi-spy.co.uk/2015/02/how-to-autorun-a-python-script-on-raspberry-pi-boot/ but I have to connect with a monitor and keyboard to complete the azure config, and then after half an hour or so it will need me to re authenticate with microsoft. I've also tried setting up systemd to run the script as a service, but I wasn't successful with that either.

Is there a good way to handle auto starting teams-presence.py that will keep it running indefinately.

I love this project and have one setup outside my home office and at my work office. Thanks!

maxi07 commented 2 years ago

Hey @AwesomeWaffle , I have just added a wiki explaining the steps: https://github.com/maxi07/Teams-Presence/wiki/Run-at-startup

this will run the script at boot. Please let me know if this works for you!

AwesomeWaffle commented 2 years ago

I followed your instructions, but I haven't been able to get it working yet. I think it must be something with screen. Calling ~/startup/startup.sh works fine to start the presence script, but nothing happens when I run su - pi -c "screen -dm -S pistartup ~/startup/startup.sh". I'll continue to troubleshoot.

maxi07 commented 2 years ago

ah - my fault. I missed the sudo tag in the wiki entry. Now fixed. Please copy the whole script for the startup and try again:

# Start teams-presence
cd ~/Teams-Presence/
sudo python3 teams-presence.py
exit
AwesomeWaffle commented 2 years ago

Ah, I should have noticed that, it works now! Thank you!