Skip to content
tbnobody edited this page May 25, 2023 · 2 revisions

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:

on the commandline with PlatformIO Core

  • Install PlatformIO Core
  • 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)
  • Adjust the COM port in the file "platformio_override.ini". It occurs twice:
    • upload_port
    • monitor_port
  • build: platformio run -e generic
  • upload to esp module: platformio run -e generic -t upload
  • other options:
    • clean the sources: platformio run -e generic -t clean
    • erase flash: platformio run -e generic -t erase