I’m converting a project I wrote in the Arduino IDE to PlatformIO, and running into problems. I’ve stripped the project down for an example to show that it won’t build. I think it’s due to the Adafruit IO Arduino library pulling in the SleepyDog library as a dependency, which isn’t being done in Arduino IDE?
Is there any way to force PlatformIO to not include SleepyDog, even though it’s listed as a dependency, since the code does work in Arduino IDE? Or do I need to do something else differently?
platformio.ini:
[common] platform = espressif8266 build_flags = -D VERSION=0.1.0 -D DEBUG=1 lib_deps_external = Adafruit SSD1306@^2.3.1 Adafruit BME280 Library@^2.0.2 Adafruit IO Arduino@^3.7.0 [env:esp12e] platform = ${common.platform} board = esp12e framework = arduino ; Build options build_flags = ${common.build_flags} -D WIFI_SSID=\"myssid\" -D WIFI_PASS=\"mypassword\" -D IO_USERNAME=\"myusername\" -D IO_KEY=\"mykey\" ; Library options lib_deps = ${common.lib_deps_external}
main.cpp:
#include <Arduino.h>
#include <Adafruit_BME280.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include “AdafruitIO_WiFi.h”AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);
void setup() {
}
void loop() {
}
The build shows SleepyDog as a dependency for Adafruit IO:
|-- <Adafruit IO Arduino> 3.7.0
| |-- <Adafruit MQTT Library> 1.3.0
| | |-- <Adafruit SleepyDog Library> 1.3.2
| | |-- <Adafruit FONA Library> 1.3.8
| | |-- <WiFi101> 0.16.0
| | | |-- <SPI> 1.0
Then I start getting failed builds for SleepyDog:
Compiling .pio\build\esp12e\lib8c7\Adafruit SleepyDog Library\utility\WatchdogAVR.cpp.o
In file included from C:\Users\mandr.platformio\lib\Adafruit SleepyDog Library\Adafruit_SleepyDog.cpp:27:0:
C:\Users\mandr.platformio\lib\Adafruit SleepyDog Library\Adafruit_SleepyDog.h:32:2: error: #error Unsupported platform for the Adafruit Watchdog library!
#error Unsupported platform for the Adafruit Watchdog library!
^
C:\Users\mandr.platformio\lib\Adafruit SleepyDog Library\Adafruit_SleepyDog.h:35:8: error: ‘WatchdogType’ does not name a type
extern WatchdogType Watchdog;
^