Hello, In Smart Home Raspberry pi ESP32, the code works but I have the result: Pages 173
Connecting to Wi-Fi…
E (23780) wifi:sta is connecting, return error
[WiFi-event] event: 14
WiFi lost connection
Publishing on topic counter at QoS 1, packetId: 0Connecting to Wi-Fi…
E (26194) wifi:sta is connecting, return error[
WiFi-event] event: 14
WiFi lost connection
My code is; 2 digits, 1 digit, 1 digit, 2 digits
#define MQTT_HOST IPAddress(xx, x, x, xx) //MQTT BROKER IP ADDRESS
The Ssid, Password, Broker is ok.
Gilles
J’ai ce message qui parait en plus :
Compilation error: ‘SYSTEM_EVENT_STA_GOT_IP’ was not declared in this scope; did you mean ‘IP_EVENT_STA_GOT_IP’?
Hi.
You probably updated your ESP32 boards to version 3.
There were some breaking changes from version 2 to 3.
We still didn’t update our eBooks to be compatible with version 3.
You can modify the code to be compatible with version 3 or downgrade your ESP32 boards version.
If you want to modify the code, you need to change the Wi-Fi events:
// OLD
SYSTEM_EVENT_STA_GOT_IP
SYSTEM_EVENT_STA_DISCONNECTED
// NEW
ARDUINO_EVENT_WIFI_STA_GOT_IP
ARDUINO_EVENT_WIFI_STA_DISCONNECTED
I hope this helps.
There were also changes when it comes to PWM. You can check our updated guide:
But if you have doubts, just let me know and I’ll try to help.
Regards,
Sara
Hi again.
The codes in Github for that particular eBook were already updated and are all compatible with version 3 of the ESP32 board.
Make sure you download the code again to use the latest version.
However, the PDF has not been updated yet, but the links for the codes are correct.
Regards,
Sara
Hi
I am download the codes in Github for that particular eBook. I get:
Publishing on topic counter at QoS 1, packetId: 0Connecting to Wi-Fi…
E (115529) wifi:sta is connecting, return error
[WiFi-event] event: 14
WiFi lost connection
Connecting to Wi-Fi…
E (117943) wifi:sta is connecting, return error
[WiFi-event] event: 14
WiFi lost connection
Could the error come from the IP code? My IP code is; 2 digits, 1 digit, 1 digit, 2 digits
#define MQTT_HOST IPAddress(xx, x, x, xx) //MQTT BROKER IP ADDRESS
Ssid, password, broker are ok.
Leaving…
Hard resetting via RTS pin…
My compilation is good
Gilles
It seems there is some issue with your network connection…
Are you using a wi-fi extender or something like that?
Regards,
Sara
Hi again.
Can you show me how does the following line looks like after inserting your broker IP address?
#define MQTT_HOST IPAddress(xx, x, x, xx) //MQTT BROKER IP ADDRESS
Regards,
Sara
Hi
Following your request.
19 #define MQTT_HOST IPAddress(xx, x, x, x) //MQTT BROKER IP ADDRESS
20 /*for example:
21 #define MQTT_HOST IPAddress(192, 168, 1, 106)*/
22 #define MQTT_PORT 1883
23 #define dgill “REPLACE_WITH_BROKER_USERNAME”
24 #define xxxxx “REPLACE_WITH_BROKER_PASSWORD”
Si je ne me trompe pas l’aresse IP est la même que mon raspberry pi. ?
If I’m not mistaken the MQTT_HOST IPAddress is the same as my raspberry Pi 4 B. ?
Gilles