Farm Data Relay System not able to compile in PlatformIo but in Arduino IDE

The Farm Data Relay System is a very useful library to build an independent network of sensors via ESPnow, LoRa, WiFi and UART connection.
Farm-Data-Relay-System
Unfortunately I was not able to compile the example code for the UART gateway with PlatformIo. Even with help from my coworker :wink: Copilot I found no way after two days. Although I dont like to work with the Arduino IDE I tried finaly to compile the code with it and … it worked without any error. I would be glad if somebody could explain me the reason. As there is no library.json in the FDRS repo I uploaded the header files in /lib/FDRS/src folder.

1_UART_Gateway.cpp

//  FARM DATA RELAY SYSTEM
//
//  GATEWAY 2.000
//
//  Developed by Timm Bogner (timmbogner@gmail.com) in Urbana, Illinois, USA.
//
#include <Arduino.h>
#include <WiFi.h>
#include "fdrs_gateway_config.h"
#include <fdrs_gateway.h>

void setup() {
beginFDRS();
}

void loop() {
loopFDRS();
}

platformio.ini

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
lib_deps = bblanchon/ArduinoJson@^7.3.1

Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (6.10.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
 - framework-arduinoespressif32 @ 3.20017.241212+sha.dcc1105b
 - tool-esptoolpy @ 1.40501.0 (4.5.1)
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 35 compatible libraries
Scanning dependencies...
Dependency Graph
|-- ArduinoJson @ 7.3.1
|-- Farm-Data-Relay-System @ 2.0.1
|-- WiFi @ 2.0.0
Building in release mode
Compiling .pio\build\esp32dev\src\1_UART_Gateway.cpp.o
Compiling .pio\build\esp32dev\lib326\WiFi\WiFiMulti.cpp.o
Compiling .pio\build\esp32dev\lib326\WiFi\WiFiSTA.cpp.o
Compiling .pio\build\esp32dev\lib326\WiFi\WiFiScan.cpp.o
In file included from lib/Farm-Data-Relay-System/src/fdrs_gateway.h:80,
                 from src/1_UART_Gateway.cpp:10:
lib/Farm-Data-Relay-System/src/fdrs_gateway_serial.h:19:6: warning: #warning Defining RXD2 and TXD2 using MCU defaults. [-Wcpp]
     #warning Defining RXD2 and TXD2 using MCU defaults.
      ^~~~~~~
In file included from lib/Farm-Data-Relay-System/src/fdrs_gateway.h:80,
                 from src/1_UART_Gateway.cpp:10:
lib/Farm-Data-Relay-System/src/fdrs_gateway_serial.h: In function 'void getSerial()':
lib/Farm-Data-Relay-System/src/fdrs_gateway_serial.h:164:30: warning: 'bool ArduinoJson::V731PB22::JsonObject::containsKey(const TString&) const [with TString = char [5]; typename ArduinoJson::V731PB22::detail::enable_if<ArduinoJson::V731PB22::detail::IsString<TString>::value, int>::type <anonymous> = 0]' is deprecated: use obj[key].is<T>() instead [-Wdeprecated-declarations]
     if(obj.containsKey("type")) { // DataReading
                              ^
In file included from .pio/libdeps/esp32dev/ArduinoJson/src/ArduinoJson.hpp:30,
                 from .pio/libdeps/esp32dev/ArduinoJson/src/ArduinoJson.h:9,  
                 from lib/Farm-Data-Relay-System/src/fdrs_gateway_serial.h:1, 
                 from lib/Farm-Data-Relay-System/src/fdrs_gateway.h:80,       
                 from src/1_UART_Gateway.cpp:10:
.pio/libdeps/esp32dev/ArduinoJson/src/ArduinoJson/Object/JsonObject.hpp:168:8: note: declared here
   bool containsKey(const TString& key) const {
        ^~~~~~~~~~~
In file included from lib/Farm-Data-Relay-System/src/fdrs_gateway.h:80,
                 from src/1_UART_Gateway.cpp:10:
lib/Farm-Data-Relay-System/src/fdrs_gateway_serial.h:178:34: warning: 'bool ArduinoJson::V731PB22::JsonObject::containsKey(const TString&) const [with TString = char [4]; typename ArduinoJson::V731PB22::detail::enable_if<ArduinoJson::V731PB22::detail::IsString<TString>::value, int>::type <anonymous> = 0]' is deprecated: use obj[key].is<T>() instead [-Wdeprecated-declarations]
     else if(obj.containsKey("cmd")) { // SystemPacket
                                  ^
In file included from .pio/libdeps/esp32dev/ArduinoJson/src/ArduinoJson.hpp:30,
                 from .pio/libdeps/esp32dev/ArduinoJson/src/ArduinoJson.h:9,  
                 from lib/Farm-Data-Relay-System/src/fdrs_gateway_serial.h:1, 
                 from lib/Farm-Data-Relay-System/src/fdrs_gateway.h:80,       
                 from src/1_UART_Gateway.cpp:10:
.pio/libdeps/esp32dev/ArduinoJson/src/ArduinoJson/Object/JsonObject.hpp:168:8: note: declared here
   bool containsKey(const TString& key) const {
        ^~~~~~~~~~~
In file included from lib/Farm-Data-Relay-System/src/fdrs_gateway.h:83,
                 from src/1_UART_Gateway.cpp:10:
lib/Farm-Data-Relay-System/src/fdrs_gateway_espnow.h: At global scope:        
lib/Farm-Data-Relay-System/src/fdrs_gateway_espnow.h:45:23: error: 'esp_now_recv_info' does not name a type; did you mean 'esp_now_peer_info'?
 void OnDataRecv(const esp_now_recv_info *pkt_info, const uint8_t *incomingData, int len)
                       ^~~~~~~~~~~~~~~~~
                       esp_now_peer_info
lib/Farm-Data-Relay-System/src/fdrs_gateway_espnow.h: In function 'void OnDataRecv(const int*, const uint8_t*, int)':
lib/Farm-Data-Relay-System/src/fdrs_gateway_espnow.h:47:29: error: request for member 'src_addr' in '* pkt_info', which is of non-class type 'const int'    
   memcpy(&incMAC, pkt_info->src_addr, sizeof(incMAC));
                             ^~~~~~~~
lib/Farm-Data-Relay-System/src/fdrs_gateway_espnow.h: In function 'void begin_espnow()':
lib/Farm-Data-Relay-System/src/fdrs_gateway_espnow.h:106:28: error: invalid conversion from 'void (*)(const int*, const uint8_t*, int)' {aka 'void (*)(const int*, const unsigned char*, int)'} to 'esp_now_recv_cb_t' {aka 'void (*)(const unsigned char*, const unsigned char*, int)'} [-fpermissive]
   esp_now_register_recv_cb(OnDataRecv);
                            ^~~~~~~~~~
In file included from lib/Farm-Data-Relay-System/src/fdrs_gateway_espnow.h:5, 
                 from lib/Farm-Data-Relay-System/src/fdrs_gateway.h:83,       
                 from src/1_UART_Gateway.cpp:10:
C:/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/include/esp_wifi/include/esp_now.h:136:54: note:   initializing argument 1 of 'esp_err_t esp_now_register_recv_cb(esp_now_recv_cb_t)'
 esp_err_t esp_now_register_recv_cb(esp_now_recv_cb_t cb);
                                    ~~~~~~~~~~~~~~~~~~^~
In file included from lib/Farm-Data-Relay-System/src/fdrs_gateway.h:83,
                 from src/1_UART_Gateway.cpp:10:
lib/Farm-Data-Relay-System/src/fdrs_gateway_espnow.h: In function 'void add_espnow_peer()':
lib/Farm-Data-Relay-System/src/fdrs_gateway_espnow.h:202:63: warning: narrowing conversion of 'now' from 'time_t' {aka 'long int'} to 'uint32_t' {aka 'unsigned int'} inside { } [-Wnarrowing]
     SystemPacket sys_packet = { .cmd = cmd_time, .param = now };
                                                               ^
lib/Farm-Data-Relay-System/src/fdrs_gateway_espnow.h: In function 'esp_err_t sendTimeESPNow()':
lib/Farm-Data-Relay-System/src/fdrs_gateway_espnow.h:501:61: warning: narrowing conversion of 'now' from 'time_t' {aka 'long int'} to 'uint32_t' {aka 'unsigned int'} inside { } [-Wnarrowing]
   SystemPacket sys_packet = { .cmd = cmd_time, .param = now };
                                                             ^
lib/Farm-Data-Relay-System/src/fdrs_gateway_espnow.h: In function 'esp_err_t sendTimeESPNow(uint8_t*)':
lib/Farm-Data-Relay-System/src/fdrs_gateway_espnow.h:526:61: warning: narrowing conversion of 'now' from 'time_t' {aka 'long int'} to 'uint32_t' {aka 'unsigned int'} inside { } [-Wnarrowing]
   SystemPacket sys_packet = { .cmd = cmd_time, .param = now };
                                                             ^
*** [.pio\build\esp32dev\src\1_UART_Gateway.cpp.o] Error 1
======================== [FAILED] Took 11.94 seconds ========================


The FDRS library is using the newer ESP-NOW libraries from the Espressif Arduino 3.x core. But you’re still on Espressif Arduino 2.x.

To get the latest Espressif Arduino 3.x you can use the community fork pioarduino/platform-espressif32:

platform = https://github.com/pioarduino/platform-espressif32/releases/download/53.03.13/platform-espressif32.zip

This will use the Espressif Arduino version 3.1.3.

You’ll find more about the available versions here

Also add the the FDRS library to the lib_deps.
This will download the library automatically when the project is built.
See lib_deps — PlatformIO latest documentation

Your full platformio.ini should look like this:

[env:esp32dev]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/53.03.13/platform-espressif32.zip
board = esp32dev
framework = arduino
lib_deps = 
  bblanchon/ArduinoJson@^7.3.1
  https://github.com/timmbogner/Farm-Data-Relay-System@2.0.1

Aside from a few warnings caused by the FDRS lib still using deprecated ArduinoJson functions and a few type conversion warnings, the project should now build successfully:

Processing esp32dev (platform: https://github.com/pioarduino/platform-espressif32/releases/download/53.03.13/platform-espressif32.zip; board: esp32dev; framework: arduino)
------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (53.3.13) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: 
 - framework-arduinoespressif32 @ 3.1.3 
 - framework-arduinoespressif32-libs @ 5.3.0+sha.489d7a2b3a 
 - tool-esptoolpy @ 4.8.6 
 - tool-mklittlefs @ 3.2.0 
 - tool-riscv32-esp-elf-gdb @ 14.2.0+20240403 
 - tool-xtensa-esp-elf-gdb @ 14.2.0+20240403 
 - toolchain-xtensa-esp-elf @ 13.2.0+20240530
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 43 compatible libraries
Scanning dependencies...
Dependency Graph
|-- ArduinoJson @ 7.3.1
|-- Farm-Data-Relay-System @ 2.0.1+sha.2c4e985
|-- WiFi @ 3.1.3
Building in release mode
Retrieving maximum program size .pio/build/esp32dev/firmware.elf
Checking size .pio/build/esp32dev/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=         ]  14.7% (used 48312 bytes from 327680 bytes)
Flash: [=======   ]  72.1% (used 945344 bytes from 1310720 bytes)
================================= [SUCCESS] Took 1.68 seconds =================================

I have created a PR to fix the warnings:

Many thanks for your quick response!

I updated my platformio.ini to get the recommended Espressif Arduino version 3.1.3.

platform = https://github.com/pioarduino/platform-espressif32/releases/download/53.03.13/platform-espressif32.zip

It gave me an error and recommended me to check the last version of platformio:

python -m pip install -U platformio

This did not work either. Unfortunately I did not copy the error messages when I closed the window and I do not know where PlatformIo stores logfiles related to this.

After that I opened a new window in PlatformIo and tried to build a new project, but now I was not able to load the boards list and recent projects anymore and gave me this messages.

PIO Core Call Error: "AttributeError: Traceback (most recent call last):\r\n File \"C:\\.platformio\\penv\\Lib\\site-packages\\platformio\\__main__.py\", line 103, in main\r\n cli() # pylint: disable=no-value-for-parameter\r\n ^^^^^\r\n File \"C:\\.platformio\\penv\\Lib\\site-packages\\click\\core.py\", line 1161, in __call__\r\n return self.main(*args, **kwargs)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\.platformio\\penv\\Lib\\site-packages\\click\\core.py\", line 1082, in main\r\n rv = self.invoke(ctx)\r\n ^^^^^^^^^^^^^^^^\r\n File \"C:\\.platformio\\penv\\Lib\\site-packages\\platformio\\cli.py\", line 85, in invoke\r\n return super().invoke(ctx)\r\n ^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\.platformio\\penv\\Lib\\site-packages\\click\\core.py\", line 1697, in invoke\r\n return _process_result(sub_ctx.command.invoke(sub_ctx))\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\.platformio\\penv\\Lib\\site-packages\\click\\core.py\", line 1443, in invoke\r\n return ctx.invoke(self.callback, **ctx.params)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\.platformio\\penv\\Lib\\site-packages\\click\\core.py\", line 788, in invoke\r\n return __callback(*args, **kwargs)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\.platformio\\penv\\Lib\\site-packages\\platformio\\commands\\boards.py\", line 31, in cli\r\n return _print_boards_json(query, installed)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\.platformio\\penv\\Lib\\site-packages\\platformio\\commands\\boards.py\", line 80, in _print_boards_json\r\n for board in _get_boards(installed):\r\n ^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\.platformio\\penv\\Lib\\site-packages\\platformio\\commands\\boards.py\", line 75, in _get_boards\r\n return pm.get_installed_boards() if installed else pm.get_all_boards()\r\n ^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\.platformio\\penv\\Lib\\site-packages\\platformio\\package\\manager\\platform.py\", line 124, in get_all_boards\r\n boards = self.get_installed_boards()\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\.platformio\\penv\\Lib\\site-packages\\platformio\\util.py\", line 57, in wrapper\r\n self.cache[key] = (time.time(), func(*args, **kwargs))\r\n ^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\.platformio\\penv\\Lib\\site-packages\\platformio\\package\\manager\\platform.py\", line 111, in get_installed_boards\r\n p = PlatformFactory.new(pkg)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\.platformio\\penv\\Lib\\site-packages\\platformio\\platform\\factory.py\", line 79, in new\r\n platform_cls = getattr(\r\n ^^^^^^^^\r\nAttributeError: module 'platformio.platform.platform' has no attribute 'PlatformPlatform'\r\n\r\n============================================================\r\n\r\nAn unexpected error occurred. Further steps:\r\n\r\n* Verify that you have the latest version of PlatformIO using\r\n `python -m pip install -U platformio` command\r\n\r\n* Try to find answer in FAQ Troubleshooting section\r\n https://docs.platformio.org/page/faq/index.html\r\n\r\n* Report this problem to the developers\r\n https://github.com/platformio/platformio-core/issues\r\n\r\n======================================

Server error: {"type":"AttributeError","args":["module 'platformio.platform.platform' has no attribute 'PlatformPlatform'"],"message":"module 'platformio.platform.platform' has no attribute 'PlatformPlatform'"}

Started PlatformIo and tried to update again in the terminal:

python -m pip install -U platformio

Successfully built platformio
Installing collected packages: pyelftools, bottle, urllib3, tabulate, sniffio, semantic_version, packaging, idna, h11, colorama, charset-normalizer, certifi, ajsonrpc, wsproto, requests, marshmallow, click, anyio, uvicorn, starlette, platformio
Successfully installed ajsonrpc-1.2.0 anyio-4.8.0 bottle-0.13.2 certifi-2025.1.31 charset-normalizer-3.4.1 click-8.1.8 colorama-0.4.6 h11-0.14.0 idna-3.10 marshmallow-3.26.1 packaging-24.2 platformio-6.1.17 pyelftools-0.32 requests-2.32.3 semantic_version-2.10.0 sniffio-1.3.1 starlette-0.45.3 tabulate-0.9.0 urllib3-2.3.0 uvicorn-0.34.0 wsproto-1.2.0

But this did not solve the problem. Same error messages about board lists and recent projects. Project wizard is not working.

1 Like

I didn’t notice your edit. In such a case it is better to create a new reply.

The error you have is strange and should not happen when changing just the platform setting.

It looks like your espressif platform or the whole PlatformIO installation is broken.

  • Close VS Code
  • delete C:\Users\username\.platformio
  • Start VS Code
  • Wait until PlatformIO finished reinstalling the necessary files and platform

Many thanks for your support! I will report later.

1 Like

Many thanks again for your help! I tried your advises serveral times again and again.
Removed VSC and installed it again. The FDRS had been installed by PlatformIo in

C:\esp32\RpmSensor\.pio\libdeps\esp32dev\Farm-Data-Relay-System

I renamed all the .ino files and had a look at the correct alignement of the functions (setup and loop at last and #include <Arduino.h> on top).

; PlatformIO Project Configuration File
[env:esp32dev]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/53.03.13/platform-espressif32.zip
board = esp32dev
framework = arduino
lib_deps = 
  bblanchon/ArduinoJson@^7.3.1
  https://github.com/timmbogner/Farm-Data-Relay-System@2.0.1
  Wifi

//  FARM DATA RELAY SYSTEM
//
//  ESP-NOW Sensor Example
//
//  Developed by Timm Bogner (timmbogner@gmail.com) in Urbana, Illinois, USA.
//  An example of how to send data via ESP-NOW using FDRS.
//
#include <Arduino.h>
#include "fdrs_node_config.h"
#include <fdrs_node.h>

float data1;
float data2;

float readTemp() {
  return 22.069;
}

float readHum() {
  return random(0, 100);
}

void setup() {
  beginFDRS();
}
void loop() {
  data1 = readHum();
  loadFDRS(data1, HUMIDITY_T);
  data2 = readTemp();
  loadFDRS(data2, TEMP_T);
//  DBG(sendFDRS());
    if(sendFDRS()){
      DBG("Big Success!");
    } else {
      DBG("Nope, not so much.");
    }
  sleepFDRS(10);  //Sleep time in seconds
}

But it did not work and I got errors and errors compiling it.

Processing esp32dev (platform: https://github.com/pioarduino/platform-espressif32/releases/download/53.03.13/platform-espressif32.zip; board: esp32dev; framework: arduino)
------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (53.3.13) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
 - framework-arduinoespressif32 @ 3.1.3 
 - framework-arduinoespressif32-libs @ 5.3.0+sha.489d7a2b3a
 - tool-esptoolpy @ 4.8.6
 - tool-mklittlefs @ 3.2.0
 - tool-riscv32-esp-elf-gdb @ 14.2.0+20240403
 - tool-xtensa-esp-elf-gdb @ 14.2.0+20240403
 - toolchain-xtensa-esp-elf @ 13.2.0+20240530
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 44 compatible libraries
Scanning dependencies...
Dependency Graph
|-- ArduinoJson @ 7.3.1
|-- Farm-Data-Relay-System @ 2.0.1+sha.2c4e985
|-- WiFi @ 3.1.3
Building in release mode
Compiling .pio\build\esp32dev\src\ESPNOW_Sensor.cpp.o
Archiving .pio\build\esp32dev\lib326\libWiFi.a
Compiling .pio\build\esp32dev\FrameworkArduino\FirmwareMSC.cpp.o
Compiling .pio\build\esp32dev\FrameworkArduino\FunctionalInterrupt.cpp.o
Indexing .pio\build\esp32dev\lib326\libWiFi.a
Compiling .pio\build\esp32dev\FrameworkArduino\HEXBuilder.cpp.o
Compiling .pio\build\esp32dev\FrameworkArduino\HWCDC.cpp.o
In file included from .pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node.h:7,
                 from src/ESPNOW_Sensor.cpp:10:
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_datatypes.h:10:3: error: 'uint8_t' does not name a type
   10 |   uint8_t mac[6];
      |   ^~~~Compiling .pio\build\esp32dev\FrameworkArduino\HardwareSerial.cpp.o
~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_datatypes.h:1:1: note: 'uint8_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
  +++ |+#include <cstdint>
    1 | // A list of all datatypes you can use within FDRS.
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_datatypes.h:11:3: error: 'uint32_t' does not name a type
   11 |   uint32_t last_seen = 0;
      |   ^~~~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_datatypes.h:11:3: note: 'uint32_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_datatypes.h:17:3: error: 'uint16_t' does not name a type
   17 |   uint16_t id;
      |   ^~~~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_datatypes.h:17:3: note: 'uint16_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_datatypes.h:18:3: error: 'uint8_t' does not name a type
   18 |   uint8_t t;
Compiling .pio\build\esp32dev\FrameworkArduino\IPAddress.cpp.o
      |   ^~~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_datatypes.h:18:3: note: 'uint8_t' is defined in 
header '<cstdint>'; did you forget to '#include <cstdint>'?
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_datatypes.h:23:3: error: 'uint8_t' does not name a type
   23 |   uint8_t cmd;
      |   ^~~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_datatypes.h:23:3: note: 'uint8_t' is defined in 
header '<cstdint>'; did you forget to '#include <cstdint>'?
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_datatypes.h:24:3: error: 'uint32_t' does not name a type
   24 |   uint32_t param;
      |   ^~~~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_datatypes.h:24:3: note: 'uint32_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_datatypes.h:89:3: error: 'uint16_t' does not name a type
Compiling .pio\build\esp32dev\FrameworkArduino\MD5Builder.cpp.o
   89 |   uint16_t tmAddress;
      |   ^~~~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_datatypes.h:89:3: note: 'uint16_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_datatypes.h:96:1: error: 'uint16_t' does not name a type
   96 | uint16_t *address;
      | ^~~~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_datatypes.h:96:1: note: 'uint16_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_datatypes.h:97:1: error: 'uint' does not name a 
type; did you mean 'int'?
   97 | uint startIdx;
      | ^~~~
      | int
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_datatypes.h:98:1: error: 'uint' does not name a 
type; did you mean 'int'?
Compiling .pio\build\esp32dev\FrameworkArduino\MacAddress.cpp.o
   98 | uint endIdx;
      | ^~~~
      | int
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_datatypes.h:99:1: error: 'uint' does not name a 
type; did you mean 'int'?
   99 | uint size;
      | ^~~~
      | int
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_datatypes.h:104:1: error: 'uint16_t' does not name a type
  104 | uint16_t *address;
      | ^~~~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_datatypes.h:104:1: note: 'uint16_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_datatypes.h:105:1: error: 'uint' does not name a type; did you mean 'int'?
  105 | uint startIdx;
      | ^~~~
Compiling .pio\build\esp32dev\FrameworkArduino\Print.cpp.o
      | int
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_datatypes.h:106:1: error: 'uint' does not name a type; did you mean 'int'?
  106 | uint endIdx;
      | ^~~~
      | int
Compiling .pio\build\esp32dev\FrameworkArduino\SHA1Builder.cpp.o
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_datatypes.h:107:1: error: 'uint' does not name a type; did you mean 'int'?
  107 | uint size;
      | ^~~~
      | int
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_datatypes.h:113:3: error: 'uint' does not name a type; did you mean 'int'?
  113 |   uint timeout;
      |   ^~~~
      |   int
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_datatypes.h:114:3: error: 'uint16_t' does not name a type
  114 |   uint16_t address;
      |   ^~~~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_datatypes.h:114:3: note: 'uint16_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_datatypes.h:115:3: error: 'uint32_t' does not name a type
  115 |   uint32_t response = __UINT32_MAX__;
      |   ^~~~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_datatypes.h:115:3: note: 'uint32_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
Compiling .pio\build\esp32dev\FrameworkArduino\Stream.cpp.o
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node.h:13:1: error: 'uint8_t' does not name a type
   13 | uint8_t ln;
      | ^~~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node.h:8:1: note: 'uint8_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
    7 | #include <fdrs_datatypes.h>
  +++ |+#include <cstdint>
    8 | #include <fdrs_globals.h>
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node.h:14:1: error: 'uint8_t' does not name a type
   14 | uint8_t newData = event_clear;
      | ^~~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node.h:14:1: note: 'uint8_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node.h:15:1: error: 'uint8_t' does not name a type
   15 | uint8_t gatewayAddress[] = {MAC_PREFIX, GTWY_MAC};
      | ^~~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node.h:15:1: note: 'uint8_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node.h:16:7: error: 'uint16_t' does not name a type
   16 | const uint16_t espnow_size = (250 - 15) / sizeof(DataReading); // 250 bytes minus 15 bytes for addressing and other data
      |       ^~~~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node.h:16:7: note: 'uint16_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node.h:19:1: error: 'uint8_t' does not name a type
   19 | uint8_t incMAC[6];
      | ^~~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node.h:19:1: note: 'uint8_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node.h:20:22: error: 'espnow_size' was not declared in this scope
   20 | DataReading fdrsData[espnow_size];
      |                      ^~~~~~~~~Compiling .pio\build\esp32dev\FrameworkArduino\StreamString.cpp.o
~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node.h:21:21: error: 'espnow_size' was not declared in this scope
   21 | DataReading incData[espnow_size];
      |                     ^~~~~~~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node.h:24:1: error: 'uint8_t' does not name a type
   24 | uint8_t data_count = 0;
      | ^~~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node.h:24:1: note: 'uint8_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node.h:27:1: error: 'uint16_t' does not name a type
Compiling .pio\build\esp32dev\FrameworkArduino\Tone.cpp.o
   27 | uint16_t subscription_list[256] = {};
      | ^~~~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node.h:27:1: note: 'uint16_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
In file included from .pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node.h:41:
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_time.h:80:1: error: 'esp_err_t' does not name a 
type
   80 | esp_err_t sendTimeESPNow();
      | ^~~~~~~~~
In file included from .pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node.h:40:
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_time.h: In function 'void printTime()':
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_debug.h:9:24: error: 'Serial' was not declared in this scope
Compiling .pio\build\esp32dev\FrameworkArduino\USB.cpp.o
    9 |         #define DBG(a) Serial.print("    "); Serial.println(a);
      |                        ^~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_time.h:177:5: note: in expansion of macro 'DBG'
  177 |     DBG("Local date/time is: " + String(strftime_buf) + (isDST?" DST":" STD"));
      |     ^~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_debug.h:9:24: note: the macro 'Serial' had not yet been defined
    9 |         #define DBG(a) Serial.print("    "); Serial.println(a);
      |                        ^~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_time.h:177:5: note: in expansion of macro 'DBG'
  177 |     DBG("Local date/time is: " + String(strftime_buf) + (isDST?" DST":" STD"));
      |     ^~~
In file included from C:/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:203,
                 from C:/.platformio/packages/framework-arduinoespressif32/libraries/Network/src/NetworkInterface.h:10,
                 from C:/.platformio/packages/framework-arduinoespressif32/libraries/Network/src/Network.h:8,
                 from C:/.platformio/packages/framework-arduinoespressif32/libraries/WiFi/src/WiFiGeneric.h:44,
                 from C:/.platformio/packages/framework-arduinoespressif32/libraries/WiFi/src/WiFiSTA.h:30,
Compiling .pio\build\esp32dev\FrameworkArduino\USBCDC.cpp.o
                 from C:/.platformio/packages/framework-arduinoespressif32/libraries/WiFi/src/WiFi.h:34,
                 from .pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node_espnow.h:6,
                 from .pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node.h:46:
C:/.platformio/packages/framework-arduinoespressif32/cores/esp32/HardwareSerial.h:364: note: it was later defined here
  364 | #define Serial Serial0
      | 
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_time.h:177:34: error: 'String' was not declared 
in this scope
  177 |     DBG("Local date/time is: " + String(strftime_buf) + (isDST?" DST":" STD"));
      |                                  ^~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_debug.h:9:61: note: in definition of macro 'DBG'    9 |         #define DBG(a) Serial.print("    "); Serial.println(a);
      |                                                             ^
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_time.h: In function 'void checkDST()':
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_time.h:11:35: error: 'millis' was not declared in this scope
Compiling .pio\build\esp32dev\FrameworkArduino\USBMSC.cpp.o
   11 | #define TDIFF(prevMs,durationMs) (millis() - prevMs > durationMs)
      |                                   ^~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_time.h:182:22: note: in expansion of macro 'TDIFF'
  182 |   if(validTime() && (TDIFF(lastDstCheck,5000) || lastDstCheck == 0)) {
      |                      ^~~~~Compiling .pio\build\esp32dev\FrameworkArduino\WMath.cpp.o

.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_time.h: In function 'bool setTime(time_t)':
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_time.h:11:35: error: 'millis' was not declared in this scope
   11 | #define TDIFF(prevMs,durationMs) (millis() - prevMs > durationMs)
      |                                   ^~~~~~
Compiling .pio\build\esp32dev\FrameworkArduino\WString.cpp.o
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_time.h:348:41: note: in expansion of macro 'TDIFF'
  348 |     if(FDRS_TIME_SEND_INTERVAL == 0 && (TDIFF(lastTimeSend,5000) || lastTimeSend == 0)) { // avoid sending twice on start with RTC and WiFi
      |                                         ^~~~~Compiling .pio\build\esp32dev\FrameworkArduino\base64.cpp.o

.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_time.h: In function 'void handleTime()':
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_time.h:11:35: error: 'millis' was not declared in this scope
   11 | #define TDIFF(prevMs,durationMs) (millis() - prevMs > durationMs)
      |                                   ^~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_time.h:360:6: note: in expansion of macro 'TDIFF'
  360 |   if(TDIFF(lastUpdate,500)) {
      |      ^~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_time.h:14:39: error: 'millis' was not declared in this scope
   14 | #define TDIFFMIN(prevMs,durationMin) (millis() - prevMs > (durationMin * 60 * 1000))
      |                                       ^~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_time.h:381:57: note: in expansion of macro 'TDIFFMIN'
  381 |   if(validTimeFlag && (FDRS_TIME_SEND_INTERVAL != 0) && TDIFFMIN(lastTimeSend,FDRS_TIME_SEND_INTERVAL)) {
      |                                                         ^~~~~~Compiling .pio\build\esp32dev\FrameworkArduino\cbuf.cpp.o
~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_time.h:14:39: error: 'millis' was not declared in this scope
   14 | #define TDIFFMIN(prevMs,durationMin) (millis() - prevMs > (durationMin * 60 * 1000))
      |                                       ^~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_time.h:385:41: note: in expansion of macro 'TDIFFMIN'
  385 |   if(timeSource.tmNetIf < TMIF_LOCAL && TDIFFMIN(timeSource.tmLastTimeSet,120)) { // Reset time source to default if not heard anything for two hours
      |                                         ^~~~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_time.h:387:16: error: 'struct TimeSource' has no member named 'tmAddress'
  387 |     timeSource.tmAddress = 0x0000;
      |                ^~~~~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_time.h: In function 'void adjTimeforNetDelay(time_t)':
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_debug.h:9:24: error: 'Serial' was not declared in this scope
    9 |         #define DBG(a) Serial.print("    "); Serial.println(a);
      |                        ^~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_time.h:405:5: note: in expansion of macro 'DBG'
  405 |     DBG("Time off by more than 10 seconds!");
      |     ^~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_debug.h:9:24: note: the macro 'Serial' had not yet been defined
    9 |         #define DBG(a) Serial.print("    "); Serial.println(a);
      |                        ^~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_time.h:405:5: note: in expansion of macro 'DBG'
Compiling .pio\build\esp32dev\FrameworkArduino\chip-debug-report.cpp.o
  405 |     DBG("Time off by more than 10 seconds!");
      |     ^~~
C:/.platformio/packages/framework-arduinoespressif32/cores/esp32/HardwareSerial.h:364: note: it was later defined here
  364 | #define Serial Serial0
      | 
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node_espnow.h: In function 'bool reqTimeEspNow()':
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node_espnow.h:20:59: error: too many initializers for 'SystemPacket'
   20 |     SystemPacket sys_packet = {.cmd = cmd_time, .param = 0};
      |                                                           ^
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node_espnow.h:22:18: error: 'gatewayAddress' was not declared in this scope
   22 |     esp_now_send(gatewayAddress, (uint8_t *)&sys_packet, sizeof(SystemPacket));
      |                  ^~~~~~~~~~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node_espnow.h: In function 'void recvTimeEspNow(uint32_t)':
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node_espnow.h:39:91: error: 'struct TimeSource' 
has no member named 'tmAddress'
   39 |   if(timeSource.tmNetIf < TMIF_ESPNOW || (timeSource.tmNetIf == TMIF_ESPNOW && timeSource.tmAddress == (incMAC[4] << 8 | incMAC[5]))) {
      |                                                                                           ^~~~~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node_espnow.h:39:105: error: 'incMAC' was not declared in this scope
   39 |   if(timeSource.tmNetIf < TMIF_ESPNOW || (timeSource.tmNetIf == TMIF_ESPNOW && timeSource.tmAddress == (incMAC[4] << 8 | incMAC[5]))) {
      |
          ^~~~~~Compiling .pio\build\esp32dev\FrameworkArduino\esp32-hal-adc.c.o

Compiling .pio\build\esp32dev\FrameworkArduino\esp32-hal-bt.c.o
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node_espnow.h:44:18: error: 'struct TimeSource' 
has no member named 'tmAddress'
   44 |       timeSource.tmAddress = (incMAC[4] << 8 | incMAC[5]);
      |                  ^~~~~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node_espnow.h: In function 'void OnDataRecv(const esp_now_recv_info*, const uint8_t*, int)':
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node_espnow.h:86:13: error: 'incMAC' was not declared in this scope
   86 |     memcpy(&incMAC, pkt_info->src_addr, sizeof(incMAC));
      |             ^~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node_espnow.h:93:25: error: 'SystemPacket' {aka 
'struct SystemPacket'} has no member named 'cmd'
   93 |         switch (command.cmd)
      |                         ^~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node_espnow.h:96:24: error: 'SystemPacket' {aka 
'struct SystemPacket'} has no member named 'param'
   96 |             if(command.param == ping_reply) {
      |                        ^~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node_espnow.h:102:36: error: 'SystemPacket' {aka 'struct SystemPacket'} has no member named 'param'
  102 |             gtwy_timeout = command.param;
      |                                    ^~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node_espnow.h:105:24: error: 'SystemPacket' {aka 'struct SystemPacket'} has no member named 'param'
  105 |             if(command.param > MIN_TS) {
      |                        ^~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node_espnow.h:106:40: error: 'SystemPacket' {aka 'struct SystemPacket'} has no member named 'param'
Compiling .pio\build\esp32dev\FrameworkArduino\esp32-hal-cpu.c.o
  106 |                 recvTimeEspNow(command.param);
      |                                        ^~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node_espnow.h:114:9: error: 'ln' was not declared in this scope; did you mean 'len'?
  114 |         ln = len / sizeof(DataReading);
      |         ^~
      |         len
Compiling .pio\build\esp32dev\FrameworkArduino\esp32-hal-dac.c.o
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node_espnow.h:116:9: error: 'newData' was not declared in this scope
  116 |         newData = event_espnowg;
      |         ^~~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node_espnow.h: In function 'int pingFDRSEspNow(uint8_t*, uint32_t)':
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node_espnow.h:127:70: error: too many initializers for 'SystemPacket'
  127 |     SystemPacket sys_packet = {.cmd = cmd_ping, .param = ping_request};
      |                                                                      ^
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node_espnow.h: In function 'bool refresh_registration()':
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node_espnow.h:155:56: error: too many initializers for 'SystemPacket'
  155 |   SystemPacket sys_packet = {.cmd = cmd_add, .param = 0};
      |                                                        ^
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node_espnow.h:156:16: error: 'gatewayAddress' was not declared in this scope
Compiling .pio\build\esp32dev\FrameworkArduino\esp32-hal-gpio.c.o
  156 |   esp_now_send(gatewayAddress, (uint8_t *)&sys_packet, sizeof(SystemPacket));
      |                ^~~~~~~~~~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node.h: In function 'void beginFDRS()':
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node.h:130:30: error: 'gatewayAddress' was not declared in this scope
Compiling .pio\build\esp32dev\FrameworkArduino\esp32-hal-i2c-slave.c.o
  130 |   memcpy(peerInfo.peer_addr, gatewayAddress, 6);
      |                              ^~~~~~~~~~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node.h: In function 'void handleIncoming()':
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node.h:151:7: error: 'newData' was not declared 
in this scope
  151 |   if (newData != event_clear)
Compiling .pio\build\esp32dev\FrameworkArduino\esp32-hal-i2c.c.o
      |       ^~~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node.h:155:25: error: 'ln' was not declared in this scope; did you mean 'yn'?
  155 |     for (int i = 0; i < ln; i++)
      |                         ^~
      |                         yn
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node.h:162:26: error: 'DataReading' {aka 'struct DataReading'} has no member named 'id'; did you mean 'd'?
  162 |           if (theData[i].id == subscription_list[j])
      |                          ^~
      |                          d
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node.h:162:32: error: 'subscription_list' was not declared in this scope
  162 |           if (theData[i].id == subscription_list[j])
      |                                ^~~~~~~~~~~~~~~~~Compiling .pio\build\esp32dev\FrameworkArduino\esp32-hal-ledc.c.o

.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node.h: In function 'bool sendFDRS()':
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node.h:177:6: error: 'data_count' was not declared in this scope
  177 |   if(data_count == 0) {
      |      ^~~~~~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node.h:182:16: error: 'gatewayAddress' was not declared in this scope
  182 |   esp_now_send(gatewayAddress, (uint8_t *)&fdrsData, data_count * sizeof(DataReading));
Compiling .pio\build\esp32dev\FrameworkArduino\esp32-hal-matrix.c.o
      |                ^~~~~~~~~~Compiling .pio\build\esp32dev\FrameworkArduino\esp32-hal-misc.c.o
~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node.h:182:44: error: 'fdrsData' was not declared in this scope
  182 |   esp_now_send(gatewayAddress, (uint8_t *)&fdrsData, data_count * sizeof(DataReading));
      |                                            ^~~~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node.h:182:54: error: 'data_count' was not declared in this scope
  182 |   esp_now_send(gatewayAddress, (uint8_t *)&fdrsData, data_count * sizeof(DataReading));
      |                                                      ^~~~~~~~~~
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node.h: In function 'bool sendFDRSAsync()':
.pio/libdeps/esp32dev/Farm-Data-Relay-System/src/fdrs_node.h:228:6: error: 'data_count' was not declared in this scope
  228 |   if(data_count == 0) {
      |      ^~~~~~~~~~


..................................

In the last moment after lots of hours of wasted time when I was about to turn to the Arduino IDE … I remembered the main difference between PlatformIo and Arduino IDE and perhaps the reason why all the error messages did show up althoug #include <Arduino.h> has been done in the .cpp files !!!

I gave them a last chance and included Arduino.h in every header file of the FDRS library.
And… :drum: It worked finally! :pray::pray::pray:

C:\esp32\RpmSensor\.pio\libdeps\esp32dev\Farm-Data-Relay-System\src  

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----        03.03.2025     18:36                ESP8266_and_ESP32_OLED_driver_for_S
                                                  SD1306_displays
-a----        03.03.2025     18:36          13723 fdrs_checkConfig.h
-a----        03.03.2025     19:09           3651 fdrs_datatypes.h
-a----        03.03.2025     18:36            882 fdrs_debug.h
-a----        03.03.2025     18:36           6523 fdrs_gateway.h
-a----        03.03.2025     18:36          14291 fdrs_gateway_espnow.h
-a----        03.03.2025     18:36           4942 fdrs_gateway_mqtt.h
-a----        03.03.2025     18:36           1901 fdrs_gateway_ota.h
-a----        03.03.2025     18:36            876 fdrs_gateway_scheduler.h
-a----        03.03.2025     18:36           8308 fdrs_gateway_serial.h
-a----        03.03.2025     18:36           8857 fdrs_gateway_wifi.h
-a----        03.03.2025     18:36           3145 fdrs_globals.h
-a----        03.03.2025     18:36          42064 fdrs_lora.h
-a----        03.03.2025     19:10          10600 fdrs_node.h
-a----        03.03.2025     19:10           5540 fdrs_node_espnow.h
-a----        03.03.2025     18:36           4177 fdrs_oled.h
-a----        03.03.2025     19:10          13306 fdrs_time.h

By the way, GitHub Copilot had many ideas to solve the problem which were not helpful but time consuming!

1 Like

I have had much the same experience using chatGPT to try and solve issues with platformIO, ending up going round in circles and wasting hours. IMHO if sivar2311 can’t solve an issue then AI can’t either. I love platformIO and the joy it gives when a project is successfully completed.

1 Like

I am pleased that this has worked for you, but unfortunately I have to tell you that this is the wrong way!

I have to withdraw my last post because I misunderstood the statement. If the changes refer to your own .cpp files and not to those of the FDRS library, this is of course correct.

1 Like

Hi I noticed you made a comment about setup and loop being last. I assume you mean after the functions. You do not need to do that if you use function prototypes at the top of the file. Alternative you can put the prototypes in a .h file.
The Arduino IDE doesn’t require one to use function prototypes but proper C/C++ does! unless you do as you did and put setup and loop after when a function is called, i.e. at the end.
Anyway I am about to try FDRS so your experience of it with platformIO will be helpful.

Many thanks! My problems occured when I tried to integrate FDRS in a sketch containing some other libraries having little experience in that. In the meantime I found out how to do. My platformio.ini for the FDRS project looks like this and works perfectly.

; PlatformIO Project Configuration File

[env:gnsssensor]

platform = https://github.com/pioarduino/platform-espressif32/releases/download/53.03.13/platform-espressif32.zip
framework = arduino
board = esp32dev
monitor_speed = 115200
build_flags = -Iinclude  
lib_deps =
  bblanchon/ArduinoJson@^7.3.1
  https://github.com/timmbogner/Farm-Data-Relay-System@2.0.1
  TinyGPSPlus
#include <Arduino.h>
#include <pins.h>
#include "GNSS_module.h"
#include <TinyGPSPlus.h>
#include "fdrs_node_config.h"
#include <fdrs_node.h>

C:\esp32\GnssSensor\include
Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----        09.03.2025     07:45            843 DEV_Config.h
-a----        08.03.2025     22:01           1804 fdrs_node_config.h
-a----        09.03.2025     22:43            794 GNSS_module.h
-a----        09.03.2025     07:45           2507 L76X.h
-a----        09.03.2025     22:43           1383 pins.h
C:\esp32\GnssSensor\src

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----        09.03.2025     22:43           3078 GNSS_module.cpp
-a----        09.03.2025     23:05           7183 main.cpp

Thank you for sharing further information. I am pleased to see you get it working with the latest ArduinoJson . I have had to address those issues with ArduinoJson too.