Compile with Visual Studio Code
Step by Step
- Download and install Git.
- Install the prerequisits to be able to build the WebApp.
- Install Visual Studio Code (vscode).
- In vscode, install the PlatformIO Extension.
-
Clone the source code repository. Select the
Source Control
tab on the left, clickClone Repository
, and enter the URLhttps://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. - 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.
- Unless you want to compile the default firmware variant, select the appropriate PlatformIO environment in vscode's bottom statusbar.
- 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).