RPi4 / balenaOS 2.82.10+rev1 self-restart and overwrite of config.txt

And another update, if you need to make it easier, you can go the linux route / without gui:

  • Just install sqlite3 onto your system:
sudo apt update
sudo apt install -y sqlite3
  • Then get the database.sqlite like written above:
cd ~
scp -P22222 root@<IP>:/mnt/data/resin-data/balena-supervisor/database.sqlite .
  • extract the targetValues as json file from the database:
sqlite3 database.sqlite "SELECT targetValues FROM deviceConfig;" > targetValues.json
  • make your changes to the json file and write it back to the database
sqlite3 database.sqlite "UPDATE deviceConfig SET targetValues='`cat targetValues.json`';"
  • then upload the database again
scp -P22222 database.sqlite root@<IP>:/mnt/data/resin-data/balena-supervisor/database.sqlite
  • sync
ssh <IP> -p22222 -lroot sync
  • and powercycle your device

Great if you need to provision more than one device and want to prepare a json file with things to add to all devices :wink:

1 Like