esp32-ogn-tracker icon indicating copy to clipboard operation
esp32-ogn-tracker copied to clipboard

Wifi

Open lupus78 opened this issue 3 years ago • 7 comments

I was able to compile for TBEAM v10 with WITH_AP, WITH_WIFI and WITH_HTTP options. Ctrl+C on monitor shows me the APname and empty APpass but I can't see the wifi network, and also I can not connect to it as a "hidden" wifi network. Am I doing something wrong?

lupus78 avatar Apr 02 '21 18:04 lupus78

I think I found a solution. I have switch up the esp_wifi_set_mode() and esp_wifi_set_config() commans in wifi.cpp. set_mode should come first, but in the code set_config comes first. When I put set_mode before set_config, the wifi started to work.

lupus78 avatar Apr 03 '21 11:04 lupus78

OK, I believe you, I swapped the two calls, although I did not notice a problem, I could still connect to WiFi. BTW: I added WITH_AP_BUTTON which makes the AP start only when the user button is pressed on startup, This saves about 80mA when WiFi is not required. I am not sure how frequent restarts affect the internal flash file system, this should be watched.

pjalocha avatar Apr 04 '21 16:04 pjalocha

That's a nice idea. I was thinking about a "Parameter" to turn the Wifi on or off, and the user could control it with Bluetooth.

However, I think a nice Bluetooth app for smartphone would be the best way to configure the device.

lupus78 avatar Apr 04 '21 18:04 lupus78

Ah, and some visual indication on the screen which shows if the Wifi is ON!

lupus78 avatar Apr 04 '21 18:04 lupus78

You can control it already: if you set APname to empty, then WiFi AP would not start.

I actually am not sure now, because any unexpected restart would turn the WIFi AP off thus not sure if this is good is some circumstances.

pjalocha avatar Apr 04 '21 18:04 pjalocha

For the indication, I will make one, as there is already a WiFi icon there, just not properly controlled yet.

pjalocha avatar Apr 04 '21 19:04 pjalocha

Setting the APname empty seams to be an odd solution to me. A dedicated on/off parameter is better.

lupus78 avatar Apr 06 '21 08:04 lupus78