espressif / arduino-esp32

Arduino core for the ESP32
GNU Lesser General Public License v2.1
13.35k stars 7.37k forks source link

Things work but I am getting this error "esp_netif_lwip: esp_netif_new: Failed to configure netif with config=0x3fce5374 (config or if_key is NULL or duplicate key)" #7487

Closed VintageSlots2 closed 1 year ago

VintageSlots2 commented 1 year ago

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

#include <Arduino.h>

#include <esp_wifi.h>
#include <esp_event_loop.h>

#include <WiFiMulti.h>

#include <HTTPClient.h>
esp_netif_t * my_ap = (esp_netif_t *) 0;

WiFiMulti wifiMulti;

static esp_err_t          event_handler(void *, system_event_t *);

static void               callback(void *, wifi_promiscuous_pkt_type_t);
void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  delay(1000);

  Serial.println("Setup is starting up \r\n");
  tcpip_adapter_init();

  esp_event_loop_init(event_handler, NULL);
  wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();

  esp_wifi_init(&cfg);
  esp_wifi_set_storage(WIFI_STORAGE_RAM);
  esp_wifi_set_mode(WIFI_MODE_NULL);
  esp_wifi_start();
  esp_wifi_set_promiscuous(true);
  esp_wifi_set_promiscuous_rx_cb(&callback);
  esp_wifi_set_channel(6, WIFI_SECOND_CHAN_NONE);

}
esp_err_t event_handler(void *ctx, system_event_t *event) {

  return ESP_OK;
}

/*
   This function handles WiFi packets.
*/
int callbackCnt = 0;
void callback(void* buffer, wifi_promiscuous_pkt_type_t type) {

  Serial.printf(".");
  if (callbackCnt++ % 30 == 0)
    Serial.printf("\r\n");
  // printf("Getting data from network \r\n");
  return;
}

static bool apAdded = false;
void loop() {
  // put your main code here, to run repeatedly:
  uint32_t        msecs, secs;
  msecs = millis();
  secs  = msecs / 1000;

  if (secs % 10 == 0)
  {
    Serial.printf("Stop scanning and go to Internet \r\n");

    esp_wifi_set_promiscuous(false);
    if (apAdded == false)
    {
      wifiMulti.addAP("ENTER_SSID", "ENTER_PASSWORD");
      Serial.printf("Network has been added \r\n");
      apAdded = true;
      //delay(5000);
    }
    Serial.printf("About to call wifiMulti.run() \r\n");
    /* The following line generates these errors but things still work
     *  E (39833) esp_netif_lwip: esp_netif_new: Failed to configure netif with config=0x3fce5374 (config or if_key is NULL or duplicate key)
     *  E (39839) esp_netif_lwip: esp_netif_new: Failed to configure netif with config=0x3fce5374 (config or if_key is NULL or duplicate key)
    */
    int rc = wifiMulti.run();
    Serial.printf("Done calling wifiMulti.run(), rc: %x \r\n", rc);
    if ((rc == WL_CONNECTED)) { 
      HTTPClient http;
      Serial.print("[HTTP] begin...\n");
      // configure traged server and url
      http.begin("http://www.google.com");
      Serial.print("[HTTP] GET...\n");
      // start connection and send HTTP header
      int httpCode = http.GET();

      // httpCode will be negative on error

      if (httpCode > 0) {
        // HTTP header has been sent and Server response header has been handled
        Serial.printf("[HTTP] GET... code: %d\n", httpCode);

        String payload = http.getString();
        Serial.println(payload);
      } else {
        Serial.printf("[HTTP] GET... failed, error: %s\n", http.errorToString(httpCode).c_str());
      }

      http.end();
      esp_wifi_set_mode(WIFI_MODE_NULL);
      esp_wifi_set_promiscuous(true);
      esp_wifi_set_promiscuous_rx_cb(&callback);
      esp_wifi_set_channel(6, WIFI_SECOND_CHAN_NONE);
    }
    else
    {
      Serial.printf("Error from run, rc = %x \r\n", rc);

      esp_wifi_set_mode(WIFI_MODE_NULL);
      esp_wifi_set_promiscuous(true);
      esp_wifi_set_promiscuous_rx_cb(&callback);
      esp_wifi_set_channel(6, WIFI_SECOND_CHAN_NONE);
    }
  }

}

