vscode can be run directly on a raspberry pi 4 for editing, compiling and debugging the latestest 2.2.1 opensprinkler code.
The C++ extensions must be added to vscode and the attached task.json and launch.json configurations files are needed as well. The “.txt” must be removed from the file names. Also the “path” parameters must be changed to match your own opensprinkler folder location.
The compile time is a bit slow but acceptable. The break point debugging capabilities are excellent.
Since I can’t attach the task.json file here are the contents:
{
“version”: “2.0.0”,
“tasks”: [
{
“label”: “build OpenSprinkler”,
“type”: “cppbuild”,
“command”: “/usr/bin/g++”,
“args”: [
“-std=c++14”,
“-o”,
“OpenSprinkler”,
“-DOSPI”,
“-DLIBGPIOD”,
“-DSMTP_OPENSSL”,
“-g”,
“-include”,
“string.h”,
“main.cpp”,
“OpenSprinkler.cpp”,
“program.cpp”,
“opensprinkler_server.cpp”,
“utils.cpp”,
“weather.cpp”,
“gpio.cpp”,
“mqtt.cpp”,
“external/TinyWebsockets/tiny_websockets_lib/src/*.cpp”,
“external/OpenThings-Framework-Firmware-Library/*.cpp”,
“smtp.c”,
“-Iexternal/TinyWebsockets/tiny_websockets_lib/include”,
“-Iexternal/OpenThings-Framework-Firmware-Library/”,
“-lpthread”,
“-lmosquitto”,
“-lssl”,
“-lcrypto”,
“-lgpiod”
],
“group”: {
“kind”: “build”,
“isDefault”: true
},
“problemMatcher”: [“$gcc”],
“detail”: “Build the OpenSprinkler executable.”
}
]
}