I am in need of help with a Mesh Network issue. This is the response I get when I compile:
Painless_Mesh\src/arduino/wifi.hpp:49:14: error: 'class WiFiClass' has no member named 'setAutoConnect'; did you mean 'setAutoReconnect'?
49 | WiFi.setAutoConnect(false)); // Disable autoconnect
I changed the code in "wifi.hpp" to 'setAutoReconnect' but the nodes don't connect. So hopefully someone can point me in the right direction.
This is the error message I get when I compile Examples->Painless Mesh->Basic
The error code comes from wifi.hpp in Painless_Mesh
\Documents\Arduino\basic_Mesh\basic_Mesh.ino:8:
c:\Users\XX\OneDrive\Documents\Arduino\libraries\Painless_Mesh\src/arduino/wifi.hpp: In member function 'void painlessmesh::wifi::Mesh::init(TSTRING, TSTRING, uint16_t, wifi_mode_t, uint8_t, uint8_t, uint8_t)':
c:\Users\XX\OneDrive\Documents\Arduino\libraries\Painless_Mesh\src/arduino/wifi.hpp:49:10: error: 'class WiFiClass' has no member named 'setAutoConnect'; did you mean 'setAutoReconnect'?
49 | WiFi.setAutoConnect(false)); // Disable autoconnect
| ^~~~~~~~~~~~~~
| setAutoReconnect
* @param ssid The name of your mesh. All nodes share same AP ssid. They are
* distinguished by BSSID.
* @param password Wifi password to your mesh.
* @param port the TCP port that you want the mesh server to run on. Defaults
* to 5555 if not specified.
* @param connectMode Switch between WIFI_AP, WIFI_STA and WIFI_AP_STA
* (default) mode
*/
void init(TSTRING ssid, TSTRING password, uint16_t port = 5555,
WiFiMode_t connectMode = WIFI_AP_STA, uint8_t channel = 1,
uint8_t hidden = 0, uint8_t maxconn = MAX_CONN) {
using namespace logger;
// Init random generator seed to generate delay variance
randomSeed(millis());
// Shut Wifi down and start with a blank slage
if (WiFi.status() != WL_DISCONNECTED) WiFi.disconnect();
Log(STARTUP, "init(): %d\n",
WiFi.setAutoConnect(false)); // Disable autoconnect
WiFi.persistent(false);
// start configuration
if (!WiFi.mode(connectMode)) {
Log(GENERAL, "WiFi.mode() false");
}
_meshSSID = ssid;
_meshPassword = password;
_meshChannel = channel;
_meshHidden = hidden;
_meshMaxConn = maxconn;
I have the same problem, but I am not using the WiFi library at all—only painlessMesh. In the setup, I am using mesh.init() with the parameters of my access point, which is also the mesh. Until today, everything worked for me, but I made updates that Arduino ide recommended, and it messed up the compilatin process
I have the same issue with the painlessMesh example code. Tried changing setAutoConnect to setAutoReconnect in the wifi.hpp file and it doesn't seem to be connecting
The code compiles but my two nodes still don't communicate with each other when using the example startHere code. I'm unsure if that's related to this problem specifically but I thought I'd share incase this helps anyone else
Hi, I have a sketch that was compiling fine, then all of sudden started throwing the
painlessMesh error error: 'class WiFiClass' has no member named 'setAutoConnect'; did you mean 'setAutoReconnect'?
49 | WiFi.setAutoConnect(false)); // Disable autoconnect
I have another sketch for the same board that works fine, the only difference is it doesn't include the painlessMesh library, so that pretty well narrows it down. Both are using the official Arduino JSON library.
As mentioned, the sketch that compiles only includes the Arduino_JSON library without painlessMesh. I will post this on the Heltec forum as well and let you know if someone there has any ideas.
Luca on the painlessMesh forum instructed me to install the develop version from the painlessMesh GIT. The Arduino IDE Library Manager now indicates v1.5.3 and compiles without issue.