Cannot make mobile app work with ESP IDF v3.2 example

#1

I am using ESP32 with IDF v3.2
I followed through ESP IDF Guide to create a minimal binary and flashed successfully. The ESP32 starts up in AP mode due to first two 0 parameters in mDashStartWithWifi
v
oid app_main()
{
// Initialize NVS
esp_err_t ret = nvs_flash_init();
if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND)
{
ESP_ERROR_CHECK(nvs_flash_erase());
ret = nvs_flash_init();
}
ESP_ERROR_CHECK( ret );
mDashStartWithWifi(0, 0, DEVICE_ID, DEVICE_PASS);
}

Then, I followed the instructions to create a PWA app and load into the mobile phone browser. Then I have switched the mobile to the ESP32 WiFi (AP), and tried to scan for new device.

First, the SCAN timed out - my assumption is that the mobile app could not resolve the symbolic links in the app.js scripts (mdash.net and provisioning.mdash.net).

Then in app.js I changed those links to 192.168.4.1- which is the IP of the ESP32 (the IP of the mobile phone is 192.168.4.2). Then the scanning stops with a message that the access key cannot be stored.
At the console I see a log message ssl conn_handshake error with error 0xffff8880. I assume this is the reason while the PWA cannot fetch the access key for device and thus prevents the PWA app to discover the device.

Is anybody seeing similar issues?
Istvan.

#2

The provision.mdash.net should be resolved, because mdash lib starts a captive portal in AP mode, and resolves provision.mdash.net to itself.
The PWA must use TLS, thus we need a real TLS cert - that’s why the domain name is used instead of a local 192.168.4.1 address.

Does it work if you wait a couple of minutes / retries?

#3

When I am using ESP IDF 3.2 and symbolic names in mobile app, I get a timeout of 10000 ms in the app. I have tried repeatedly, had wait for couple of minutes, no difference: it always times out.
In the console I see no evidence of PWA connecting the board (I see that the client got an IP, that’s all).

#4

Any update on the PWA app usage?

#5

You could try running a PWA from a workstation, with developer tools console opened. That should give an insight on what is failing exactly.

#6

This is what I get in the developer tool in Chrome.
I was connected to WiFi AP of the ESP32.
One question though - is it important what is the name of ESP32 SSID?

#7

I have followed the steps for sample smart light. I am not able to find device AP under my wifi setting and neither on other device settings too. I have tried to reboot and re flash everything and repeated, still the problem prevails can anyone help.

#8

This commit should fix the issue. It’ll try to scan until succeeded. Please update from https://github.com/cesanta/mdash-smart-light/, re-upload your PWA, re-install on the phone, and try again.