piACC Mobile App

OS: Android

Currently, there is only an Android version written for the piACC.
The app allows you to use your mobile device to control any accessory connected to your piACC relay control unit.
Setup is best done prior to installing your piACC controller in your vehicle. You can also remove the piACC controller from the relay board and do it indoors if your unit is already installed. Make sure that the device is powered down prior to removing it from the relay board and be sure to touch the vehicle chassis to prevent static discharge which could damage the pi device.

Pairing your device

For the relay control unit to be able to talk to your mobile device it must first be paired. This is a standard practice across all bluetooth devices.
Pairing your device will require access to the relay controller either via ssh or via a monitor and keyboard.
SSH is probably the easiest way but will also require you to connect your relay device to wifi.
Either via SSH or via terminal you will need to set up bluetooth using bluetoothctl and then connect and trust your device by its MAC address.
The conversation should look like this:
You should also get a prompt on your device to accept the pairing, be sure to select Yes.

At this point your device is now paired and trusted with the controller and communications with the app should work.
Next, you will need to set your secret pin on the device.
This is done by editing the sbc.py file in the /usr/bin directory on the relay controller.
sudo nano /usr/bin/sbc.py
Change the line that reads unitkey="xxxxxx" to whatever you want your secret password to be.
Hit ctrl-X to close nano and Y to save over sbc.py.
You should now be ready to communicate with your unit.

piACC mobile App key

On the mobile app, click the button that says "Key".
Enter in the key you added to your device and click Save.

Connecting to the relay controller

On the mobile app click the "Connect" button.
This should bring up a list of bluetooth devices nearby including your relay controller if the pairing was successful.
Select your relay controller device from the dropdown and you should immediately start seeing the temperature reading of the device internal temperature in the bottom panel of the app.
This means that your app is talking to the relay device and ready to be installed in your vehicle.
Be sure to shutdown the relay controller cleanly, either using the prompt "sudo shutdown now" or by clicking the "down unit" button on the app.
The down unit or reboot unit buttons on the app will literally reboot or shutdown the relay unit, so use with caution.
If you accidentally shut down the unit, you will need to remove the battery power and plug it back in for the unit to boot again.
This is intentional so that you can shut down your unit if you need to replace the micro SD card or do work on the unit.
Simply powering off the piACC Relay Control Unit is not recommended. You should always "shut down" the unit prior to removing power. This can be done either using SSH, the android app, the console unit or by directly plugging a keyboard (physical or bluetooth) into the unit.

Finally, Install the relay device to your vehicle and connect the device to your vehicle's battery and test connectivity again.