ESP32 wifi setup error

11 次查看(过去 30 天)
준기 홍
준기 홍 2022-7-28
回答: Raj 2023-9-1
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 个评论
ALVIN PERUMAL
ALVIN PERUMAL 2023-3-11
did you resolve it :(
kiroro00
kiroro00 2023-5-20
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.

请先登录,再进行评论。

回答(1 个)

Raj
Raj 2023-9-1
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

类别

Help CenterFile Exchange 中查找有关 Setup and Configuration 的更多信息

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by