Skip to content

Compile with Visual Studio Code

Step by Step

  1. Download and install Git.
  2. Install the prerequisits to be able to build the WebApp.
  3. Install Visual Studio Code (vscode).
  4. In vscode, install the PlatformIO Extension.
  5. Clone Source Code Clone the source code repository. Select the Source Control tab on the left, click Clone Repository, and enter the URL https://github.com/hoylabs/OpenDTU-OnBattery. You really have to clone the source code repository. Do not download and extract a source ZIP file. During the build process the Git hash is embedded into the firmware. If you merely download and extract the source ZIP file a build error will occur, as no Git status can be determined.
  6. Adjust the upload and monitoring port to your system by clicking the plug icon in vscode's bottom statusbar and selecting the respective serial port. Set Serial Port
  7. Unless you want to compile the default firmware variant, select the appropriate PlatformIO environment in vscode's bottom statusbar. Select Environment
  8. Click the arrow button in vscode's bottom status bar (PlatformIO: Upload) to compile and upload the firmware. During the compilation, all required libraries are downloaded automatically.

Troubleshooting

In Linux, if the upload fails with error messages "Could not open /dev/ttyUSB0, the port doesn't exist", you can check via ls -la /dev/tty* to which group your port belongs to, and then add your username to this group via sudo adduser <yourusername> dialout (if you are using arch-linux use: sudo gpasswd -a <yourusername> uucp; this method requires a logout/login of the affected user).