-
Notifications
You must be signed in to change notification settings - Fork 104
Software 4. Updating the Code
Please note that the CT numbers changed from using 0-5 to using 1-6 in November 2022. This simply means that channel 0 is now called channel 1 (and so on). If you installed the power monitor prior to November 2022, you're most likely using the software version with CT numbers 0-5. If you update to the latest software, the power monitor will start using channel numbers 1-6, which will impact your InfluxDB measurements and Grafana dashboards. Therefore, I do not recommend updating old installations to the latest version. If you have not collected any power monitor data (or are fine with abandoning what you have collected), you can proceed to upgrade. You'll also have to update your Grafana dashboard queries manually.
Caution: Following this procedure will update your local config.py
file and overwrite your calibration constants! We will backup your config.py
file before updating your code. If you have not calibrated your unit yet, you don't need to worry about steps 2 or 3.
-
Login to your Pi's terminal, and navigate to the project root directory:
cd ~/rpi_power_monitor # or, if you're on the older software: cd ~/rpi-power-monitor
-
Copy your current
config.py
file to create a backup:cp config.py config.py.backup
-
Stash any changes that you've made to the files in this folder with:
git stash
-
Update the code from Git and merge the changes into your local folder:
git pull
-
Update Python package dependencies:
pip3 install -r requirements.txt
-
Replace the values for
ct_phase_calibration
andGRID_VOLTAGE
in the newconfig.py
file. -
If you've already set the software up as a service, restart the service with:
sudo systemctl restart power-monitor
-
Verify that the software is running:
sudo systemctl status power-monitor