Setup PlatformIO with micro ros arduino (for esp32) - kajmoerk/Brick_Feeder GitHub Wiki

1. First install visual code

2. Then install the platformIO extension

NOTE: You probably need to restart VS Code after installation.

3. Then navigate to the platformIO platform manager and install the Espressif 32 platform.

4. Create a new project, choose your ESP32 board and the Arduino Framework.

PlatformIO should now autogenerate the new project for you.

5. Navigate to the platformio.ini file in your newly generated project and replace the existing configurations with the following:

[env:<YOUR_ESP32_BOARD>]
platform = https://github.com/platformio/platform-espressif32.git#feature/arduino-upstream
board = <YOUR_ESP32_BOARD>
framework = arduino
lib_deps = 
    https://github.com/micro-ROS/micro_ros_arduino.git
build_flags =
    -L ./.pio/libdeps/esp32dev/micro_ros_arduino/src/esp32/
    -l microros
    -D ESP32

platform_packages =
  toolchain-xtensa32 @ ~2.80400.0
  framework-arduinoespressif32@https://github.com/espressif/arduino-esp32.git#2.0.2

Remember to replace <YOUR_ESP32_BOARD> with your actual board.

6. Now write some code and verify that you can compile.