Skip to content

Compile with Visual Studio Code

  • Install Visual Studio Code (from now named "vscode")
  • In Visual Studio Code, install the PlatformIO Extension
  • Install git and enable git in vscode - git download - Instructions
  • Clone this repository (you really have to clone it, don't just download the ZIP file. During the build process the git hash gets embedded into the firmware. If you download the ZIP file a build error will occur): Inside vscode open the command palette by pressing Ctrl+Shift+P. Enter git clone, add the repository-URL https://github.com/tbnobody/OpenDTU. Next you have to choose (or create) a target directory.
  • In vscode, choose File --> Open Folder and select the previously downloaded source code. (You have to select the folder which contains the "platformio.ini" and "platformio_override.ini" file)
  • Adjust the COM port in the file "platformio_override.ini" for your USB-to-serial-converter. It occurs twice:
    • upload_port
    • monitor_port
  • Select the arrow button in the blue bottom status bar (PlatformIO: Upload) to compile and upload the firmware. During the compilation, all required libraries are downloaded automatically.
  • Under 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 user 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).
  • There are two videos showing these steps: