Compile Problems with ESP32 Dev Module and SYSTEM_EVENT_SCAN_DONE....
Hello,
I am trying to compile the following example code below, and I am getting these compile errors:
C:\Users\cjh39\Documents\Arduino\libraries\painlessMesh-master\src/arduino/wifi.hpp:252:22: error: 'SYSTEM_EVENT_SCAN_DONE' is not a member of 'arduino_event_id_t'
WiFiEvent_t::SYSTEM_EVENT_SCAN_DONE);
^~~~~~~~~~~~~~~~~~~~~~
C:\Users\cjh39\Documents\Arduino\libraries\painlessMesh-master\src/arduino/wifi.hpp:261:22: error: 'SYSTEM_EVENT_STA_START' is not a member of 'arduino_event_id_t'
WiFiEvent_t::SYSTEM_EVENT_STA_START);
^~~~~~~~~~~~~~~~~~~~~~
C:\Users\cjh39\Documents\Arduino\libraries\painlessMesh-master\src/arduino/wifi.hpp:272:22: error: 'SYSTEM_EVENT_STA_DISCONNECTED' is not a member of 'arduino_event_id_t'
WiFiEvent_t::SYSTEM_EVENT_STA_DISCONNECTED);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\cjh39\Documents\Arduino\libraries\painlessMesh-master\src/arduino/wifi.hpp:282:22: error: 'SYSTEM_EVENT_STA_GOT_IP' is not a member of 'arduino_event_id_t'
WiFiEvent_t::SYSTEM_EVENT_STA_GOT_IP);
^~~~~~~~~~~~~~~~~~~~~~~
We have the following libraries installed
- ArduinoJson (by bblanchon): https://github.com/bblanchon/ArduinoJson
- TaskScheduler: https://github.com/arkhipenko/TaskScheduler
- ESPAsyncTCP (ESP8266): https://github.com/me-no-dev/ESPAsyncTCP
- AsyncTCP (ESP32): https://github.com/me-no-dev/AsyncTCP
With Espressif Systems version 1.0.6 Installed. If we try 2.0.0 or 2.0.1 or any other version we still get errors.
Also I am getting this error: Could not find boards.txt in E:\WORKING\arduino-nightly\hardware\espressif\esp32. Is it pre-1.5? WARNING: Error loading hardware folder E:\WORKING\arduino-nightly\hardware\espressif No valid hardware definitions found in folder espressif.
Can you please tell me how to fix it ?
Thanks
/*
Rui Santos
Complete project details at https://RandomNerdTutorials.com/esp-mesh-esp32-esp8266-painlessmesh/
This is a simple example that uses the painlessMesh library: https://github.com/gmag11/painlessMesh/blob/master/examples/basic/basic.ino
*/
#include "painlessMesh.h"
#include <ArduinoJSON.h>
#define MESH_PREFIX "whateverYouLike"
#define MESH_PASSWORD "somethingSneaky"
#define MESH_PORT 5555
Scheduler userScheduler; // to control your personal task
painlessMesh mesh;
// User stub
void sendMessage() ; // Prototype so PlatformIO doesn't complain
Task taskSendMessage( TASK_SECOND * 1 , TASK_FOREVER, &sendMessage );
void sendMessage() {
String msg = "Hi from node1";
msg += mesh.getNodeId();
mesh.sendBroadcast( msg );
taskSendMessage.setInterval( random( TASK_SECOND * 1, TASK_SECOND * 5 ));
}
// Needed for painless library
void receivedCallback( uint32_t from, String &msg ) {
Serial.printf("startHere: Received from %u msg=%s\n", from, msg.c_str());
}
void newConnectionCallback(uint32_t nodeId) {
Serial.printf("--> startHere: New Connection, nodeId = %u\n", nodeId);
}
void changedConnectionCallback() {
Serial.printf("Changed connections\n");
}
void nodeTimeAdjustedCallback(int32_t offset) {
Serial.printf("Adjusted time %u. Offset = %d\n", mesh.getNodeTime(),offset);
}
void setup() {
Serial.begin(115200);
//mesh.setDebugMsgTypes( ERROR | MESH_STATUS | CONNECTION | SYNC | COMMUNICATION | GENERAL | MSG_TYPES | REMOTE ); // all types on
mesh.setDebugMsgTypes( ERROR | STARTUP ); // set before init() so that you can see startup messages
mesh.init( MESH_PREFIX, MESH_PASSWORD, &userScheduler, MESH_PORT );
mesh.onReceive(&receivedCallback);
mesh.onNewConnection(&newConnectionCallback);
mesh.onChangedConnections(&changedConnectionCallback);
mesh.onNodeTimeAdjusted(&nodeTimeAdjustedCallback);
userScheduler.addTask( taskSendMessage );
taskSendMessage.enable();
}
void loop() {
// it will run the user scheduler as well
mesh.update();
}
Edited by BlackEdder