Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency Issues for ESP32 Board #1

Closed
HatterIsMad opened this issue Jan 31, 2022 · 5 comments
Closed

Dependency Issues for ESP32 Board #1

HatterIsMad opened this issue Jan 31, 2022 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@HatterIsMad
Copy link

First of all, thank you for writing this Fetch abstraction layer.
I am trying to get it working on my ESP32 board and am running into compatibility issues with some of the dependencies.

The first issue I ran into was a missing dependency "LCBUrl".
I installed it manually and it is now compiling past that point, but giving me a warning.
"WARNING: library LCBUrl claims to run on avr architecture(s) and may be incompatible with your current board which runs on esp32 architecture(s)."

The second issue, which I am currently stuck on is related to the WifiClientSecure class.
The ESP32 board appears to install a WifiClientSecure package, but it does not have the same methods that you are calling.

C:\Users\KoGMa\Documents\Arduino\libraries\Fetch\src\Fetch.cpp: In function 'Response fetch(const char*, RequestOptions)':
C:\Users\KoGMa\Documents\Arduino\libraries\Fetch\src\Fetch.cpp:17:21: error: 'class WiFiClientSecure' has no member named 'setFingerprint'
         else client.setFingerprint(options.fingerprint.c_str());
                     ^
C:\Users\KoGMa\Documents\Arduino\libraries\Fetch\src\Fetch.cpp:21:57: error: no matching function for call to 'WiFiClientSecure::connect(String&, uint&)'
     while(!client.connect(parsedUrl.host, parsedUrl.port)) {
                                                         ^
In file included from C:\Users\KoGMa\Documents\Arduino\libraries\Fetch\src\Fetch.cpp:2:0:
C:\Users\KoGMa\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\WiFiClientSecure\src/WiFiClientSecure.h:48:9: note: candidate: virtual int WiFiClientSecure::connect(IPAddress, uint16_t)
     int connect(IPAddress ip, uint16_t port);
         ^
C:\Users\KoGMa\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\WiFiClientSecure\src/WiFiClientSecure.h:48:9: note:   no known conversion for argument 1 from 'String' to 'IPAddress'
C:\Users\KoGMa\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\WiFiClientSecure\src/WiFiClientSecure.h:49:9: note: candidate: virtual int WiFiClientSecure::connect(IPAddress, uint16_t, int32_t)
     int connect(IPAddress ip, uint16_t port, int32_t timeout);
         ^
C:\Users\KoGMa\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\WiFiClientSecure\src/WiFiClientSecure.h:49:9: note:   candidate expects 3 arguments, 2 provided
C:\Users\KoGMa\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\WiFiClientSecure\src/WiFiClientSecure.h:50:9: note: candidate: virtual int WiFiClientSecure::connect(const char*, uint16_t)
     int connect(const char *host, uint16_t port);
         ^
C:\Users\KoGMa\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\WiFiClientSecure\src/WiFiClientSecure.h:50:9: note:   no known conversion for argument 1 from 'String' to 'const char*'
C:\Users\KoGMa\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\WiFiClientSecure\src/WiFiClientSecure.h:51:9: note: candidate: virtual int WiFiClientSecure::connect(const char*, uint16_t, int32_t)
     int connect(const char *host, uint16_t port, int32_t timeout);
         ^
C:\Users\KoGMa\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\WiFiClientSecure\src/WiFiClientSecure.h:51:9: note:   candidate expects 3 arguments, 2 provided
C:\Users\KoGMa\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\WiFiClientSecure\src/WiFiClientSecure.h:52:9: note: candidate: int WiFiClientSecure::connect(IPAddress, uint16_t, const char*, const char*, const char*)
     int connect(IPAddress ip, uint16_t port, const char *rootCABuff, const char *cli_cert, const char *cli_key);
         ^
C:\Users\KoGMa\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\WiFiClientSecure\src/WiFiClientSecure.h:52:9: note:   candidate expects 5 arguments, 2 provided
C:\Users\KoGMa\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\WiFiClientSecure\src/WiFiClientSecure.h:53:9: note: candidate: int WiFiClientSecure::connect(const char*, uint16_t, const char*, const char*, const char*)
     int connect(const char *host, uint16_t port, const char *rootCABuff, const char *cli_cert, const char *cli_key);
         ^
C:\Users\KoGMa\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\WiFiClientSecure\src/WiFiClientSecure.h:53:9: note:   candidate expects 5 arguments, 2 provided
C:\Users\KoGMa\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\WiFiClientSecure\src/WiFiClientSecure.h:54:9: note: candidate: int WiFiClientSecure::connect(IPAddress, uint16_t, const char*, const char*)
     int connect(IPAddress ip, uint16_t port, const char *pskIdent, const char *psKey);
         ^
C:\Users\KoGMa\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\WiFiClientSecure\src/WiFiClientSecure.h:54:9: note:   candidate expects 4 arguments, 2 provided
C:\Users\KoGMa\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\WiFiClientSecure\src/WiFiClientSecure.h:55:9: note: candidate: int WiFiClientSecure::connect(const char*, uint16_t, const char*, const char*)
     int connect(const char *host, uint16_t port, const char *pskIdent, const char *psKey);
         ^
C:\Users\KoGMa\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\WiFiClientSecure\src/WiFiClientSecure.h:55:9: note:   candidate expects 4 arguments, 2 provided

What would you recommend to do to get this working with an ESP32 board?

@instanceofMA instanceofMA self-assigned this Jan 31, 2022
@instanceofMA instanceofMA added the bug Something isn't working label Jan 31, 2022
@instanceofMA
Copy link
Owner

Hey @HatterIsMad, I'm sorry I made a really dumb mistake w.r.t the LCBUrl library! Resolved it now.

I've also added some support for ESP32, it compiles now, but will test it as I get my hands on the ESP32 board at office. I'll update you by tomorrow.

Really appreciate you pointing it out!

@HatterIsMad
Copy link
Author

I pulled the code out of your repo and it compiled properly on my ESP32.
I then implemented a test to my own server with https using the caCert option.
That was successful and everything operated as expected.

Thank you, you beautiful person.

@instanceofMA
Copy link
Owner

That's great! I couldn't test it yet, but this means I can create a release and publish it to Arduino's Library Manager. Thanks for being proactive ❤️.

@HatterIsMad
Copy link
Author

I think there was one other thing I had to do initially to get the project to compile.

I originally copied some of the code out of the Readme, and the line of code that reads, "const char* statusText = response.statusText;", gave a compilation error complaining that response.statusText is of type string, and the statusText variable in scope was being declared as a char array.

I changed the statusText variable to be a String and that solved that issue.

@instanceofMA
Copy link
Owner

Yes the Readme needs to be updated. Thanks for pointing out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants