hsolo
New Member
Posts: 9
|
Post by hsolo on Jan 16, 2019 4:21:12 GMT -8
Hi SDL,
What happens to the system after a power failure? Will it boot up and start automatically or will I have to start the program running via the command line? And the same question but in reference to loss of wifi? Will it connect on its own after the signal resumes or will ai have to reconnect manually?
Thanks, HS
|
|
|
Post by SDL on Jan 16, 2019 12:43:22 GMT -8
You have to program the Raspberry Pi to start SGS after a power failure. Lots of tutorials to show you how to do that.
Otherwise you need to restart on the command line.
Connecting up to the WiFi should happen automatically by the operating system if you have it set up properly.
BP
|
|
hsolo
New Member
Posts: 9
|
Post by hsolo on Jan 17, 2019 3:38:02 GMT -8
Hey SDL,
Well we can definitely check off:
“Learn about the Raspberry Pi and installing software on the Pi”
Holy moly, so much to learn. There are 5 different ways to get a program to run at boot time. I am going to choose the “systemd” approach. I don’t know enough yet to make an educated decision as to why this method is better for this purpose.....
I will make a post with everything I enter in the terminal. Keep your eye on me and shout out if I go wildly astray.
Thanks, HS
|
|
|
Post by lbendlin on Jan 21, 2019 12:22:11 GMT -8
A slightly less complex approach is including the call to your script in /etc/rc.local - just make sure to spawn the process, and be aware that it will run as root (which may not be a bad thing). For example:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
/usr/bin/tvservice -o
echo 0 | tee /sys/class/leds/led1/brightness
# disable console blanking on PiTFT
sudo sh -c "TERM=linux setterm -blank 0 >/dev/tty0"
sudo /home/pi/buttons.py &
exit 0
|
|