Skip to content

Commit

Permalink
Remove autoupdater still not working
Browse files Browse the repository at this point in the history
  • Loading branch information
inonoob committed Feb 24, 2021
1 parent b408aff commit 72deec3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion TODO.MD
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ see github issues
## Possible Features

- [ ] Identify user by HRM device ID in order to pick correct user and password for Garmin Connect auto uploader
- [ ] Screensaver OLED in order to protect OLED display from burn-in effect. Screensaver for OLED display #27
- [ ] AutoUpdate/manual function of PiRowFlo
- [ ] Second BLE GATT server to passthrough SmartRow data to SmartRow App. Second BLE Server as Bluetooth Passthrough for SmartRow App #26
- [ ] Create Image of the project
Expand All @@ -24,6 +23,7 @@ profile


## DONE
- [x] 24.02.2021 Screensaver OLED in order to protect OLED display from burn-in effect. Screensaver for OLED display #27
- [x] 24.02.2021 Shutdown of Raspberry pi via Supervisor
- [x] 23.02.2021 Quit script gracefully in waterrowerthreads script
- [x] 21.02.2021 Add screen to project
Expand Down
9 changes: 0 additions & 9 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,6 @@ export python3_path=$(which python3)
export supervisord_path=$(which supervisord)
export supervisorctl_path=$(which supervisorctl)

echo " "
echo "------------------------------------------------------"
echo " set complete folder to be owned and group pi "
echo "------------------------------------------------------"
echo " "

sudo chown -R pi:pi $repo_dir


cp services/supervisord.conf.orig services/supervisord.conf
sudo chown root:root services/supervisord.conf.orig
sudo chmod 655 services/supervisord.conf.orig
Expand Down
16 changes: 11 additions & 5 deletions src/adapters/updater/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def updatePiRowFlo():
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
updatetmpfolder = "/tmp/pirowfloupdate"
updatefinaldest = BASE_DIR
#updatefinaldest = "/home/pi/test"

response = requests.get("https://api.github.com/repos/inonoob/pirowflo/releases/latest")
Version = response.json()["name"]
Expand Down Expand Up @@ -49,16 +50,21 @@ def updatePiRowFlo():
pirowfloupdatefolder = glob.glob(updatetmpfolder + "/inonoob-pirowflo-*")
if os.path.exists(updatefinaldest):
shutil.rmtree(updatefinaldest)
shutil.copytree(pirowfloupdatefolder[0], updatefinaldest, symlinks=True)
shutil.rmtree(updatetmpfolder)

cmdcopy = '/bin/su -c "/bin/cp -r '+pirowfloupdatefolder[0]+' '+updatefinaldest +'" '+ '- pi'
subprocess.run(cmdcopy,shell=True)
#shutil.copytree(pirowfloupdatefolder[0], updatefinaldest, symlinks=True)
#shutil.rmtree(updatetmpfolder)
cmdchangefolder = "cd " + BASE_DIR
subprocess.run(cmdchangefolder,shell=True)
print(" ")
print("=========== Starting ./install script to update! ===================")
print(" ")
print(BASE_DIR)
installcmd = BASE_DIR + "/install.sh"
#installcmd = "/home/pi/test/install.sh"

# installcmd = BASE_DIR + "/install.sh"
#
# subprocess.run(installcmd)
subprocess.run(installcmd)

if __name__ == "__main__":
updatePiRowFlo()

0 comments on commit 72deec3

Please sign in to comment.