Project for logging OBD data on a Raspberry Pi 3 using Raspbian, .NET Core 3.0 and a PiJuice
- Use Raspbian Lite
sudo apt install pijuice-base
Open PiJuice configuration file using: sudo nano /var/lib/pijuice/pijuice_config.JSON
- shutdown on no_power event
- start on power connected
{
"system_events": {
"no_power": {
"function": "SYS_FUNC_HALT_POW_OFF",
"enabled": true
}
},
"system_task": {
"enabled": true,
"wakeup_on_charge": {
"enabled": true,
"trigger_level": "0"
}
}
}
- enable RTC drivers
- sync RTC
Restart the PiJuice service sudo service pijuice start
- using bluetoothctl
- connect BT OBD
Add the following lines to /etc/rc.local using sudo nano /etc/rc.local
sudo rfcomm bind /dev/rfcomm0 <macaddr> && sudo chmod 0777 /dev/rfcomm0
Replace with the MAC-address for your OBD2 adapter found using bluetoothctl
- download from an url
- extract (possibly to /opt)
- handle time before BT connected (less than 30 seconds, more than 15 seconds in test)
- add app to rc.local or make service