Relay Setup Info

boot src:
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

ssh to PI_ZERO_IP

ssh (enter pi pwd)
mkdir bin
sudo cp /usr/bin
sudo chmod 755 /usr/bin/

Extract the relay files.. this will do the gpio

unzip 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 /etc/init.d
sudo chmod 755 /etc/init.d/

Make sure script is run at the right time

sudo update-rc.d 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..
check the service daemon by typing:
/etc/init.d/ status
It should return something similar to this:
pi@yourpizero:~ $ /etc/init.d/ status
● piaccservice.service - LSB: piACC bluetooth service
Loaded: loaded (/etc/init.d/; 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/ start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/piaccservice.service
└─295 python /usr/bin/

Oct 28 13:50:34 piacc1 systemd[1]: Starting LSB: piACC bluetooth service...
Oct 28 13:50:36 piacc1[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.


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