arduino-libraries / ArduinoIoTCloud

Home Page:https://app.arduino.cc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fatal Error: SFU.h: No Such File or Directory

MJCoolTech opened this issue · comments

While using PlatformIO for VSCode I got the following compilation error for the Arduino Nano RP2040:

.pio\libdeps\nanorp2040connect\ArduinoIoTCloud\src\utility\ota\OTA-nano-rp2040.cpp:30:10: fatal error: SFU.h: No such file or directory

Using the following test script:

#include <Arduino.h>
#include <ArduinoIoTCloud.h>

void setup() {}
void loop() {}

And using the following platformio.ini:

[env]
framework = arduino
lib_deps = arduino-libraries/ArduinoIoTCloud@^1.11.1
build_type = debug

[env:nanorp2040connect]
platform = raspberrypi
board = nanorp2040connect

[env:esp32dev]
platform = espressif32
board = esp32dev

I am unsure how to fix this error as IntelliSense finds the 213 byte pain-in-the-butt file at ~/.platformio/packages/framework-arduino-mbed/libraries/SFU/src/SFU.h. How should I proceed?

EDIT: Compile also fails for ESP32:

.pio/libdeps/esp32dev/WiFiNINA/src/utility/wifi_drv.h:293:12: error: 'PinStatus' does not name a type

@MJCoolTech i'm not a platformio user, but you can try to explicitly add SFU as library dependency for nanorp2040connect.

Regarding ESP WiFiNINA is not a dependency for ESP32 board so you should not include that library

@pennam Thank you for your response. I have tried forcibly including SFU.h using:

build_flags = -L~/.platformio/packages/framework-arduino-mbed/libraries/SFU/src

Although Bing, who suggested this solution, now says it should be:

build_flags = -L~/.platformio/packages/framework-arduino-mbed/libraries/SFU/src -lSFU

So I'll try that after finishing this. I alternatively tried using

lib_extra_dirs = ~/.platformio/packages/framework-arduino-mbed/libraries

Neither of the attempts I tried so far worked for me.

Thank you for bringing the issue with WiFiNINA.h to my attention. I did not include that library through a header. As you can see in my original comment, I included in my main.cpp file Arduino.h and ArduinoIoTCloud.h only and defined the setup and loop functions as empty functions. That's it. However, I have now set in my platform.ini file:

lib_ldf_mode = chain+

That basically means it will evaluate #ifdefs and such before #includes, so I'll see if that fixes the issue.

Thank you for your response. I hope to be up and running soon. Have a great day!

Update: Bing recommended StarCoder, and look at the simple solution:

A conversation where the user gives an error and the response contains a fix.

User: While using PlatformIO for VSCode I got the following compilation error for the Arduino Nano RP2040:

.pio\libdeps\nanorp2040connect\ArduinoIoTCloud\src\utility\ota\OTA-nano-rp2040.cpp:30:10: fatal error: SFU.h: No such file or directory

Using the following test script:

#include <Arduino.h>
#include <ArduinoIoTCloud.h>

void setup() {}
void loop() {}

And using the following platformio.ini:

[env]
framework = arduino
lib_deps = arduino-libraries/ArduinoIoTCloud@^1.11.1
build_type = debug

[env:nanorp2040connect]
platform = raspberrypi
board = nanorp2040connect

I am unsure how to fix this error as IntelliSense finds the 213 byte pain-in-the-butt file at ~/.platformio/packages/framework-arduino-mbed/libraries/SFU/src/SFU.h as part of the platform and not in the library manager. How should I proceed?

Response:

You can use lib_ldf_mode = deep+ option in platformio.ini instead of lib_ldf_mode = chain+ because deep+ will search for the library in the project folder.

That easy. After 45 minutes of compilation on my Celeron CPU, I have 118 errors of -Wvla, -Wdeprecated-copy, and -Wdeprecated-declaration, but I have compiled code for the Arduino Nano RP2040 that does nothing by design! ESP32dev still fails, though.

The ESP issue is due to WiFiNINA, so I will close this issue.