You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow the Configure Wi-Fi and SSH > Wifi in the complete-install.
Use your phone connection sharing with a specific pass and SSID and the RPi will automatically connect to it.
Configure
nano ~/homepy/.env
Set the ID to an unique value (you will use this ID to register the battery in the web interface.
Set the NO_BT3 if the battery has no EXTERNAL TEMPERATURE SENSOR
CREATE DATABASE `quantya`;
CREATE USER 'myuser' IDENTIFIED BY 'mypassword';
GRANT USAGE ON *.* TO 'myuser'@localhost IDENTIFIED BY 'mypassword';
GRANT USAGE ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword';
FLUSH PRIVILEGES;
Create a new script into /home/pi/wifi/process_job.sh
nano /home/pi/wifi/process_job.sh
And past this into it
#!/bin/sh
# redirect all output into a logfile
exec 1>> /home/pi/wifi/event.log 2>&1
case "$1" in
wlan0)
case "$2" in
CONNECTED)
# sync when wifi up
echo wlan0 connected
python3.7 /home/pi/homepy/jobs_process.py
;;
DISCONNECTED)
# do stuff on disconnect with wlan0
echo wlan0 disconnected
;;
*)
>&2 echo empty or undefined event for wlan0: "$2"
exit 1
;;
esac
;;
*)
>&2 echo empty or undefined interface: "$1"
exit 1
;;
esac
Make the script executable
sudp chmod +x /home/pi/wifi/process_job.sh
Register the script to wpa service
sudo wpa_cli -i wlan0 -a /home/pi/wifi/process_job.sh -B
Avoid dead lock
We have a script homepy/clear_lock.sh that clear the .LOCK files. We need this to run after booting.