my ESP32wroom does not receive data from ESP32c3supermini
Both ESP32 must be able to both send and receive.
The code retruns no error message
Code: Select all
WiFi.mode(WIFI_AP_STA); //Mode de fonctionnement: serveur (AP) et « station »
WiFi.softAPConfig(APlocalIP, APgateway, APsousRes);
WiFi.softAP(APssid, APpwsd); //Point d'accès ... ceci servira aux ESP8266 satellites selon la syntaxe WiFi.softAP(ssid, pwsd);
WiFi.STA.begin();
if (esp_now_init() == ESP_OK) {
Serial.println("ESP_now est bien démarré.");
esp_now_register_recv_cb(esp_now_recv_cb_t(Recevons));
esp_now_register_send_cb(esp_now_send_cb_t(Envoyames));
peerInfo.encrypt = false;
memcpy(peerInfo.peer_addr, adresPRINC, 6);
Serial.println((esp_now_add_peer(&peerInfo) != ESP_OK) ? "Échec avec peerInfo de adresPRINC. " : "Infos adresPRINC chargée.");
}
Code: Select all
interESP.genre = 2;
esp_now_send(adresPRINC, (uint8_t *) &interESP, sizeof(interESP));
Code: Select all
void Envoyames(uint8_t *mac_addr, uint8_t status) {
Serial.print("Nous avons expédié, et voici le résultat : \t");
Serial.println(status == ESP_NOW_SEND_SUCCESS ? " OK " : " Oups! ");
}On its side, wroom does show absolutly nothing as receipient, even if its receiving code ask for SerialPrint like
Code: Select all
void Recevons(const uint8_t * mac, const uint8_t *incomingData, int len) {
memcpy(&interESP, incomingData, sizeof(interESP));
Serial.print ("Nous recevons depuis le module ");
Serial.print (String(mac[0]));
Serial.print (":");
Serial.print (String(mac[1]));
Serial.print (":");
Serial.print (String(mac[2]));
Serial.print (":");
Serial.print (String(mac[3]));
Serial.print (":");
Serial.print (String(mac[4]));
Serial.print (":");
Serial.println(String(mac[5]));
Serial.print ("Nous sommes ici en ligne de réception (302) avec ");
Serial.print ("le genre = ");
Serial.println(interESP.genre);
}
About you ... what's my problem ?
Thanks.