Skip to content
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

No auto start, unless ssh? #355

Closed
Logan-Orr opened this issue May 7, 2022 · 16 comments
Closed

No auto start, unless ssh? #355

Logan-Orr opened this issue May 7, 2022 · 16 comments

Comments

@Logan-Orr
Copy link

Logan-Orr commented May 7, 2022

Hello! In the new PlV 1.3 update, the autostart is no longer working, i know how to manually start it and it works, but when i put the sudo python3 /home/Piano-LED-Visualizer/visualizer.py & in etc profile, it does not start, but when i ssh into it, it automatically starts up and the menu is shown with no commands entered, and if i close the ssh window, it stops working, how can i fix this?

@onlaj
Copy link
Owner

onlaj commented May 7, 2022

Hello.
#349 (comment)

I will try to fix that in future updates, for now try this workaround.

@Logan-Orr
Copy link
Author

So I looked at that yes, where would i find the crontab?

@onlaj
Copy link
Owner

onlaj commented May 7, 2022

Type:
sudo crontab -e

@Logan-Orr
Copy link
Author

Thanks bro u respond so quickly

@Logan-Orr
Copy link
Author

Also, this is a weird error, the visuizer is working, but i can not enter any commands because of this infinite loop of error
491B7B68-C4FA-4E13-BB8E-D06EC7CFFA4A

@onlaj
Copy link
Owner

onlaj commented May 7, 2022

Just press CTRL + C

@Logan-Orr
Copy link
Author

Ok

@Logan-Orr
Copy link
Author

Socket listening on: 192.168.1.185:8765
Socket listening on: 192.168.1.185:8765
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
Socket listening on: 192.168.1.185:8765
Socket listening on: 192.168.1.185:8765
Socket listening on: 192.168.1.185:8765
Socket listening on: 192.168.1.185:8765
Socket listening on: 192.168.1.185:8765
Socket listening on: 192.168.1.185:8765
Socket listening on: 192.168.1.185:8765
Socket listening on: 192.168.1.185:8765
Socket listening on: 192.168.1.185:8765
Socket listening on: 192.168.1.185:8765
Socket listening on: 192.168.1.185:8765
Socket listening on: 192.168.1.185:8765
Traceback (most recent call last):
File "/home/Piano-LED-Visualizer/visualizer.py", line 17, in
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
from webinterface import webinterface
File "/home/Piano-LED-Visualizer/webinterface/init.py", line 43, in
from webinterface import views
File "", line 1007, in _find_and_load
self.run()
File "/usr/lib/python3.9/threading.py", line 892, in run
File "", line 982, in _find_and_load_unlocked
File "", line 925, in _find_spec
File "", line 1349, in find_spec
self._target(*self._args, **self._kwargs)
File "/home/Piano-LED-Visualizer/webinterface/init.py", line 36, in start_server
File "", line 1321, in _get_spec
File "", line 1450, in find_spec
asyncio.run(main())
File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
File "", line 1490, in _fill_cache

@Logan-Orr
Copy link
Author

Am i missing a requirement?

@onlaj
Copy link
Owner

onlaj commented May 7, 2022

Are you trying to run script manually now or are those logs from the start-on-boot script?

@Logan-Orr
Copy link
Author

Start on boot

@onlaj
Copy link
Owner

onlaj commented May 7, 2022

Then don't worry about it. If it's the same case as in the other issue, then it's an error caused by the script trying to run before getting a wifi connection.

It can be temporarily fixed by adding a delay to the script's start.

@Logan-Orr
Copy link
Author

Ohhh, it could possibly be from the sudo python3 /home/piano etc. start script that i left in profile

@Logan-Orr
Copy link
Author

Yea thats what it was

@Logan-Orr
Copy link
Author

I have a idea, i was using a synthizer that was for raspi and it was headless, it would be awesome if you could combine the synth with the plv, and have a soundfont menu, the installation was one command and was fast, i can send you a link

@fredpineau
Copy link

Hello, I have created a specific systemctl service in /usr/lib/systemd/system like this one and it works fine on my side:

pi@raspberrypi:/usr/lib/systemd/system $ cat piano-visualiser.service
[Unit]
Description=Piano Visualizer
After=network-online.target
Wants=network-online.target

[Install]
WantedBy=multi-user.target

[Service]
ExecStart=sudo python3 /home/pi/Piano-LED-Visualizer/visualizer.py --display 1in3
Type=simple
User=pi
Group=pi
WorkingDirectory=/home/pi

and then enable it :

systemctl daemon-reload
systemctl enable piano-visualiser.service

@onlaj onlaj closed this as completed Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants