Rainmaker app on Android fails to find SSID's

themindfactory
Posts: 65
Joined: Mon Mar 26, 2018 7:57 pm

Rainmaker app on Android fails to find SSID's

Postby themindfactory » Thu Oct 31, 2024 6:32 am

After successful claiming, the Anrdoid app scans for SSIDs to help you connect to your wifi, however it never finds any.

I have noted that the scanning seems to be all done on the ESP32 and the app must receive the results.

However nothing is found 95% of the time, sometimes its finds them.

I am compiling the code in VSCODE with Arduino libs enabled, all works 100% except the scanning.

Is there something I missed in menuconfig?

Richard.

aliarifat794
Posts: 200
Joined: Sun Jun 23, 2024 6:18 pm

Re: Rainmaker app on Android fails to find SSID's

Postby aliarifat794 » Thu Oct 31, 2024 2:14 pm

Try using WiFi.scanNetworks(true); in your code to conduct a more thorough scan, and specify the hidden parameter as true to detect hidden SSIDs if needed.

Code: Select all

#include <WiFi.h>

void setup() {
  Serial.begin(115200);
  WiFi.mode(WIFI_STA);
  WiFi.disconnect(); // Clear previous settings
  delay(100);
}

void loop() {
  Serial.println("Scanning for networks...");
  int n = WiFi.scanNetworks();
  if (n == 0) {
    Serial.println("No networks found.");
  } else {
    Serial.println("Networks found:");
    for (int i = 0; i < n; ++i) {
      Serial.printf("%d: %s (%d) %s\n", i + 1, WiFi.SSID(i).c_str(), WiFi.RSSI(i), WiFi.encryptionType(i) == WIFI_AUTH_OPEN ? "Open" : "Secured");
      delay(10);
    }
  }
  Serial.println("");
  delay(5000); // Wait before next scan
}

themindfactory
Posts: 65
Joined: Mon Mar 26, 2018 7:57 pm

Re: Rainmaker app on Android fails to find SSID's

Postby themindfactory » Thu Oct 31, 2024 5:36 pm

Thanks for reply, however the scanning is being done in the rainmaker library, not mine, so I can check in their source code how it is being done, however I expect it to be correct as it is Espressif who coded rainmaker :-)

I thought it probably has more to do with the current setup of the code compiling since I am in the VSCODE IDE using the IDF.

Richard.

themindfactory
Posts: 65
Joined: Mon Mar 26, 2018 7:57 pm

Re: Rainmaker app on Android fails to find SSID's

Postby themindfactory » Thu Oct 31, 2024 8:27 pm

I just enabled debug message and caught this during the scanning phase, not sure yet what to make of it, but I'll share it here:

Code: Select all

