-
Notifications
You must be signed in to change notification settings - Fork 7.6k
ESPNOW Duplex Mode #1467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
There is nothing preventing slaves from sending data. You will need to modify the code to have a send function. https://esp-idf.readthedocs.io/en/latest/api-reference/wifi/esp_now.html |
Then how can i get the peer information to send the data from the slave to the master? |
Sorry, I don't know. I probably should have kept my mouth shut. This might help https://github.com/cmmakerclub/esp-now-all-to-master |
Slave can send the data to a predefined MAC address of the master. SSID is not used in this case. You can set the master's MAC using the function esp_base_mac_addr_set |
@eg-astrouka then should i set the wifi mode to (WIFI_AP_STA) or (WIFI_AP)?? |
@Mahmoudomar91 for the master it works on my side like that
Slave has |
@eg-astrouka thanks for the code i tried it and it worked. Also i saw the issue you mention and i wrote its solution. |
@Mahmoudomar91 slave code looks like
Slave and master should use the same CHANNEL |
If you have solved your issue, please close it. |
@lbernstone well i haven't tried the code yet. but i will close it and if any issue happened i will reopen it |
Hey @Mahmoudomar91, where you able to work this out? I want to solve the same problem (having ESP1 and ESP2 send data both ways) but I'm having a hard time understanding what to do from the code pasted here. I'm having no trouble with the classic Master to Slave approach; having one ESP32 with an IR sensor communicating to another ESP32 with a LED. But what I want is for both to have an IR sensor and a LED so they can communicate both ways. Let me know! |
Hardware:
Board: ?ESP32 Dev Module?
IDE name: Arduino IDE
Flash Frequency: 40Mhz
Upload Speed: 115200
Description:
I am trying to send and receive data through ESPNOW between two ESP32 boards, lets call them ESP1 & ESP2.
The thing is that if i want to send data from ESP1 to ESP2 i have to initialize ESP1 as master and ESP2 as slave and when i want to get the reply from the first transmission I set ESP2 as master and ESP1 as a slave and so on.
so maybe sometimes a timing issue occurs when the two devices are both set as masters or as slaves at the same time. This causes a problem as they both halt and wait for data.
Is there a way to make this process easier or make both devices master and slave at the same time so that they can send and receive data simultaneously ?
The text was updated successfully, but these errors were encountered: