- Install Arduino extension for Visual Studio Code.
- Download and install Arduino CLI.
- Add 2 files to .vscode folder.
- .vscode/settings.json
{ "arduino.useArduinoCli": true, "arduino.path": "/path/to/arduino-cli/folder", "arduino.commandPath": "arduino-cli", "arduino.logLevel": "info", "C_Cpp.errorSquiggles": "enabled", }
- .vscode/arduino.json
port
is a path to the connected board via USB, e.g. /dev/ttyUSB0{ "port": "/path/to/USB/port", "prebuild": "./prebuild.sh", "board": "esp32:esp32:esp32", "sketch": "beehive_scale.ino", "output": "./build", "configuration": "JTAGAdapter=default,PSRAM=disabled,PartitionScheme=default,CPUFreq=240,FlashMode=qio,FlashFreq=80,FlashSize=4M,UploadSpeed=921600,LoopCore=1,EventsCore=1,DebugLevel=info,EraseFlash=none", "buildPreferences": [ [ "compiler.cpp.extra_flags", "-fexceptions" ] ], "programmer": "esptool" }
- .vscode/settings.json
- In Command Pallette select "Arduino: Board Manager" and then select "esp32 by Espressif Systems Version 2.0.16" board.
- In ~/Arduino/libraries/ put folders containing following libraries:
- Copy file config/esp32_template.json into config/esp32.json. Then set proper values in this file.
- Copy .env_template into .env and set
PORT
to port to which ESP32 is connected. (It is rather unlikely that you will have to change other variables, but it is possible) - Verify files (press
CTRL + ALT + R
in beehive_scale.ino). - Upload files (press
CTRL + ALT + U
in beehive_scale.ino). - You can now open Serial Monitor and watch logs.
- Run scripts/flash_filesystem.sh.
- Click en button on ESP32 board.
- Warning! This app isn't foolproof yet. There may be a lot of bugs. Sometimes a lot of random things are logged.