esp8266 / Arduino

ESP8266 core for Arduino
GNU Lesser General Public License v2.1
16.05k stars 13.33k forks source link

esp8266 softap waiting all the time #6705

Open lou-lan opened 5 years ago

lou-lan commented 5 years ago

----------------------------- Delete below -----------------------------

If your issue is a general question, starts similar to "How do I..", is related to 3rd party libs, or is related to hardware, please discuss at a community forum like esp8266.com.

INSTRUCTIONS

If you do not follow these instructions, your issue may be dismissed.

  1. Follow the checklist under Basic Infos and fill in the [ ] spaces with an X.
  2. Fill in all the fields under Platform and Settings in IDE marked with [ ] (pick the correct option for you in each case, delete the others).
  3. If you haven't already done so, test your issue against current master branch (aka latest git), because it may have been already fixed.
  4. Describe your problem.
  5. If you have a STACK DUMP decode it:

https://arduino-esp8266.readthedocs.io/en/latest/Troubleshooting/stack_dump.html

  1. Include a Minimal Complete Reproducible Example sketch that shows your issue. Do not include your entire project, or a huge piece of code.
  2. Include debug messages:

https://arduino-esp8266.readthedocs.io/en/latest/Troubleshooting/debugging.html

  1. Use markup (buttons above) and the Preview tab to check what the issue will look like.
  2. Delete these instructions from the above to the below marker lines before submitting this issue.

----------------------------- Delete above -----------------------------

Basic Infos

Platform

Settings in IDE

Problem Description

Iphone connection softap has been waiting for a long time, arduino firmware doesn't work well. Nodemcu firmware can work. WechatIMG123

MCVE Sketch

#include <Arduino.h>
#include <ESP8266WiFi.h>

IPAddress local_IP(192,168,4,1);
IPAddress gateway(192,168,4,10);
IPAddress subnet(255,255,255,0);

void setup() {
    Serial.begin(115200);
    Serial.println();

    for(uint8_t t = 3; t > 0; t--) {
        Serial.printf("[SETUP] BOOT WAIT %d...\n", t);
        Serial.flush();
        delay(1000);
    }

    Serial.print("Setting soft-AP configuration ... ");
    Serial.println(WiFi.softAPConfig(local_IP, gateway, subnet) ? "Ready" : "Failed!");

    Serial.print("Setting soft-AP ... ");
    Serial.println(WiFi.softAP("A1234", "12345678") ? "Ready" : "Failed!");

    Serial.print("Soft-AP IP address = ");
    Serial.println(WiFi.softAPIP());
}

void loop() {
}

Debug Messages

wifi evt: 7
wifi evt: 7
err already associed!
station: f8:95:ea:86:9b:ee leave, AID = 1
rm 1
wifi evt: 6
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
add 1
aid 1
station: f8:95:ea:86:9b:ee join, AID = 1
wifi evt: 5
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 9
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
lou-lan commented 5 years ago
截屏2019-11-0218 49 50
arihantdaga commented 4 years ago

I too faced this issue sometimes with ios.

d-a-v commented 4 years ago

error -13 is lwIP-v2's connection aborted. We'd need to reproduce this error.

@arihantdaga sometimes it works ?

@lou-lan would you be able to provide a tcpdump or wireshark capture of the traffic during this error (or @arihantdaga) ?

arihantdaga commented 4 years ago

@d-a-v It works most of the time. Few of my clients said that it did not work in their iphones and they sent similar screenshots and while talking to them they explained the same. Currently i don't have tcpdump, but i'll try to reproduce it in my place and gather logs this time.

lou-lan commented 4 years ago

@d-a-v I don't have tcpdump for iOS system, but I can provide operating video and code. Is it possible that the ios system detects the security of softap?

d-a-v commented 4 years ago

Best is to run tcpdump on your router if you can, or use the integrated packet capture/dump facility directly in the esp8266 (#6518 not merged yet, or the old simple NetDump)

tablatronix commented 4 years ago

What version of IOS ? 17C5046a might have fixes for this

arihantdaga commented 4 years ago

In my case, the problem seems to be related with adc reads. If we read adc in every loop, then its affecting the wifi performance. Related to https://arduino.stackexchange.com/questions/19787/esp8266-analog-read-interferes-with-wifi