Apologies if this is the wrong category!
I am using IDE v 2.3.2and have been compiling very nicely, up to yesterday that was. Upon switch-on this morning I was prompted to upgrade some board profiles and libraries which I did.
However using the WiFi.h library has been a total disaster ever since, for I am no longer able to connect to the WiFi service. This was discovered after making a single change to a delay timing value and recompiling.
Despite having made no changes, I started getting warnings in the WiFi section.
Compilation error: 'SYSTEM_EVENT_STA_GOT_IP' was not declared in this scope; did you mean 'IP_EVENT_STA_GOT_IP'?
Compilation error: 'SYSTEM_EVENT_STA_DISCONNECTED' was not declared in this scope; did you mean 'WIFI_EVENT_STA_DISCONNECTED'?
I changed these back to IP_EVENT_STA_GOT_IP and WIFI_EVENT_STA_DISCONNECTED respectively and it did compile OK but did not connect to the Wi-Fi service.
However, could it be that the board definition upgrades are an issue? I am currently using ESP32-WROOM 32 modules and have historically set the IDE interface to "ESP32 Dev Module".
This does give me cause for concern, for all my modules so far use the same basis for communication with an MQTT broker [ Mosquitto running well on a Pi 3B+ ]
Any guidance and pointers will be gratefully received!
Revert to the version that worked for you
How can I achieve that please?
I don't know what to revert.
looks like you were using a very old esp32 Arduino core..
I'm thinking it was..
arduino-esp32 version 1.0.5
as it's based on esp-idf version 3.3 which is where I find this mentioned..
https://docs.espressif.com/projects/esp-idf/en/release-v3.3/api-guides/wifi.html
that's a really old version, might be better to bite the bullet and fix things up..
make a new test sketch, copy in the wifi connection routines..
if it fails, post up the test sketch and the board will do its magic..
good luck.. ~q
If it is the board file version that is causing the problem then you can revert to an earlier version using the Board Manager in the IDE
Thank you to everyone for your kind assistance, it is greatly appreciated.
Following UKHeliBob's suggestion I reverted the ESP32 board entry from v.3.0.0 back to v.2.0.16. This has certainly allowed the original code to compile and work again.
There is only one particular issue which may be due to an updated library and I need to somehow seek out. The WiFi service is now working well it seems, but the MQTT connection requires a manual press of the RST button - it no longer connects at start up as it did prior to my naively foolish willingness to upgrade everything!
I need to look for options to make the MQTT connect routine more robust perhaps.