I used the WiFiConnectionHandler provided in the "thingProperties.h" by Arduino to connect a Heltec WiFi Kit32 board to my home WiFi. It does not work reliably - once a while it connects, most of the time it showed
"Connection to "XXX" failed, Retrying in "4000" milliseconds". After long waiting (>30 minutes), it is still trying.
I used the following Arduino code example and it connects in about 90-120 seconds most of the time:
before I call the
" ArduinoCloud.begin(ArduinoIoTPreferredConnection);"
function.
I also wait long enough ( up to 3 minutes) for the WiFi to connect before I enter the main code to call "ArduinoCloud.update();" function.
This allows the board connected to my home WiFi first. Then, it still takes many more minutes to receive valid remote time from NPT server. Eventually, it connects to Arduino IoT Cloud. The data starts to upload correctly to the dashboard.
I hope the above suggestion is helpful to those users who have difficulties to connect their board to WiFi using the
"ArduinoCloud.begin(ArduinoIoTPreferredConnection);" function.
I spoke too fast. The above remedy worked only a few times. Now I am back yo square one. The ESP32 board continuously waiting for the WiFi connection with following message:
Arduino IoT Cloud - configuration info
Device ID: 161060e0-e70a-43b9-aaef-4060a99eb9de
MQTT Broker: iot.arduino.cc:8884
WiFi.status(): 6
Connection to "HSI" failed
Retrying in "4000" milliseconds
Connection to "HSI" failed
Retrying in "4000" milliseconds
What does "WiFi.status():6" means?
Is there anyway to solve the WiFi connection problem?
But i ran into my shortcommings again.....
After a lot of time and internet searches i have finaly found the drivers to get the board to be recognised and i managed to dump the code onto the board.
I need the SSID and password 'hardcoded' onto the board. I have tried this, but it does not work. (I must be doing it wrong.)
Hardcoding the SSID is not what i want, i want it to be flexible.
I badly need some help with it.
I want the board to send it's own SSID, so i can change the needed SSID/PASWORD by PC or Phone to connect it to the internet.
I also need the SSID to reset to its 'initial' SSID when the board looses the SSID connection after -X- attempts.
I know this code is availible (somewhere) because other projects worked like this, but i do not know how i should change this.
I would be VERY gratefull if somebody could help me out!
Kind regards,
Ben
DUTCH
Beste Arduino EXPERTS,
Om te beginnen moet ik vooraf bekennen dat ik een NOOB ben op het gebied van Arduino. Ik moet het hebben van wat andere mensen op diverse fora posten waar ik middels kopiƫren / plakken en de nodige portie aan geluk, toeval, of een heel goede walktrough met veel plezier gebruik van maak.
Omdat ik vastloop in mijn projectje moet ik hulp inroepen van de expertise van anderen.
Nu is het mij gelukt om de ontbrekende ESP8266 driver te vinden en de software naar het board te schrijven, maar ik krijg deze niet aan Wifi gekoppeld.
Mijn wens is dat het board na programmeren een eigen SSID uitzend, tot deze via PC of GSM aangepast is en dan op die manier aan het internet gehangen kan worden.
Ook zou het fijn zal dat als het board de connectie met WiFi verliest het weer na -X- pogingen de reset doet naar het initiƫle eigen SSID.