If you set both w0 and w1 active(True) then the wifi mode will be automatically set to WIFI_AP_STA.dhust wrote: ↑Thu Aug 19, 2021 7:13 pmfiguring it would allow me to do both. Not sure if that's true, but I'm not seeing this as an option in MicroPython. I'm not sure how to approach communicating over the wifi for ESP-Now and for texting. Thoughts?Code: Select all
// Set the device as a Station and Soft Access Point simultaneously WiFi.mode(WIFI_AP_STA);
Yes, you can use the STA_IF for texting and the AP_IF for receiving messages (a good solution to the reliability issue mentioned in my docs). However, you still need to recognise that the AP_IF will operate on the same channel as the Access Point (there is only one radio in the ESP device after all).On an added note, when I read:I'm thinking that I can use STA_IF for texting through the WiFi and then use AP_IF to get communications from another ESP32. It doesn't look like that's the case, unless I'm reading it wrong. Simply changing from network.AP_IF to network.STA_IF allows the message to be received.There are two WiFi interfaces, one for the station (when the ESP8266 connects to a router) and one for the access point (for other devices to connect to the ESP8266).
Oh - and remember that the AP_IF has a different mac address (so make sure you add_peer() the right MAC address on the sender).