Debug Message

Setup is starting up 

.
..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
..............................
.......................Stop scanning and go to Internet 
[ 10000][I][WiFiMulti.cpp:84] addAP(): [WIFI][APlistAdd] add SSID: Watling1
Network has been added 
About to call wifiMulti.run() 
[ 10001][D][WiFiGeneric.cpp:929] _eventCallback(): Arduino Event: 0 - WIFI_READY
---->E (19832) esp_netif_lwip: esp_netif_new: Failed to configure netif with config=0x3fce5374 (config or if_key is NULL or duplicate key)
[ 10015][D][WiFiGeneric.cpp:929] _eventCallback(): Arduino Event: 2 - STA_START
---->E (19844) esp_netif_lwip: esp_netif_new: Failed to configure netif with config=0x3fce5374 (config or if_key is NULL or duplicate key)
[ 16008][D][WiFiGeneric.cpp:929] _eventCallback(): Arduino Event: 1 - SCAN_DONE
[ 16008][I][WiFiMulti.cpp:114] run(): [WIFI] scan done
[ 16008][I][WiFiMulti.cpp:119] run(): [WIFI] 6 networks found
[ 16014][D][WiFiMulti.cpp:149] run():  --->   0: [11][84:17:EF:0E:D6:29] Watling1 (-68) *
[ 16022][D][WiFiMulti.cpp:151] run():        1: [11][00:11:50:1E:47:8B] LR Time Capsule (-72) *
[ 16030][D][WiFiMulti.cpp:151] run():        2: [11][E6:95:6E:43:D9:14] Universal Midi Controller (-75) *
[ 16040][D][WiFiMulti.cpp:149] run():  --->   3: [11][E6:95:6E:41:A2:36] Watling1 (-81) *
[ 16047][D][WiFiMulti.cpp:151] run():        4: [6][AC:4C:A5:B6:91:1C] manhattan (-84) *
[ 16055][D][WiFiMulti.cpp:151] run():        5: [11][F2:A4:6F:54:72:21] ssidTest (-88) *
[ 16063][I][WiFiMulti.cpp:160] run(): [WIFI] Connecting BSSID: 84:17:EF:0E:D6:29 SSID: Watling1 Channel: 11 (-68)
[ 16126][D][WiFiGeneric.cpp:929] _eventCallback(): Arduino Event: 4 - STA_CONNECTED
[ 16235][D][WiFiGeneric.cpp:929] _eventCallback(): Arduino Event: 7 - STA_GOT_IP
[ 16235][D][WiFiGeneric.cpp:991] _eventCallback(): STA IP: 10.0.0.148, MASK: 255.255.255.0, GW: 10.0.0.1
[ 16240][I][WiFiMulti.cpp:174] run(): [WIFI] Connecting done.
[ 16246][D][WiFiMulti.cpp:175] run(): [WIFI] SSID: Watling1
[ 16251][D][WiFiMulti.cpp:176] run(): [WIFI] IP: 10.0.0.148
[ 16256][D][WiFiMulti.cpp:177] run(): [WIFI] MAC: 84:17:EF:0E:D6:29
[ 16262][D][WiFiMulti.cpp:178] run(): [WIFI] Channel: 11
Done calling wifiMulti.run(), rc: 3 
[HTTP] begin...
[ 16267][D][HTTPClient.cpp:303] beginInternal(): protocol: http, host: www.google.com port: 80 url: /
[HTTP] GET...
[ 16276][D][HTTPClient.cpp:598] sendRequest(): request type: 'GET' redirCount: 0

[ 16384][D][HTTPClient.cpp:1156] connect():  connected to www.google.com:80
[ 16702][D][HTTPClient.cpp:1307] handleHeaderResponse(): code: 200
[ 16702][D][HTTPClient.cpp:1314] handleHeaderResponse(): Transfer-Encoding: chunked
[ 16704][D][HTTPClient.cpp:628] sendRequest(): sendRequest code=200

