Closed VintageSlots2 closed 2 years ago
It seems that you are mixing IDF APIs with Arduino APIs. WiFi is also initialized by the Arduino code, so you are in effect trying to do the same thing twice with different parameters. If promiscuous is what you are looking for, maybe try to start it after WiFi.mode(WIFI_STA)
by just calling:
esp_wifi_set_promiscuous(true);
esp_wifi_set_promiscuous_rx_cb(&callback);
THANK YOU!!!! I knew I was using different IDF API's and I tried everything to close the connection (create , deinit, destroy, etc.) and that just made things worse.
Your suggestion appears to work, I can turn promiscuous off, go out to the internet and then turn it back on and things still work and no errors.
I am relatively new to ESP and network programming and have been banging my head with this issue for the last two days.
Board
Lily ESP32 T-Display
Device Description
It is not attached to any other hardware except my Mac via USB serial.
Hardware Configuration
Nothing connected
Version
other
IDE Name
Arduino
Operating System
macOS 11.6.1
Flash frequency
80 Mhz
PSRAM enabled
no
Upload speed
921600
Description
I have a sketch which runs in promiscuous mode so it can look at packets on the network.
That works.
When something interesting is seen I want to exit promiscuous mode, connect to a AP and go to a web site.
That works but I always get these errors when I execute wifiMulti.run()
E (xxx) esp_netif_lwip: esp_netif_new: Failed to configure netif with config=0x3fce5374 (config or if_key is NULL or duplicate key) E (xxx) esp_netif_lwip: esp_netif_new: Failed to configure netif with config=0x3fce5374 (config or if_key is NULL or duplicate key)
I then go back to promiscuous mode and I start seeing network packets.
I would really like to know why I am getting these errors and what I can do to stop getting them.
Below is the entire sketch. I have put in Google.com as the website and you will need to put in the correct SSID and password.
Sketch
Debug Message
Other Steps to Reproduce
Look for ----> to see the error messages that are sent out when the run command is executed.
I have checked existing issues, online documentation and the Troubleshooting Guide