Skip to content

SoftAP fails to assign SSID/PWD with pasword size 1 to 7 characters and still turns on AP #7831

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
SuGlider opened this issue Feb 10, 2023 · 0 comments · Fixed by #7832
Closed
1 task done
Assignees
Labels
Area: BT&Wifi BT & Wifi related issues
Milestone

Comments

@SuGlider
Copy link
Collaborator

SuGlider commented Feb 10, 2023

Board

ESP32 Devkit

Device Description

Just the Devkit

Hardware Configuration

None

Version

v2.0.6

IDE Name

Arduino IDE 1.8.15

Operating System

Windows 11

Flash frequency

QIO 80MHz

PSRAM enabled

no

Upload speed

Tried 115200 and 921600

Description

When running the WiFiAccessPoint example and changing the SSID with a short password (less than 8 characters) it assigns an unexpected SSID and leaves it as open nerwork (no passord).
The example works fine with passwords with more than 7 characters and when it is NULL (open network).
Otherwise it fails, returning false but it still turns on the AP with an ESP32_XXXX SSID.

It seems that the issue is in the WiFiAP.cpp code that should DISABLE AP before returning.
https://github.com/espressif/arduino-esp32/blob/master/libraries/WiFi/src/WiFiAP.cpp#L151-L155

bool WiFiAPClass::softAP(const char* ssid, const char* passphrase, int channel, int ssid_hidden, int max_connection, bool ftm_responder)
{

    if(!WiFi.enableAP(true)) {
        // enable AP failed
        log_e("enable AP first!");
        return false;
    }

    if(!ssid || *ssid == 0) {
        // fail SSID missing
        log_e("SSID missing!");
        return false;
    }

    if(passphrase && (strlen(passphrase) > 0 && strlen(passphrase) < 8)) {
        // fail passphrase too short
        log_e("passphrase too short!");
        return false;
    }

Sketch

https://github.com/espressif/arduino-esp32/blob/master/libraries/WiFi/examples/WiFiAccessPoint/WiFiAccessPoint.ino

Debug Message

ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1344
load:0x40078000,len:13516
load:0x40080400,len:3604
entry 0x400805f0

Configuring access point...
[   121][E][WiFiAP.cpp:153] softAP(): passphrase too short!
AP IP address: 192.168.4.1
Server started

Other Steps to Reproduce

NONE

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.
@SuGlider SuGlider added the Status: Awaiting triage Issue is waiting for triage label Feb 10, 2023
@SuGlider SuGlider self-assigned this Feb 10, 2023
@SuGlider SuGlider added Area: BT&Wifi BT & Wifi related issues and removed Status: Awaiting triage Issue is waiting for triage labels Feb 10, 2023
@SuGlider SuGlider added this to the 2.0.7 milestone Feb 10, 2023
@SuGlider SuGlider moved this from Todo to In Progress in Arduino ESP32 Core Project Roadmap Feb 11, 2023
@SuGlider SuGlider moved this from In Progress to In Review in Arduino ESP32 Core Project Roadmap Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: BT&Wifi BT & Wifi related issues
Projects
Development

Successfully merging a pull request may close this issue.

1 participant