• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Wifi retourn error

Q&A Forum › Category: ESP32 › Wifi retourn error
0 Vote Up Vote Down
Gilles Dubois asked 1 year ago

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

9 Answers
0 Vote Up Vote Down
Gilles Dubois answered 12 months ago

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’?

0 Vote Up Vote Down
Sara Santos Staff answered 12 months ago

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:

ESP32 PWM with Arduino IDE (Analog Output)


 
But if you have doubts, just let me know and I’ll try to help.
 
Regards,
Sara

0 Vote Up Vote Down
Sara Santos Staff answered 12 months ago

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

0 Vote Up Vote Down
Gilles Dubois answered 12 months ago

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

0 Vote Up Vote Down
Sara Santos Staff answered 12 months ago

It seems there is some issue with your network connection…
Are you using a wi-fi extender or something like that?
Regards,
Sara

0 Vote Up Vote Down
Gilles Dubois answered 12 months ago

Hi
No, I don’t think so, but I’ll check to be more certain. THANKS
Gilles

0 Vote Up Vote Down
Sara Santos Staff answered 12 months ago

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

0 Vote Up Vote Down
Gilles Dubois answered 12 months ago

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

0 Vote Up Vote Down
Sara Santos Staff answered 12 months ago

I mean with the IP of your broker.
Yes, it is the same of the raspberry pi.

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.