ESP-Now support for ESP32 (and ESP8266)
Re: ESP-Now support for ESP32 (and ESP8266)
- all 3 of them and Generic.
- will try that again ... it use to return true with v1.17 on all units.
- no
- will try that, probably tomorrow if it is not raining too hard!
I can check e0.get_peers as he is sitting beside me.
Last suggestion ... tomorrow.
Thank you for the hints.
- will try that again ... it use to return true with v1.17 on all units.
- no
- will try that, probably tomorrow if it is not raining too hard!
I can check e0.get_peers as he is sitting beside me.
Last suggestion ... tomorrow.
Thank you for the hints.
Re: ESP-Now support for ESP32 (and ESP8266)
e0.get_peers()
so, channel is 0, right?
Code: Select all
((b'\x08:\xf2\xab^\x04', b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', 0, 0, False),)
Re: ESP-Now support for ESP32 (and ESP8266)
And on the repeater:
because local is on channel 6 (WiFi) does that mean e0 is still on channel 0?
Code: Select all
e0.add_peer(local)
Re: ESP-Now support for ESP32 (and ESP8266)
Hi!
On the commit 44f65965b (espnow-g20-v1.19.1) for whatever reason I notice that espnow.peers_table is empty
but e.espnow.get_peers() returns the expected value
precisely it shows the new peer.
Shouldn't peers_table be automatically populated when I add an user with add_peer??
I am running the code on STA_IF, both sender/receiver on the same channel (wlan interfaces but in espnow module, set the channels to 2, as you can see above)
On the commit 44f65965b (espnow-g20-v1.19.1) for whatever reason I notice that espnow.peers_table is empty
Code: Select all
>>> e.espnow.peers_table
{}
Code: Select all
>>> e.espnow.get_peers()
((b'\x94\xb9~\xe3\xb5\xc4', b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', 2, 0, False),)
Shouldn't peers_table be automatically populated when I add an user with add_peer??
I am running the code on STA_IF, both sender/receiver on the same channel (wlan interfaces but in espnow module, set the channels to 2, as you can see above)
Re: ESP-Now support for ESP32 (and ESP8266)
In my prev post I tested with STA active, AP if disabled; same issues with AP enabled and STA active
After further testing, I see that the espnowObject.peers_table is only populated, with the new macs from add_peer, when both AP and STA interfaces are active (STA if can be disconnected but should be active, and of course same channel for all devices on the AP if).
This way it works well, sends the messages without errors.
Question: is this a bug? Shouldn't it work on either one of the interfaces, not necessarily both active in the same time ?
After further testing, I see that the espnowObject.peers_table is only populated, with the new macs from add_peer, when both AP and STA interfaces are active (STA if can be disconnected but should be active, and of course same channel for all devices on the AP if).
This way it works well, sends the messages without errors.
Question: is this a bug? Shouldn't it work on either one of the interfaces, not necessarily both active in the same time ?
Re: ESP-Now support for ESP32 (and ESP8266)
Having read several tutorials and howtos trying to do simultaneous ESPNow and WiFi I have the impression that this is even more difficult than trying to maintain a reliable WiFi connection.
For example:
https://randomnerdtutorials.com/esp8266 ... ore-100126
However, when you noted that this table was not populated could you ever get any messages through?
I had a test system going without having to have both STA and AP active. I would be interested to see your non-working code, ie before making STA and AP active. My test system was basically Glenn's proxy and sensor examples in the ESPNow and Wifi Operation section.
For example:
https://randomnerdtutorials.com/esp8266 ... ore-100126
The 3rd point where it talks about WIFI_AP_STA I haven't heard that mentioned here until you brought it up.There are a few things you need to take into account if you want to use Wi-Fi to host a web server and use ESP-NOW simultaneously to receive sensor readings from other boards:
The ESP8266 sender boards must use the same Wi-Fi channel of the receiver board.
The Wi-Fi channel of the receiver board is automatically assigned by your Wi-Fi router.
The Wi-Fi mode of the receiver board must be access point and station (WIFI_AP_STA).
You can set up the same Wi-Fi channel manually, or you can add a simple spinet of code on the sender to set its Wi-Fi channel to the same of the receiver board.
However, when you noted that this table was not populated could you ever get any messages through?
I had a test system going without having to have both STA and AP active. I would be interested to see your non-working code, ie before making STA and AP active. My test system was basically Glenn's proxy and sensor examples in the ESPNow and Wifi Operation section.
Re: ESP-Now support for ESP32 (and ESP8266)
My tests are performed on ESP32 only and I can confirm a webserver works together with espnow if on_recv is used
Re: ESP-Now support for ESP32 (and ESP8266)
I am only using ESP32. on_recv() required ... will need to read up about that one.
Re: ESP-Now support for ESP32 (and ESP8266)
OK, after reading about on_recv() I wonder if your issue is the amount of data you are trying to send through ... before processing it. For recv(), irecv() and the e0 singleton example you only have rxbuf size 516 bytes.
Have you tried increasing that?
Have you tried increasing that?
Last edited by davef on Mon Jul 25, 2022 11:54 pm, edited 1 time in total.
Re: ESP-Now support for ESP32 (and ESP8266)
When using on_recv() do you find that now you do NOT need both STA and AP interfaces active?