-
Notifications
You must be signed in to change notification settings - Fork 2
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
Launch code upon startup for RPi SBCs #72
Comments
@sgbaird Done setting this up on the cobot. I followed the instructions on the website but had to make a few changes. After running
I found that the Also had to drop |
UPDATE: The blog post clarifies that I was looking back at this, because it seems to be a bit difficult to see the output from a terminal, motivated by debugging purposes. Within the crontab file, it's easy enough to log to a text file on the desktop for example: @reboot /usr/bin/python3 /home/pi/Desktop/my_file.py > /home/pi/Desktop/log.txt However, in order to see the active log, you would need to run a command to watch the file for updates. This would either require manually running something in a terminal, or perhaps having a systemd implementation on top of crontab. |
UPDATE: The blog post clarifies that I was looking back at this, because it seems to be a bit difficult to see the output from a terminal, motivated by debugging purposes. Within the crontab file, it's easy enough to log to a text file on the desktop for example: @reboot /usr/bin/python3 /home/pi/Desktop/my_file.py > /home/pi/Desktop/log.txt However, in order to see the active log, you would need to run a command to watch the file for updates. This would either require manually running something in a terminal, or perhaps having a systemd implementation on top of crontab. EDIT: not sure if rc.local is actually not recommended in general, and perhaps systemd is supported on Ubuntu. Then again, here is a recommendation that still uses crontab:
gnome-terminal -- /bin/sh -c '/path/to/script; exec bash' |
UPDATE: The blog post clarifies that I was looking back at this, because it seems to be a bit difficult to see the output from a terminal, motivated by debugging purposes. Within the crontab file, it's easy enough to log to a text file on the desktop for example: @reboot /usr/bin/python3 /home/pi/Desktop/my_file.py > /home/pi/Desktop/log.txt However, in order to see the active log, you would need to run a command to watch the file for updates. This would either require manually running something in a terminal, or perhaps having a systemd implementation on top of crontab. |
The previous command, with or without @reboot prepended, does not seem to work. Just a normal desktop appears. From what I understand, these two tasks should run independently. EDIT: I think I'm supposed to run
Overall confused. |
@Jonathan-Woo could you comment on this? (Or link to your comment elsewhere if you already added it) |
Are you still facing issues like you mentioned in the previous comment? Editing with |
I modified an |
@gursi26 @linx5o @Jonathan-Woo this applies to you. Ideally, we would have the RPis start running the device code by default on startup. @kenzo-aspuru-takata used crontab for the microscope I think. Out of five options mentioned here, crontab seems like the best. The OS doesn't load if an error is thrown in
etc/rc.local
..bashrc
runs every time a new terminal is opened.etc/init.d
seems to run both at shutdown and startup (i.e., if a while loop, then it wouldn't actually shut down?). Finally,systemd
is available only from the Jessie versions of Raspbian OS.This would also need to be run in the background (and if it throws an error, make sure it doesn't brick the whole system).
The text was updated successfully, but these errors were encountered: