diff --git a/neosensor/libraries/neocampus/neocampus_utils.cpp b/neosensor/libraries/neocampus/neocampus_utils.cpp index 1c726297744fb0cff343353ba545bd75c61c3b29..70de3c8d428f170be3448b72923cf9ed161cfb4f 100644 --- a/neosensor/libraries/neocampus/neocampus_utils.cpp +++ b/neosensor/libraries/neocampus/neocampus_utils.cpp @@ -9,7 +9,6 @@ * - ... * * --- - * F.Thiebolt jan.23 removed wifiManager.setMinimumSignalQuality(); cause of DHCP issues ?? * F.Thiebolt aug.22 removed WiFiparameters hack :) ... by means of dynamic allocation :| * F.Thiebolt aug.21 extended checkCLEAR to 5000ms (some ESP32 have huge * internal capacitor enabled@starup ?!?!) @@ -213,10 +212,8 @@ bool setupWiFi( wifiParametersMgt *wp ) { // set config save notify callback: only usefull for additional parameters wifiManager.setSaveConfigCallback( cb_exitConfigMode ); - /* set minimum signal level - * [jan.23] disabled while trying to overcome DHCP issues :| - * wifiManager.setMinimumSignalQuality(); // min. default is 8% - */ + // set minimum signal level + wifiManager.setMinimumSignalQuality(); // min. default is 8% /* [aug.20] does not work on ESP32 ... segfault :( * set custom ip for AP portal diff --git a/neosensor/neosensor.ino b/neosensor/neosensor.ino index 76d57effb5a2cc1f80e28c2f5de05a0354d859af..ac93644080383fad04c1cc7ff9849759f177a470 100644 --- a/neosensor/neosensor.ino +++ b/neosensor/neosensor.ino @@ -9,6 +9,9 @@ * (c) F.Thiebolt / neOCampus operation - Université Toulouse 3 * * --- + * WARNING: [jan.23] WiFiManager 2.0.15-rc1 does not list WiFi networks available !?!?! + * ==> UPGRADE WiFiManager for bsp_update branch <== + * --- * NOTES: * - [ESP8266]MEMP_NUM_TCP_PCB= 8 (MAX simulteaneous listening TCP connections) * - you need to 'deploy' our boards definitions (run the deploy.sh script) diff --git a/tests/WiFiManager_simple/WiFiManager_simple.ino b/tests/WiFiManager_simple/WiFiManager_simple.ino new file mode 100644 index 0000000000000000000000000000000000000000..23bd8dd019949d44cb8f6498f0e7fc21eee644bf --- /dev/null +++ b/tests/WiFiManager_simple/WiFiManager_simple.ino @@ -0,0 +1,55 @@ +#include <WiFiManager.h> // https://github.com/tzapu/WiFiManager + +/* Global variables */ +const char *mySSID="neOCampus"; +const char *mySSIDpw="CHANGE_ME"; + +void setup() { + delay(3000); // time for USB serial link to come up anew + Serial.begin(115200); // Start serial for output + + Serial.println(F("\n\n###\n### Starting simple WiFiManager connection test ...\n###")); + + // Arduino libs v2.4.1, to enable printf and debug messages output + Serial.setDebugOutput( true ); + + WiFi.mode(WIFI_STA); // explicitly set mode, esp defaults to STA+AP + // it is a good practice to make sure your code sets wifi mode how you want it. + + + //WiFiManager, Local intialization. Once its business is done, there is no need to keep it around + WiFiManager wm; + wm.setDebugOutput(true); + + // reset settings - wipe stored credentials for testing + // these are stored by the esp library + // wm.resetSettings(); + + // Automatically connect using saved credentials, + // if connection fails, it starts an access point with the specified name ( "AutoConnectAP"), + // if empty will auto generate SSID, if password is blank it will be anonymous AP (wm.autoConnect()) + // then goes into a blocking loop awaiting configuration and will return success result + + Serial.println(F("\tconnection timeout to 5mn ..."); + wm.setConnectTimeout(300); + + bool res; + // res = wm.autoConnect(); // auto generated AP name from chipid + // res = wm.autoConnect("AutoConnectAP"); // anonymous ap + res = wm.autoConnect(mySSID,mySSIDpw); // password protected ap + + if(!res) { + Serial.println("Failed to connect"); + // ESP.restart(); + } + else { + //if you get here you have connected to the WiFi + Serial.println("connected...yeey :)"); + } + +} + +void loop() { + // put your main code here, to run repeatedly: + Serial.print("+"); delay(1000); +} diff --git a/tests/WiFiManager_simple/debug.cfg b/tests/WiFiManager_simple/debug.cfg new file mode 100644 index 0000000000000000000000000000000000000000..aa99b3e5ea62cd8dc320e0a73d49bb7fc2c2ac9b --- /dev/null +++ b/tests/WiFiManager_simple/debug.cfg @@ -0,0 +1,14 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# +# Example OpenOCD configuration file for ESP32-WROVER-KIT board. +# +# For example, OpenOCD can be started for ESP32 debugging on +# +# openocd -f board/esp32-wrover-kit-3.3v.cfg +# + +# Source the JTAG interface configuration file +source [find interface/ftdi/esp32_devkitj_v1.cfg] +set ESP32_FLASH_VOLTAGE 3.3 +# Source the ESP32 configuration file +source [find target/esp32.cfg] diff --git a/tests/WiFiManager_simple/debug_custom.json b/tests/WiFiManager_simple/debug_custom.json new file mode 100644 index 0000000000000000000000000000000000000000..b890268e187a68585d8fb1ffde6dbc6e1a310cf6 --- /dev/null +++ b/tests/WiFiManager_simple/debug_custom.json @@ -0,0 +1,19 @@ +{ + "name":"Arduino on ESP32", + "toolchainPrefix":"xtensa-esp32-elf", + "svdFile":"esp32.svd", + "request":"attach", + "postAttachCommands":[ + "set remote hardware-watchpoint-limit 2", + "monitor reset halt", + "monitor gdb_sync", + "thb setup", + "c" + ], + "overrideRestartCommands":[ + "monitor reset halt", + "monitor gdb_sync", + "thb setup", + "c" + ] +} \ No newline at end of file