See also:
- Docker
- Docker Compose
- Git
- A new firmware, that has the "Change server" option (see Upgrading an older firmware if you don't have this)
cd myfoldergit clone https://github.com/novazer/fg2.gitcd fg2/cp .env.sample .envvi .env(or edit this file in any other way)docker compose up --build -d --remove-orphans- Go to
http://<youripOrDomain>:8080to access the web interface
Before being able to connect the module to your server, you need to build a custom firmware. This firmware contains the server url specified in your .env file.
cd myfolder/fg2/./build-fw.sh- Now you can use the "Change server" option in the module to flash the firmware to your module. You'll need to input
the
API_URL_EXTERNALand theSELF_REGISTRATION_PASSWORDvalues from your.envfile with the knob. - If the operation failed, it will display "connecting..." after pressing a button. This will not disappear until you restart the module.
cd myfolder/fg2/git pull(optional: this gets you the latest changes from the repo)docker compose up --build -d --remove-orphans./build-fw.sh(if you want to update the firmware as well)
After running, you can access the management tools:
- http://localhost:8072 - RabbitMQ Management (guest, guest)
- http://localhost:8088 - Mongo Express (admin, pass)
- http://localhost:8086 - InfluxDB UI (see
.env)
cd myfolder/fg2/./backup.sh
This produces two files that are both needed, e.g.
backup-2025-10-29_22-12-27.influxdump
backup-2025-10-29_22-12-27.mongodump
Additionally, you may want to back up the .env file as well.
cd myfolder/fg2/- Place the backup files here
docker compose stop server./restore.sh backup-2025-10-29_22-12-27docker compose up -d- It may be necessary to create a new firmware version. Run
./build-fw.shif needed.
To remove all data and start fresh:
cd myfolder/fg2/docker compose down --volumescd ../rm -rf fg2/- When starting fresh, you'll also need to use the module's "Change server" again, as this registers the module in the server again.
cd webapp/npm install- Optional: Edit
src/environments/environment.tsto point tohttps://fg2.novazer.com/apifor easier testing. npm start
And before committing:
npm run lint:fixnpm run build
cd server/npm install- Set all required environment variables (see the server's environment variables in
docker-compose.yaml). npm start
And before committing:
npm run lint:fixnpm run build
Make sure that the following environment variables are set in .env:
API_URL_EXTERNAL=https://fg2.novazer.com/api
MQTT_HOST_EXTERNAL=fg2.novazer.com
MQTT_PORT_EXTERNAL=4883
(Adjust them as needed if you want to host the server yourself.)
Then try running ./provision-fw.sh fridge to build a firmware for the fridge module and provision it via USB.