[HTTP] GET... code: 200
[ 16710][D][HTTPClient.cpp:922] writeToStream():  read chunk len: 12390
[ 16774][D][HTTPClient.cpp:1446] writeToStreamDataBlock(): connection closed or file end (written: 12390).
[ 16774][D][HTTPClient.cpp:922] writeToStream():  read chunk len: 242
[ 16779][D][HTTPClient.cpp:1446] writeToStreamDataBlock(): connection closed or file end (written: 242).
[ 16788][D][HTTPClient.cpp:922] writeToStream():  read chunk len: 1499
[ 17102][D][HTTPClient.cpp:1446] writeToStreamDataBlock(): connection closed or file end (written: 1499).
[ 17103][D][HTTPClient.cpp:922] writeToStream():  read chunk len: 0
[ 17107][D][HTTPClient.cpp:388] disconnect(): still data in buffer (2), clean up.

[ 17114][E][WiFiClient.cpp:517] flush(): fail on fd 48, errno: 11, "No more processes"
[ 17122][D][HTTPClient.cpp:393] disconnect(): tcp keep open for reuse
<!doctype html><html itemscope="" itemtype="http://schema.org/WebPage" lang="en"><head><meta content="Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for." name="description"><meta content="noodp" name="robots"><meta content="text/html; charset=UTF-8" http-equiv="Content-Type"><meta content="/images/branding/googleg/1x/googleg_standard_color_128dp.png" itemprop="image"><title>Google</title><script nonce="ScLrPjuWj0_K0huZ7A-VFQ">(function(){window.google={kEI:'ERV3Y82kNp2uqtsP3N6VsAk',kEXPI:'0,202564,1099972,56873,6059,206,4804,2316,383,246,5,5367,1123753,1197784,107,510,380089,16115,28684,22431,996,365,283,12037,17579,4998,13228,3847,10622,22741,5081,1593,1279,2742,149,1103,840,1983,214,4100,3514,606,2023,1777,520,14670,3227,2845,7,4774,24300,4696,1851,15324,432,3,346,1244,1,5444,149,11323,2652,4,1528,2304,7039,3580,16729,1714,5708,7357,11442,2216,2980,1457,15351,1435,5821,2536,4094,4052,3,3541,1,42154,2,14022,2373,342,4931,18093,5679,1021,2380,26569,2172,4569,6255,23421,1252,5835,14968,4332,2204,5280,445,2,2,1,24626,2006,8155,7381,2,3,15965,873,9625,10008,6,1923,5784,3995,19130,12192,4832,17138,700,4,1,2,2,2,2,8652,11859,4131,1629,2518,14,82,950,2940,751,2068,8748,1057,1511,2181,109,112,718,683,899,879,3852,1119,6,1539,2246,1052,3284,3,6,779,81,246,33,3860,1762,1741,814,1542,2322,1212,285,2,563,909,82,65,1414,21,594,355,86,921,451,397,76,110,36,6,291,3393,143,12,770,1290,140,3,464,320,3,1690,182,569,324,56,646,2,3,496,618,247,65,347,1,77,727,59,1273,13,1037,1,287,569,423,901,129,314,32,1387,318,168,122,3,4,444,724,226,208,1297,86,821,695,204,431,276,346,11,603,170,4,73,47,5,311,187,641,21,75,199,196,776,94,60,224,101,131,462,410,1,139,1,134,318,4,3,125,181,168,369,27,117,23,83,5298065,184,1,3,10,39,19,8799022,3311,141,795,19735,1,303,44,2695,64,47,11,1,4,1,1,1,12,6,7,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,1,20,7,7,8,8,8,8,15,23947523,487,25,21,4041610,1964,3094,13579,3405,12910,168,904,1482335',kBL:'UDrv'};google.sn='webhp';google.kHL='en';})();(function(){
var f=this||self;var h,k=[];function l(a){for(var b;a&&(!a.getAttribute||!(b=a.getAttribute("eid")));)a=a.parentNode;return b||h}function m(a){for(var b=null;a&&(!a.getAttribute||!(b=a.getAttribute("leid")));)a=a.parentNode;return b}
function n(a,b,c,d,g){var e="";c||-1!==b.search("&ei=")||(e="&ei="+l(d),-1===b.search("&lei=")&&(d=m(d))&&(e+="&lei="+d));d="";!c&&f._cshid&&-1===b.search("&cshid=")&&"slh"!==a&&(d="&cshid="+f._cshid);c=c||"/"+(g||"gen_204")+"?atyp=i&ct="+a+"&cad="+b+e+"&zx="+Date.now()+d;/^http:/i.test(c)&&"https:"===window.location.protocol&&(google.ml&&google.ml(Error("a"),!1,{src:c,glmm:1}),c="");return c};h=google.kEI;google.getEI=l;google.getLEI=m;google.ml=function(){return null};google.log=function(a,b,c,d,g){if(c=n(a,b,c,d,g)){a=new Image;var e=k.length;k[e]=a;a.onerror=a.onload=a.onabort=function(){delete k[e]};a.src=c}};google.logUrl=n;}).call(this);(function(){google.y={};google.sy=[];google.x=function(a,b){if(a)var c=a.id;else{do c=Math.random();while(google.y[c])}google.y[c]=[a,b];return!1};google.sx=function(a){google.sy.push(a)};google.lm=[];google.plm=function(a){google.lm.push.apply(google.lm,a)};google.lq=[];google.load=function(a,b,c){google.lq.push([[a],b,c])};google.loadAll=function(a,b){google.lq.push([a,b])};google.bx=!1;google.lx=function(){};}).call(this);google.f={};(function(){
document.documentElement.addEventListener("submit",function(b){var a;if(a=b.target){var c=a.getAttribute("data-submitfalse");a="1"===c||"q"===c&&!a.elements.q.value?!0:!1}else a=!1;a&&(b.preventDefault(),b.stopPropagation())},!0);document.documentElement.addEventListener("click",function(b){var a;a:{for(a=b.target;a&&a!==document.documentElement;a=a.parentElement)if("A"===a.tagName){a="1"===a.getAttribute("data-nohref");break a}a=!1}a&&b.preventDefault()},!0);}).call(this);</script><style>#gbar,#guser{font-size:13px;padding-top:1px !important;}#gbar{height:22px}#guser{padding-bottom:7px !important;text-align:right}.gbh,.gbd{border-top:1px solid #c9d7f1;font-size:1px}.gbh{height:0;position:absolute;top:24px;width:100%}@media all{.gb1{height:22px;margin-right:.5em;vertical-align:top}#gbar{float:left}}a.gb1,a.gb4{text-decoration:underline !important}a.gb1,a.gb4{color:#00c !important}.gbi .gb4{color:#dd8e27 !important}.gbf .gb4{color:#900 !important}
</style><style>body,td,a,p,.h{font-family:arial,sans-serif}body{margin:0;overflow-y:scroll}#gog{padding:3px 8px 0}td{line-height:.8em}.gac_m td{line-height:17px}form{margin-bottom:20px}.h{color:#1558d6}em{font-weight:bold;font-style:normal}.lst{height:25px;width:496px}.gsfi,.lst{font:18px arial,sans-serif}.gsfs{font:17px arial,sans-serif}.ds{display:inline-box;display:inline-block;margin:3px 0 4px;margin-left:4px}input{font-family:inherit}body{background:#fff;color:#000}a{color:#4b11a8;text-decoration:none}a:hover,a:active{text-decoration:underline}.fl a{color:#1558d6}a:visited{color:#4b11a8}.sblc{padding-top:5px}.sblc a{display:block;margin:2px 0;margin-left:13px;font-size:11px}.lsbb{background:#f8f9fa;border:solid 1px;border-color:#dadce0 #70757a #70757a #dadce0;height:30px}.lsbb{display:block}#WqQANb a{display:inline-block;margin:0 12px}.lsb{background:url(/images/nav_logo229.png) 0 -261px repeat-x;border:none;color:#000;cursor:pointer;height:30px;margin:0;outline:0;font:15px arial,sans-serif;vertical-align:top}.lsb:active{background:#dadce0}.lst:focus{outline:none}</style><script nonce="ScLrPjuWj0_K0huZ7A-VFQ">(function(){window.google.erd={jsr:1,bv:1692,de:true};
var h=this||self;var k,l=null!=(k=h.mei)?k:1,n,p=null!=(n=h.sdo)?n:!0,q=0,r,t=google.erd,v=t.jsr;google.ml=function(a,b,d,m,e){e=void 0===e?2:e;b&&(r=a&&a.message);if(google.dl)return google.dl(a,e,d),null;if(0>v){window.console&&console.error(a,d);if(-2===v)throw a;b=!1}else b=!a||!a.message||"Error loading script"===a.message||q>=l&&!m?!1:!0;if(!b)return null;q++;d=d||{};b=encodeURIComponent;var c="/gen_204?atyp=i&ei="+b(google.kEI);google.kEXPI&&(c+="&jexpid="+b(google.kEXPI));c+="&srcpg="+b(google.sn)+"&jsr="+b(t.jsr)+"&bver="+b(t.bv);var f=a.lineNumber;void 0!==f&&(c+="&line="+f);var g=
a.fileName;g&&(0<g.indexOf("-extension:/")&&(e=3),c+="&script="+b(g),f&&g===window.location.href&&(f=document.documentElement.outerHTML.split("\n")[f],c+="&cad="+b(f?f.substring(0,300):"No script found.")));c+="&jsel="+e;for(var u in d)c+="&",c+=b(u),c+="=",c+=b(d[u]);c=c+"&emsg="+b(a.name+": "+a.message);c=c+"&jsst="+b(a.stack||"N/A");12288<=c.length&&(c=c.substr(0,12288));a=c;m||google.log(0,"",a);return a};window.onerror=function(a,b,d,m,e){r!==a&&(a=e instanceof Error?e:Error(a),void 0===d||"lineNumber"in a||(a.lineNumber=d),void 0===b||"fileName"in a||(a.fileName=b),google.ml(a,!1,void 0,!1,"SyntaxError"===a.name||"SyntaxError"===a.message.substring(0,11)||-1!==a.message.indexOf("Script error")?3:0));r=null;p&&q>=l&&(window.onerror=null)};})();</script></head><body bgcolor="#fff"><script nonce="ScLrPjuWj0_K0huZ7A-VFQ">(function(){var src='/images/nav_logo229.png';var iesg=false;document.body.onload = function(){window.n && window.n();if (document.images){new Image().src=src;}
if (!iesg){document.f&&document.f.q.focus();document.gbqf&&document.gbqf.q.focus();}
}
})();</script><div id="mngb"><div id=gbar><nobr><b class=gb1>Search</b> <a class=gb1 href="http://www.google.com/imghp?hl=en&tab=wi">Images</a> <a class=gb1 href="http://maps.google.com/maps?hl=en&tab=wl">Maps</a> <a class=gb1 href="https://play.google.com/?hl=en&tab=w8">Play</a> <a class=gb1 href="https://www.youtube.com/?tab=w1">YouTube</a> <a class=gb1 href="https://news.google.com/?tab=wn">News</a> <a class=gb1 href="https://mail.google.com/mail/?tab=wm">Gmail</a> <a class=gb1 href="https://drive.google.com/?tab=wo">Drive</a> <a class=gb1 style="text-decoration:none" href="https://www.google.com/intl/en/about/products?tab=wh"><u>More</u> &raquo;</a></nobr></div><div id=guser width=100%><nobr><span id=gbn class=gbi></span><span id=gbf class=gbf></span><span id=gbe></span><a href="http://www.google.com/history/optout?hl=en" class=gb4>Web History</a> | <a  href="/preferences?hl=en" class=gb4>Settings</a> | <a target=_top id=gb_70 href="https://accounts.google.com/ServiceLogin?hl=en&passive=true&continue=http://www.google.com/&ec=GAZAAQ" class=gb4>Sign in</a></nobr></div><div class=gbh style=left:0></div><div class=gbh style=right:0></div></div><center><br clear="all" id="lgpd"><div id="lga"><img alt="Google" height="92" src="/images/branding/googlelogo/1x/googlelogo_white_background_color_272x92dp.png" style="padding:28px 0 14px" width="272" id="hplogo"><br><br></div><form action="/search" name="f"><table cellpadding="0" cellspacing="0"><tr valign="top"><td width="25%">&nbsp;</td><td align="center" nowrap=""><input name="ie" value="ISO-8859-1" type="hidden"><input value="en" name="hl" type="hidden"><input name="source" type="hidden" value="hp"><input name="biw" type="hidden"><input name="bih" type="hidden"><div class="ds" style="height:32px;margin:4px 0"><input class="lst" style="margin:0;padding:5px 8px 0 6px;vertical-align:top;color:#000" autocomplete="off" value="" title="Google Search" maxlength="2048" name="q" size="57"></div><br style="line-height:0"><span class="ds"><span class="lsbb"><input class="lsb" value="Google Search" name="btnG" type="submit"></span></span><span class="ds"><span class="lsbb"><input class="lsb" id="tsuid_1" value="I'm Feeling Lucky" name="btnI" type="submit"><script nonce="ScLrPjuWj0_K0huZ7A-VFQ">(function(){var id='tsuid_1';document.getElementById(id).onclick = function(){if (this.form.q.value){this.checked = 1;if (this.form.iflsig)this.form.iflsig.disabled = false;}
else top.location='/doodles/';};})();</script><input value="AJiK0e8AAAAAY3cjIe2dvu3Cv2QvzvBYxiRca7pk3_Hf" name="iflsig" type="hidden"></span></span></td><td class="fl sblc" align="left" nowrap="" width="25%"><a href="/advanced_search?hl=en&amp;authuser=0">Advanced search</a></td></tr></table><input id="gbv" name="gbv" type="hidden" value="1"><script nonce="ScLrPjuWj0_K0huZ7A-VFQ">(function(){var a,b="1";if(document&&document.getElementById)if("undefined"!=typeof XMLHttpRequest)b="2";else if("undefined"!=typeof ActiveXObject){var c,d,e=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];for(c=0;d=e[c++];)try{new ActiveXObject(d),b="2"}catch(h){}}a=b;if("2"==a&&-1==location.search.indexOf("&gbv=2")){var f=google.gbvu,g=document.getElementById("gbv");g&&(g.value=a);f&&window.setTimeout(function(){location.href=f},0)};}).call(this);</script></form><div id="gac_scont"></div><div style="font-size:83%;min-height:3.5em"><br></div><span id="footer"><div style="font-size:10pt"><div style="margin:19px auto;text-align:center" id="WqQANb"><a href="/intl/en/ads/">Advertising⸮Programs</a><a href="/services/">Business Solutions</a><a href="/intl/en/about.html">About Google</a></div></div><p style="font-size:8pt;color:#70757a">&copy; 2022 - <a href="/intl/en/policies/privacy/">Privacy</a> - <a href="/intl/en/policies/terms/">Terms</a></p></span></center><script nonce="ScLrPjuWj0_K0huZ7A-VFQ">(function(){window.google.cdo={height:757,width:1440};(function(){var a=window.innerWidth,b=window.innerHeight;if(!a||!b){var c=window.document,d="CSS1Compat"==c.compatMode?c.documentElement:c.body;a=d.clientWidth;b=d.clientHeight}a&&b&&(a!=google.cdo.width||b!=google.cdo.height)&&google.log("","","/client_204?&atyp=i&biw="+a+"&bih="+b+"&ei="+google.kEI);}).call(this);})();</script> <script nonce="ScLrPjuWj0_K0huZ7A-VFQ">(function(){google.xjs={ck:'xjs.hp.o5AfvK7BgaM.L.X.O',cs:'ACT90oG5Bbi8ZvGkUuDAFqRBkDgBzAQVVg',excm:[]};})();</script>  <script nonce="ScLrPjuWj0_K0huZ7A-VFQ">(function(){var u='/xjs/_/js/k\x3dxjs.hp.en_US.bBS1vp4GQyM.O/am\x3dAADoBABQAGAB/d\x3d1/ed\x3d1/rs\x3dACT90oHNDt-Wwf74SvsaZNRmmg-5d6odqA/m\x3dsb_he,d';var amd=0;
var d=this||self,e=function(a){return a};var g;var l=function(a,b){this.g=b===h?a:""};l.prototype.toString=function(){return this.g+""};var h={};
function m(){var a=u;google.lx=function(){p(a);google.lx=function(){}};google.bx||google.lx()}
function p(a){google.timers&&google.timers.load&&google.tick&&google.tick("load","xjsls");var b=document;var c="SCRIPT";"application/xhtml+xml"===b.contentType&&(c=c.toLowerCase());c=b.createElement(c);if(void 0===g){b=null;var k=d.trustedTypes;if(k&&k.createPolicy){try{b=k.createPolicy("goog#html",{createHTML:e,createScript:e,createScriptURL:e})}catch(q){d.console&&d.console.error(q.message)}g=b}else g=b}a=(b=g)?b.createScriptURL(a):a;a=new l(a,h);c.src=a instanceof l&&a.constructor===l?a.g:"type_error:TrustedResourceUrl";var f,n;(f=(a=null==(n=(f=(c.ownerDocument&&c.ownerDocument.defaultView||window).document).querySelector)?void 0:n.call(f,"script[nonce]"))?a.nonce||a.getAttribute("nonce")||"":"")&&c.setAttribute("nonce",f);document.body.appendChild(c);google.psa=!0};google.xjsu=u;setTimeout(function(){0<amd?google.caft(function(){return m()},amd):m()},0);})();function _DumpException(e){throw e;}
function _F_installCss(c){}
(function(){google.jl={blt:'none',chnk:0,dw:false,dwu:true,emtn:0,end:0,ico:false,ikb:0,ine:false,injs:'none',injt:0,injth:0,injv2:false,lls:'default',pdt:0,rep:0,snet:true,strt:0,ubm:false,uwp:true};})();(function(){var pmc='{\x22d\x22:{},\x22sb_he\x22:{\x22agen\x22:true,\x22cgen\x22:true,\x22client\x22:\x22heirloom-hp\x22,\x22dh\x22:true,\x22ds\x22:\x22\x22,\x22fl\x22:true,\x22host\x22:\x22google.com\x22,\x22jsonp\x22:true,\x22msgs\x22:{\x22cibl\x22:\x22Clear Search\x22,\x22dym\x22:\x22Did you mean:\x22,\x22lcky\x22:\x22I\\u0026#39;m Feeling Lucky\x22,\x22lml\x22:\x22Learn more\x22,\x22psrc\x22:\x22This search was removed from your \\u003Ca href\x3d\\\x22/history\\\x22\\u003EWeb History\\u003C/a\\u003E\x22,\x22psrl\x22:\x22Remove\x22,\x22sbit\x22:\x22Search by image\x22,\x22srch\x22:\x22Google Search\x22},\x22ovr\x22:{},\x22pq\x22:\x22\x22,\x22rfs\x22:[],\x22sbas\x22:\x220 3px 8px 0 rgba(0,0,0,0.2),0 0 0 1px rgba(0,0,0,0.08)\x22,\x22stok\x22:\x22-5QJlf4JwPxM2y5XdWjlakKG168\x22}}';google.pmc=JSON.parse(pmc);})();</script>        </body></html>
[ 17147][D][HTTPClient.cpp:408] disconnect(): tcp is closed

[ 17150][D][WiFiGeneric.cpp:929] _eventCallback(): Arduino Event: 5 - STA_DISCONNECTED
[ 17150][W][WiFiGeneric.cpp:950] _eventCallback(): Reason: 8 - ASSOC_LEAVE
[ 17156][D][WiFiGeneric.cpp:929] _eventCallback(): Arduino Event: 3 - STA_STOP

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

me-no-dev commented 1 year 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);
VintageSlots2 commented 1 year ago

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.