D (27404) wifi:Start wifi scan
D (27406) wifi:ssid=, channel=0, hidden=0, type=active, active=<0,0>, passive=0
D (27413) wifi:home_channel_dwell_time=30
D (27417) wifi:first chan=1
D (27420) wifi:filter: set rx policy=3
D (27423) wifi:clear scan ap list
D (27426) wifi:start scan: type=0x50f, priority=3, cb=0x0, arg=0x3ffc7798, ss_state=0x1, time=24682254, index=0
D (27436) wifi:perform scan: ss_state=0x9, chan<1,0>, dur<0,120>
D (27442) network_prov_mgr: Scan started
D (27682) wifi:scan end: arg=0x0, status=0, ss_state=0x3
D (27683) wifi:perform scan: ss_state=0x9, chan<2,0>, dur<0,120>
D (27924) wifi:scan end: arg=0x0, status=0, ss_state=0x3
D (27925) wifi:perform scan: ss_state=0x9, chan<3,0>, dur<0,120>
D (28166) wifi:scan end: arg=0x0, status=0, ss_state=0x3
D (28167) wifi:perform scan: ss_state=0x9, chan<4,0>, dur<0,120>
D (28408) wifi:scan end: arg=0x0, status=0, ss_state=0x3
D (28409) wifi:perform scan: ss_state=0x9, chan<5,0>, dur<0,120>
D (28650) wifi:scan end: arg=0x0, status=0, ss_state=0x3
D (28651) wifi:perform scan: ss_state=0x9, chan<6,0>, dur<0,120>
D (28892) wifi:scan end: arg=0x0, status=0, ss_state=0x3
D (28893) wifi:perform scan: ss_state=0x9, chan<7,0>, dur<0,120>
D (29135) wifi:scan end: arg=0x0, status=0, ss_state=0x3
D (29136) wifi:perform scan: ss_state=0x9, chan<8,0>, dur<0,120>
D (29377) wifi:scan end: arg=0x0, status=0, ss_state=0x3
D (29378) wifi:perform scan: ss_state=0x9, chan<9,0>, dur<0,120>
D (29619) wifi:scan end: arg=0x0, status=0, ss_state=0x3
D (29620) wifi:perform scan: ss_state=0x9, chan<10,0>, dur<0,120>
D (29862) wifi:scan end: arg=0x0, status=0, ss_state=0x3
D (29862) wifi:perform scan: ss_state=0x9, chan<11,0>, dur<0,120>
D (30104) wifi:scan end: arg=0x0, status=0, ss_state=0x3
D (30105) wifi:perform scan: ss_state=0x9, chan<12,0>, dur<360,360>
D (30826) wifi:scan end: arg=0x0, status=0, ss_state=0x3
D (30827) wifi:perform scan: ss_state=0x9, chan<13,0>, dur<360,360>
D (31548) wifi:scan end: arg=0x0, status=0, ss_state=0x3
D (31549) wifi:perform scan: ss_state=0x9, chan<14,0>, dur<360,360>
D (32270) wifi:scan end: arg=0x0, status=0, ss_state=0x3
D (32271) wifi:filter: set rx policy=4
D (32271) wifi:first chan=1
D (32271) wifi:Send scan done event: status=0, apnum=13
D (32275) event: running post WIFI_EVENT:1 with handler 0x400e7074 and context 0x3ffd8158 on loop 0x3ffd070c
--- 0x400e7074: _arduino_event_cb(void*, char const*, long, void*) at C:/Users/Richard/RICK ARDUINO/components/arduino/libraries/WiFi/src/WiFiGeneric.cpp:67

D (32285) event: running post WIFI_EVENT:1 with handler 0x400e7c98 and context 0x3ffdf314 on loop 0x3ffd070c
--- 0x400e7c98: _sta_event_cb(void*, char const*, long, void*) at C:/Users/Richard/RICK ARDUINO/components/arduino/libraries/WiFi/src/STA.cpp:52

D (32295) event: running post WIFI_EVENT:1 with handler 0x400f00fc and context 0x3ffeafa4 on loop 0x3ffd070c
--- 0x400f00fc: network_prov_mgr_event_handler_internal at C:/Users/Richard/RICK ARDUINO/managed_components/espressif__network_provisioning/src/manager.c:1696

D (32305) network_prov_mgr: Scan finished
D (32309) network_prov_mgr: Scan result empty
this kind of it found 13 AP's D (32271) wifi:Send scan done event: status=0, apnum=13

going to research the 3 following calls refered to by WIFI_EVENT

Hope someone helps ...

R.

wangqx
Posts: 1
Joined: Tue Nov 05, 2024 5:21 am

Re: Rainmaker app on Android fails to find SSID's

Postby wangqx » Tue Nov 05, 2024 5:31 am

Hi, the WIFI_EVENT_SCAN_DONE event was post to three handlers in your logs. Did you try to get the scan results in the previous handlers (_arduino_event_cb or _sta_event_cb). Please take a look at this https://github.com/espressif/esp-idf/bl ... ifi.h#L588 . If you try to get the scan results in the previous handlers(calling esp_wifi_scan_get_ap_records) the scanned results will be freed, and when the network_provisioning handler calls the esp_wifi_scan_get_ap_records, it will get an empty result.

themindfactory
Posts: 65
Joined: Mon Mar 26, 2018 7:57 pm

Re: Rainmaker app on Android fails to find SSID's

Postby themindfactory » Mon Nov 18, 2024 2:45 am

The arduino callback I do see, and it report SCAN DONE, but I do nothing with it.

The network_prov_mgr_event_handler_internal I assume this is the handler trying to get the SSID's for the RainMaker provisioning.

I need to track down the _sta_event_cb function, I do not know who this is or where that callback is yet.

Richard.

Who is online

Users browsing this forum: No registered users and 16 guests