Problem compiling Platformio ESP32
They are testing your library, but when compiling VC with Platformio, I have errors in SLAVE:
espNowFloodingMesh_requestInstantTimeSyncFromMaster(); while(espNowFloodingMesh_isSyncedWithMaster()==false);
src/main.cpp: In function 'void setup()': src/main.cpp:38:3: error: 'espNowFloodingMesh_requestInstantTimeSyncFromMaster' was not declared in this scope
src/main.cpp:39:9: error: 'espNowFloodingMesh_isSyncedWithMaster' was not declared in this scope
two functions are missing in the libraries.
my code: #include <Arduino.h> #include <EspNowFloodingMesh.h> #include <WiFi.h> #include <time.h>
#define LED 2
#define ESP_NOW_CHANNEL 1 #define B_SSID 14 //AES 128bit unsigned char secredKey[] = {0x00,0x11,0x22,0x33,0x44,0x55,0x66,0x77,0x88,0x99,0xAA,0xBB,0xCC,0xDD,0xEE, 0xFF};
void espNowFloodingMeshRecv(const uint8_t data, int len, uint32_t replyPrt){ if(len>0) { Serial.println((const char)data); } } //----------------------------------------
//####################################################################
void setup() {
Serial.begin(115200);
WiFi.mode(WIFI_MODE_STA);
Serial.println(WiFi.macAddress());
//Set device in AP mode to begin with
espNowFloodingMesh_RecvCB(espNowFloodingMeshRecv);
espNowFloodingMesh_begin(ESP_NOW_CHANNEL, B_SSID);
espNowFloodingMesh_secredkey(secredKey);
espNowFloodingMesh_setToBatteryNode();
//Ask instant sync from master. espNowFloodingMesh_requestInstantTimeSyncFromMaster(); while(espNowFloodingMesh_isSyncedWithMaster()==false);
pinMode(LED, OUTPUT); digitalWrite(LED, HIGH); } //####################################################################
//#################################################################### void loop() { static unsigned long m = millis();
//Ask instant sync from master. if(m+5000<millis()) { char message[] = "SLAVE HELLO MESSAGE"; espNowFloodingMesh_send((uint8_t*)message, sizeof(message), 3); //set ttl to 3 m = millis(); } espNowFloodingMesh_loop(); delay(10); } //####################################################################