Skip to content

scanCount is uint16_t but scanNetworks returns only int8_t #1496

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
theproxy opened this issue Jun 14, 2018 · 5 comments
Closed

scanCount is uint16_t but scanNetworks returns only int8_t #1496

theproxy opened this issue Jun 14, 2018 · 5 comments

Comments

@theproxy
Copy link
Contributor

Hardware:

Board: ESP32 Dev Module
IDE name: Currently using Platform.io with ESP32
Flash Frequency: ?40Mhz?
Upload Speed: ?921600?
SYSTEM: ESP32 240MHz 288KB RAM (1.25MB Flash)

Description:

When scanning networks with many many access points, scanNetworks returns negative number (not -1 or -2) and you can still read the output of scanNetworks but now have to deal with overflowed number returned from scanNetworks.

@theproxy
Copy link
Contributor Author

theproxy added a commit to fatmongoose/arduino-esp32 that referenced this issue Jun 14, 2018
@lbernstone
Copy link
Contributor

libraries/WiFi/src/WiFiType.h:#define WIFI_SCAN_RUNNING (-1)
libraries/WiFi/src/WiFiType.h:#define WIFI_SCAN_FAILED (-2)

@theproxy
Copy link
Contributor Author

Hi thank you for the reply. I saw the -1 and -2 in the code. What I am seeing (still gathering data on this) is that I am getting a number like -67 or so. I have structured my code that if I see scanNetworks return < -2, then I can ask for at least 127 WiFi.SSID(i) and I get valid data from that call up through that many indices.

It's like walking a tightrope though because I am guessing that there is that much information available in the WiFI data structure, but I know it's a hack to get that data by blindly hardcoding the for loop.

@copercini
Copy link
Contributor

Solved on #1514

Nice PR =)

Curclamas pushed a commit to Curclamas/arduino-esp32 that referenced this issue Aug 21, 2018
@YordanYanakiev
Copy link

The issue is not resolved. Only the first time it is working, after then I am getting negative numbers like -2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants