Relay Setup Info

boot src: http://blog.scphillips.com/posts/2013/07/getting-a-python-script-to-run-...
These steps will be completed and saved on the image, but tracking on what was done to set up the service so that
the bluetooth inits on startup.. waiting for a client.

copy files from console to relay via ssh

cd /home/pi/bin
scp relay.zip pi@PI_ZERO_IP:relay.zip
scp piaccservice.sh pi@PI_ZERO_IP:piaccservice.sh
scp piaccbt.py pi@PI_ZERO_IP:piaccbt.py

ssh to PI_ZERO_IP

ssh 192.168.1.2 (enter pi pwd)
mkdir bin
sudo cp piaccbt.py /usr/bin
sudo chmod 755 /usr/bin/piaccbt.py

Extract the relay files.. this will do the gpio

unzip relay.zip bin
cd bin
cd relay

Copy the files into the usr/bin files and sets to 755 by running the install
(or put the path to relay_install in the cmd)

sudo ./relay_install

cd back down to bin
cd ..
copy the service sh to init

sudo cp piaccservice.sh /etc/init.d
sudo chmod 755 /etc/init.d/piaccservice.sh

Make sure script is run at the right time

sudo update-rc.d piaccservice.sh defaults

Reboot the pi zero controller to see if the service starts.
sudo reboot

wait a few minutes for the pizero to boot....tick..tock..
ssh 192.168.1.2
check the service daemon by typing:
/etc/init.d/piaccservice.sh status
It should return something similar to this:
pi@yourpizero:~ $ /etc/init.d/piaccservice.sh status
● piaccservice.service - LSB: piACC bluetooth service
Loaded: loaded (/etc/init.d/piaccservice.sh; generated; vendor preset: enabled)
Active: active (running) since Sun 2018-10-28 13:50:36 UTC; 1min 49s ago
Docs: man:systemd-sysv-generator(8)
Process: 235 ExecStart=/etc/init.d/piaccservice.sh start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/piaccservice.service
└─295 python /usr/bin/piaccbt.py

Oct 28 13:50:34 piacc1 systemd[1]: Starting LSB: piACC bluetooth service...
Oct 28 13:50:36 piacc1 piaccservice.sh[235]: Starting system piaccbt daemon:.
Oct 28 13:50:36 piacc1 systemd[1]: Started LSB: piACC bluetooth service.
pi@yourpizero:~ $

Next try a bluetooth connection to it from your phone.
nice.. it all works correct?
"a" for all on, I heard the relay cycle through each relay at 1 sec intervals.
"x" for all off, I heard the relay cycle through each relay at 1 sec intervals.

Done.

Time to make an image snapshot,,, done.
sudo shutdown

44.4968817,101.0329761,06-24-2019 09:36:03 PM,!Bio break