ESP32 wifi setup error

11 views (last 30 days)
준기 홍
준기 홍 on 28 Jul 2022
Answered: Raj on 1 Sep 2023
Hello,
If I press the "program" button to connect ESP32 to wifi from arduinosetup,I receive the IP address at the end, resulting in a warning message, "Failed to get device IP address, Check the WiFi network settings to increase device join the network and program it again."
I used my laptop and esp32 DevkitV1
and network setting
encryption type is WPA/WPA2. SSID and password have no problem and Port number is 9500.
If anyone who had this problem, how did you solve it? and would you help me?
  3 Comments
ALVIN PERUMAL
ALVIN PERUMAL on 11 Mar 2023
did you resolve it :(
kiroro00
kiroro00 on 20 May 2023
What kind of wifi do you use? Usually there would be no problem if you use standard home wifi (wired modem and router). If you personal hotspot, usually android phones hotspot would work.

Sign in to comment.

Answers (1)

Raj
Raj on 1 Sep 2023
Hi, just make sure you have followed the steps below correctly.
  1. Install the MATLAB Support Package for Arduino Hardware: Open MATLAB and go to the "APPS" tab in the MATLAB toolbar. Click on "Get More Apps" and search for "MATLAB Support Package for Arduino Hardware". Install the package.
  2. Connect the ESP32 to your computer: Connect your ESP32 board to your computer using a USB cable.
  3. Set up the Arduino hardware in MATLAB: In MATLAB, go to the "HOME" tab in the MATLAB toolbar and click on "Add-Ons" -> "Manage Add-Ons". In the Add-On Manager, click on "Arduino Hardware" and then click on "Configure". Follow the steps to set up the Arduino hardware in MATLAB.
  4. Create a MATLAB script to connect to Wi-Fi: In MATLAB, create a new script and enter the following code:
  5. Replace 'COMX' with the appropriate COM port of your ESP32 board. Replace 'your_wifi_ssid' and 'your_wifi_password' with your Wi-Fi network name and password.
% Connect to the ESP32 board
a = arduino('COMX', 'ESP32', 'Libraries', 'WiFi');
% Set up Wi-Fi credentials
ssid = 'your_wifi_ssid';
password = 'your_wifi_password';
% Connect to Wi-Fi
wifiConnect(a, ssid, password);
% Check if the connection is successful
if ismember('WiFi', a.AvailableLibraries)
disp('Connected to Wi-Fi!');
else
disp('Failed to connect to Wi-Fi.');
end
I hope this works, if it doesn’t, try changing the hotspot, as mentioned in the comments, sometimes, some type of hotspot do not work with ESP.
Additionally refer to the documentation for any more details

Products


Release

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!