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

Problems compiling for ESP32 (works great for ESP8266) #13

Open
DAKarp opened this issue Dec 9, 2019 · 5 comments
Open

Problems compiling for ESP32 (works great for ESP8266) #13

DAKarp opened this issue Dec 9, 2019 · 5 comments

Comments

@DAKarp
Copy link

DAKarp commented Dec 9, 2019

I've been using this library for a while with an ESP8266 - works great. But when I compile it against the ESP32 platform (using PlatformIO), I get a bunch of errors, such as:

/.platformio/lib/EasyOTA_ID1975/src/JeVe_EasyOTA.cpp: In member function 'int EasyOTA::scanWifi(long unsigned int)': /.platformio/lib/EasyOTA_ID1975/src/JeVe_EasyOTA.cpp:247:5: error: 'uint8' was not declared in this scope uint8 bestBSSID[6]; ^ /.platformio/lib/EasyOTA_ID1975/src/JeVe_EasyOTA.cpp:261:96: error: no matching function for call to 'WiFiClass::getNetworkInfo(int8_t&, String&, uint8_t&, int32_t&, uint8_t*&, int32_t&, bool&)' WiFi.getNetworkInfo(i, ssid_scan, sec_scan, rssi_scan, BSSID_scan, chan_scan, hidden_scan); ^ /.platformio/lib/EasyOTA_ID1975/src/JeVe_EasyOTA.cpp:279:25: error: 'ENC_TYPE_NONE' was not declared in this scope if ((sec_scan == ENC_TYPE_NONE && _allowOpen && exhausted) || cap) { ^ ^ /.platformio/lib/EasyOTA_ID1975/src/JeVe_EasyOTA.cpp: In member function 'void EasyOTA::loop(long unsigned int)': /.platformio/lib/EasyOTA_ID1975/src/JeVe_EasyOTA.cpp:327:31: error: no matching function for call to 'WiFiClass::setHostname(String&)' WiFi.setHostname(_hostname); ^ /.platformio/packages/framework-arduinoespressif32/libraries/WiFi/src/WiFiSTA.h:76:10: note: no known conversion for argument 1 from 'String' to 'const char*'

Any suggestions?

@jeroenvermeulen
Copy link
Owner

Can you try it in the Arduino IDE with the ESP32 add-on?
You are welcome to propose a PR to make this library also compatible for PlatformIO.

@DAKarp
Copy link
Author

DAKarp commented Dec 14, 2019

Thanks for the reply. Didn’t try on Arduino ide because I don’t have that set up. But ArduinoOTA worked just fine, so I’m using that.

I suspect there’s a dependency of easyota that’s included in the esp8266 platform (and not esp32) but that isn’t explicitly required by the easyota lib.

@KissInno
Copy link

KissInno commented Jan 3, 2020

Your lib looks short & I'd like to try it. However, I cannot compile your example from PlatformIO with Arduino framework, neither with ESP32 nor ESP8266 MCU:

ESP8266:
no matching function for call to 'EasyOTA::onMessage(setup()::__lambda0)'

ESP32:
invalid user-defined conversion from 'setup()::<lambda(char*, int)>' to 'int' [-fpermissive]

And once you enjoyed PlatformIO, it is hard to get back to Arduino IDE.

@jeroenvermeulen
Copy link
Owner

jeroenvermeulen commented Jan 3, 2020 via email

@dervomsee
Copy link

Hi @KissInno and @jeroenvermeulen,
i am using the lib currently in Platformio. For ESP8266 it works great.
The onMessage callback function needs to be configured in the following way:

void displayLine(const String &message, int line_nr)
{
  Serial.println(message);
}

This function needs to be declared before the setup function. With the library you can connect it in the following way:

OTA.onMessage(&displayLine); 

The following short version does work for me either. It generates the error error: no matching function for call to 'EasyOTA::onMessage(setup()::<lambda(char*, int)>)

OTA.onMessage([](char *message, int line) {
    Serial.println(message);
  });

With a version for ESP32 i'm also struggling. When i have a result for that, i will post it here.

BR, Cornelius

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants