• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

ESP-NOW only supports 3 nodes to master, not 4.

Q&A Forum › Category: ESP32 › ESP-NOW only supports 3 nodes to master, not 4.
0 Vote Up Vote Down
DON PREFONTAINE asked 2 months ago

I have modified lab 10.4.2 to have 4 nodes talking to a single host/master. Even though each of the 4 nodes reports  “Sent IDx  AHT10 Readings with Success”, only 3 are showing stats on the master – not the fourth (ID4). 10_4_2_esp-now_many-to-one_Receiver_ID0_Timer_ST7796S.zip is the host/master file and 10_4_1_esp-now_many-to-one_sender_ID4.zip is the node file. Node files with ID1 through ID4 are identical except for their ID numbers.
https://www.networkhorizons.com/EP/45_ESP32-C3_ESP-NOW/v1.0/Code/10_4_1_esp-now_many-to-one_sender_ID4.zip
https://www.networkhorizons.com/EP/45_ESP32-C3_ESP-NOW/v1.0/Code/10_4_2_esp-now_many-to-one_Receiver_ID0_Timer_ST7796S.zip
Additionally, the master’s Serial Monitor is not matching the correct ID of the satellite node. I tried to use this file to clean up the cache to no avail:https://www.networkhorizons.com/EP/45_ESP32-C3_ESP-NOW/v1.0/Code/ESP32-C3_Super_Mini_Forget_Cache.zip
Any help on why all 4 nodes send their traffic sucessfully but the master only displays 1 through 3 on the Serial Monitor and TFT display. Node that ID0 is the master reporting on its BME280 sensor whereas the satellite nodes are sporting AHT10 sensors.

Question Tags: Esp-now
22 Answers
0 Vote Up Vote Down
William Lucid answered 2 months ago

Might be a syncing issue were message is arriving when another mesage is printing to Serial Monitor.  Are you using flags to control when a message is sent?

Example of “on demand” data collection using flag syncing

Regards,

William

0 Vote Up Vote Down
DON PREFONTAINE answered 2 months ago

Before I have to change the code to accommodate the flags idea, I thought I would try something else. 
All 4 boards were disconnected and the master was reset. 
Board ID1 was powered up and was seen by the master. It was powered down and ID2 was powered up and seen by the master. As with ID1, the first byte of the Raw Data matched the ID#. 
I powered down ID2 and powered up ID3; all is well. I powered down ID3.
When I powered up board ID4, it’s node readings were being sent but the board was not seen at all by the master. I powered down board ID4.
 
Next I powered up each board in order (ID1, ID2, ID3, ID4) once I could see that the previous ID matched the board and Raw Data. All was well but once again ID4 could not be seen.
 
There has to be something in my code, some hidden limit, that is preventing board 4 from being seen by the master. 
 
Next, I replaced board 4 with board 5 and tried using ID4 code – no change.
I tried board 6 with ID1 code: it showed ID1 stats in master’s SM but not on the TFT display.
I tried board 6 with ID4 code: it showed ID4 stats in master’s SM but on the TFT display they are on the line used by ID3.
 
Time to take a break because if there is a failure pattern, it presently eludes me.

0 Vote Up Vote Down
Sara Santos Staff answered 2 months ago

Hi.
It must be something related to your code. To how your handling the board IDs.
Have you tried just plugging board 4?
 
Regards,
Sara
 

0 Vote Up Vote Down
DON PREFONTAINE answered 2 months ago

Sara
I unplugged all the boards. Then I replugged node ID4 and the master. Node ID4 shows last packet sent with success. However, there is also an error “Board 4: Last packet send status: Status: Delivery Fail!” which is from the “OnDataSent()” callback function.

The master serial monitor (SM) does not show node ID4 nor does the master’s TFT display.

Attached are two screenshots: one of ID4 and one of the master.Master and one of ID4.ID4

 

0 Vote Up Vote Down
DON PREFONTAINE answered 2 months ago

I don’t know if the two images went thru so here are links to them.
https://www.networkhorizons.com/EP/45_ESP32-C3_ESP-NOW/v1.0/Pix/Master.png
https://www.networkhorizons.com/EP/45_ESP32-C3_ESP-NOW/v1.0/Pix/Node_ID4.png

0 Vote Up Vote Down
William Lucid answered 2 months ago

Hi Don,

If one digit of the MAC Address is wrong there will be a “send status:  Delivery Fail”; would not hurt to print out Mac address of board ID4 and compare it ID4 MAC address in your code.  Check the Master MAC address in ID4 code.  Check MASTER code MAC Addressing in addition.  I speak of personal experience a single digit in one of the octets of the MAC address was causing the Delivery Fail!

WiFi.begin(ssid, password);
Serial.print("Connecting to WiFi");

// Set WiFi to Station mode (required for ESP-NOW)
WiFi.mode(WIFI_STA);
Serial.println("WiFi STA mode set");

while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.print(".");
}

Serial.println("WiFi connected");
Serial.println("Local IP: " + WiFi.localIP().toString());
//Serial.println("MAC Address: " + WiFi.macAddress());
// This is the mac address of the Master in Station Mode
Serial.print("STA MAC: ");
Serial.println(WiFi.macAddress());
Serial.print("STA CHANNEL ");
Serial.println(WiFi.channel());

Assuming code is correct; try another board with the same ID4 code.  This will elimate hardware issue with WiFi; will be a different MAC address, code will need to be modified for the new MAC address.

Regards,
William

0 Vote Up Vote Down
DON PREFONTAINE answered 2 months ago

Thanks, William. I changed the master to an Adafruit Feather ESP32-S3 and all of the Send Status messages changed from Delivery Fail to Delivery Success. All but for board ID4 – it still fails. Yet on its Serial Monitor (SM) it shows “Sent ID4 AHT10 Readings with success.”
When I had the pathetically slow 4.0″ JC2432S028 equivalent TFT 320×480 ST7796S working with the ESP32-C3 Super Mini, it could not keep up and would often not display any or just one of the satellite boards’ info. So I replaced the master with a Feather ESP32-S3 and the 4.0″ TFT for the same 1.3″ OLED used on all 4 satellite node boards.
Here is a link to a short video showing the 4 nodes updating their displays from the AHT10 sensors, as well as the master at the bottom of the video: it is showing all 4 nodes but ID4 has no sensor data. https://www.networkhorizons.com/EP/45_ESP32-C3_ESP-NOW/v1.0/Pix/Master_4-Nodes.mp4
This afternoon I’ll go thru all 4 satellite and the master sketches and see if I can find any discrepancies before trying the Flags idea presented earlier.

0 Vote Up Vote Down
William Lucid answered 2 months ago

Have you confirmed correct MAC Addresses for ID4 board and the Master Board?  Very important.

Board ID4 has  “Sent ID4 AHT10 Readings with success.”  However, if the Master address the message was sent to is wrong; message will fail delivery.

Check where ID4 board actually sends message to master.  Is this addressed correct?
William

0 Vote Up Vote Down
William Lucid answered 2 months ago

duplicate, admin please remove.

0 Vote Up Vote Down
DON PREFONTAINE answered 2 months ago

Yes, I checked the Master address in each of the IDx board files. I had to change it when I recently replaced the ESP32-C3 Super Mini with an Adafruit Feather ESP-S3 board.

0 Vote Up Vote Down
William Lucid answered 1 month ago

Hi Don,

Check “10_4_2_esp_now_many-to-one_Receiver_ID0_Timer_ST7796S.ino”

Lines 138, 195, and 293 only show three incoming IDs:  “incomingIDs_123();”  Correct?

William

0 Vote Up Vote Down
DON PREFONTAINE answered 1 month ago

Willliam, agreed. ‘incomingIDs_123()’ is just the name of the routine. If you examine it you’ll see that I should have changed it to ‘incomingIDs_1234()’ because there are 4 situations where I issue a ‘tft.print(boardxTc)’ where ‘x’ is the board number. 
The display I was using can be found by searching “4.0 Inch SPI Touchscreen TFT LCD Module 4.0″ ST7796S Driver 480X320”. It’s incredibly slow. I think it’s the reason I could not get the microcontroller to pickup and display the stats. So I dumped it in favor/favour of a 1.3″ OLED: search “1.3” 128×64 I2C OLED Display Module” and I increased the ‘horsepower’ of the master by replacing the ESP32-C3 Super Mini https://github.com/sidharthmohannair/Tutorial-ESP32-C3-Super-Mini with an Adafruit Feather ESP32-S3 https://learn.adafruit.com/adafruit-esp32-s3-feather/overview
I’m working on getting not just the first 3 nodes to display on the OLED but the 4th node, too. I’ll update as soon as I know. Thanks.

0 Vote Up Vote Down
William Lucid answered 1 month ago

Don, my apologies for not catching that was a function name.

Have you tried printing to Serial monitor; ID4 and values from the OnRecv function?

William

0 Vote Up Vote Down
DON PREFONTAINE answered 1 month ago

I cleaned up the master and four node sketches. They can be found zipped up here: https://www.networkhorizons.com/EP/45_ESP32-C3_ESP-NOW/v1.0/Code/10_4_2_esp-now_many-to-one.zip
I added the RAW content request to the master sketch. Here’s a screenshot of the output: only the first 3 of the 4 nodes is showing. On the 4th node, it continually reports “Delivery FAIL!” as shown below:

0 Vote Up Vote Down
William Lucid answered 1 month ago

Don,
Thanks for providing screen shots and logs;  Kinda all gets lost in the monitors lack of contrast; even with adjustment.  May I email you with a request to attach screen captures and log you posted?  I have downloaded your latest code and will look for anything holding ID4 from displaying data.  Will likely later tonight or tommorow.; before have chance to review your code.
 
William
 
William

0 Vote Up Vote Down
DON PREFONTAINE answered 1 month ago

Ok, send an email to prefontDon@gmail.com and I’ll send you whatever you need. Thanks.

0 Vote Up Vote Down
William Lucid answered 1 month ago

Don,

Gist of OnRecv troubleshooting code from ChatGPT

Verify the sender is using AHT10Readings.id = 4 before sending.

 

William

0 Vote Up Vote Down
DON PREFONTAINE answered 1 month ago

I think I found the problem. When I rebooted ID4 it reverted to its full strength WiFi power of 80dBm.
It seems it made the signal too strong for the master to read.
I reinstituted dropping the power setting to 2dBM (really 8dBm) at the end of setup() on all of the local boards and now ID4 is behaving properly.
I’m going to scrounge up components to build a 5th board and see if that works, too.
Here’s the code:

Start your code here
//-----------------------------------
void txStrength() {                  // Show the transmit power level in dBm. Note that there is a x4 multiplier: setting to 2dBm reveals 8dBm measurement. 
WiFi.setTxPower(WIFI_POWER_2dBm);   // "2" = 8dBm, "5" = 20dBm. Range is 0 to 20.5 in 0.5 increments. 2,5,7,19 work with ESP32-C3. 
Serial.print("Default WiFi TX power was 80 dBm. Now it's "); 
Serial.print(WiFi.getTxPower());  
Serial.println(" dBm.\n");}
//-----------------------------------
Thanks for your help.
0 Vote Up Vote Down
DON PREFONTAINE answered 1 month ago

I think I found the problem. When I rebooted ID4 it reverted to its full strength WiFi power of 80dBm.
It seems it made the signal too strong for the master to read.
I reinstituted dropping the power setting to 2dBM (really 8dBm) at the end of setup() on all of the local boards and now ID4 is behaving properly.
I’m going to scrounge up components to build a 5th board and see if that works, too.
Here’s the code:

Start your code here
//-----------------------------------
void txStrength() {                  // Show the transmit power level in dBm. Note that there is a x4 multiplier: setting to 2dBm reveals 8dBm measurement. 
WiFi.setTxPower(WIFI_POWER_2dBm);   // "2" = 8dBm, "5" = 20dBm. Range is 0 to 20.5 in 0.5 increments. 2,5,7,19 work with ESP32-C3. 
Serial.print("Default WiFi TX power was 80 dBm. Now it's "); 
Serial.print(WiFi.getTxPower());  
Serial.println(" dBm.\n");}
//-----------------------------------
Thanks for your help.
0 Vote Up Vote Down
William Lucid answered 1 month ago

Good Morning Don,

You are welcome.  Well done, persistant, troubleshooting!  Over powering  the WiFi is not something I would have thought of to check.  Will make a note for my future troubleshooting.           
 
William

0 Vote Up Vote Down
DON PREFONTAINE answered 1 month ago

BTW, I found enough parts to try it with 6 sensor nodes reporting to one master/host and it’s working well. I found a couple of questionable AHT10 sensors I bought in bulk from AliExpress. I guess we can close this concern. Thanks to all.

0 Vote Up Vote Down
Sara Santos Staff answered 1 month ago

Hi.
Thanks for sharing the solution. I wouldn’t have thought of that small detail.
And thanks, William, for trying to help in this matter.
 
I’ll mark this issue as resolved. If you need further help, you just need to open a new question in our forum.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.