0

I bought an "off-brand" ESP32 board. I can upload blinky without a problem using platformio with the following platformio.ini file:

[env:humidious]
platform = espressif32
board = nodemcu-32s
framework = arduino

However, as soon as I add lib_deps = grafana/PrometheusArduino@^0.3.0 the compiler throws the following errors:

In file included from .pio/libdeps/humidious/WiFiNINA/src/WiFiStorage.h:23:0,
                 from .pio/libdeps/humidious/WiFiNINA/src/WiFi.h:38,
                 from .pio/libdeps/humidious/PromLokiTransport/src/clients/ESP32Client.h:7,
                 from .pio/libdeps/humidious/PromLokiTransport/src/PromLokiTransport.h:8,
                 from .pio/libdeps/humidious/PrometheusArduino/src/PromClient.h:4,
                 from .pio/libdeps/humidious/PrometheusArduino/src/PrometheusArduino.h:5,
                 from src/main.cpp:4:
.pio/libdeps/humidious/WiFiNINA/src/utility/wifi_drv.h:293:12: error: 'PinStatus' does not name a type
     static PinStatus digitalRead(uint8_t pin);

It was suggested on another thread that the board was out of date, but updating this didn't help.

Adding typedef int PinStatus before #include <PrometheusArduino.h> didn't help either.

0

2 Answers 2

2

What Majeko said was correct. PIO was using WifiNINA instead of the ESP32's WiFi library. To solve this, I added lib_ignore = WiFiNINA to platformio.ini and #include <WiFi.h> before including the prometheus libraries in main.ino.

I tested this by pointing PrometheusArduino at my desktop with this example:

$ ncat -l 9090
POST /api/prom/push HTTP/1.1
Host: 192.168.0.45
Content-Type: application/x-protobuf
Content-Encoding: snappy
User-Agent: prom-arduino/0.2.2
Content-Length: 209

F

%
__name__uptime_milliseconds_total

job
esp32-test

hostD   @/@%@<@@/

heap_free_bytes
0


foobar
        0xA6..(0xA/
1

The problem here is that PlatformIO is picking up the wrong WiFi library. It has decided that the WiFi.h provided by WiFiNINA is the correct one to use, rather than the WiFi.h provided by the ESP32's bundled WiFi library.

You could try removing all traces of the WiFiNINA library from your PlatformIO installation, or maybe you need to manually specify which WiFi library should be used to preempt the autoselection routine.

I don't know how you do that in PlatformIO.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.