The following tools are needed:
- VSCode
- Node.js
- ESP-IDF VSCode extension (for firmware build)
First, generate server cert and keys:
- cd <repo root>/server/keys
- If you've just cloned the repo, run genca.bat. You can accept default values for everything.
- Run genkeys.bat. It'll ask a bunch of questions about country, state, city, etc. You can skip all of them except the CN (common name). Put the IP address of the server in that, otherwise HTTPS connection won't work.
Now, compile the server:
- cd <repo root>/server
- npm i
- tsc
Initialize the front-end
- cd <repo root>
- npm i
Open two command windows.
In the first one:
- cd <repo root>/server
- nodemon
In the second:
- cd <repo root>
- npm run serve
Now you can navigate your browser to https://localhost:8080 to access the site.
Any changes to front-end code would be picked up automatically. Any changes to server code require "tsc" to be run
If you're deploying to a separate server, you'll need to generate keys with the correct IP address of the server (see above)
- cd <repo root>/server
- tsc
- cd <repo root>
- npm run build
- stage.bat
At this point you can copy the contents of <repo root>/stage to the server. Once deployed,
- cd <deplyment root>/server
- node src/server.js
- Navigate to https://<server IP>:3080
Open <repo root>/firmware directory in VSCode Follow the normal ESP-IDF build and deploy procedures Note that firware package includes the cert of the signing authority that's been generated when genca.bat was run.
Last step is to flash provisioning data to the device:
- Edit <repo root>/firmware/main/nvs.csv. Provide the correct values for WiFi SSID/pass and the IP of your server
- Open ESP-IDF Terminal in VSCode
- Make sure you're in <repo root>/firmware directory and run burnSettings.cmd. Hold down "boot" button on the ESP board to allow the flash to happen