[Solved] No info passed from superMini to wroom through espNow

Patriboom
Posts: 8
Joined: Fri Sep 23, 2022 2:27 am

[Solved] No info passed from superMini to wroom through espNow

Postby Patriboom » Wed Mar 11, 2026 2:18 pm

Hello,
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.");
}  
but, still, when superMini tries to send to wroom,

Code: Select all

     interESP.genre = 2;
      esp_now_send(adresPRINC, (uint8_t *) &interESP, sizeof(interESP));
 
I receive a « Oups! » from

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.
Last edited by Patriboom on Fri Mar 13, 2026 3:37 pm, edited 1 time in total.

lbernstone
Posts: 1132
Joined: Mon Jul 22, 2019 3:20 pm

Re: No info passed from superMini to wroom through espNow

Postby lbernstone » Wed Mar 11, 2026 5:17 pm

I didn't look closely at your code, but you must ensure that ESP_NOW nodes are using the same WiFi channel (ie, tuned to the same radio frequency). Look at the old examples if you don't want to use the fully OO library.

Patriboom
Posts: 8
Joined: Fri Sep 23, 2022 2:27 am

Re: No info passed from superMini to wroom through espNow

Postby Patriboom » Wed Mar 11, 2026 7:03 pm

That's a good tip.
I'll try the library you suggest me rather than the one already installed (default intalled).
https://github.com/espressif/arduino-es ... Master.ino ' code starts like
#include <Arduino.h>
#include "ESP32_NOW.h"
#include "WiFi.h"
I can at once see it's using different library, since my code starts like

Code: Select all

#include <esp_now.h>    //  Cette fonction est incluse dans la bibliothèque ESP32  sinon :  https://github.com/espressif/esp-idf/blob/master/components/esp_wifi/include/esp_now.h
                        //exemples :  https://www.aranacorp.com/fr/communication-entre-deux-esp32-avec-esp-now/
Thanks. I'll try it and let you know.

lbernstone
Posts: 1132
Joined: Mon Jul 22, 2019 3:20 pm

Re: No info passed from superMini to wroom through espNow

Postby lbernstone » Wed Mar 11, 2026 8:19 pm

arduino-esp32 is a C++ wrapper/hal around the esp-idf. Your code is probably based off something like the esp-idf espnow example. There's more than one way to do it.

Patriboom
Posts: 8
Joined: Fri Sep 23, 2022 2:27 am

Re: No info passed from superMini to wroom through espNow

Postby Patriboom » Thu Mar 12, 2026 3:25 am

Thanks.
I could not find any difference between my old code and the one I just rebuilt but now it's working, based on - still - esp_now and examples given in https://randomnerdtutorials.com/esp-now ... duino-ide/.

Thanks all. Sorry for those who encounter the same issue, I can not help from this experience.

Patriboom
Posts: 8
Joined: Fri Sep 23, 2022 2:27 am

Re: No info passed from superMini to wroom through espNow

Postby Patriboom » Thu Mar 12, 2026 5:13 am

Ok more info:

esp_now transmission doesn't work when WiFi.begin(ssid, pswd) is there ( there is a Wifi connection live).
I have to find out how to sucess with that ... maybe after a WiFi.end() ? WiFi.disconnect() ?

Patriboom
Posts: 8
Joined: Fri Sep 23, 2022 2:27 am

Re: No info passed from superMini to wroom through espNow

Postby Patriboom » Fri Mar 13, 2026 3:36 pm

Solution found:

Code: Select all

  WiFi.begin(ssid, pswd);
///tasks to do on line
//
WiFi.disconnect();
WiFi.mode(WIFI_OFF);
WiFi.mode(WIFI_STA);
////Loading and processing the esp_now tasks

Who is online

Users browsing this forum: ChatGPT-User and 2 guests