ESP32 wifi setup error
12 次查看(过去 30 天)
显示 更早的评论
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 个评论
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
2023-9-1
Hi, just make sure you have followed the steps below correctly.
- 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.
- Connect the ESP32 to your computer: Connect your ESP32 board to your computer using a USB cable.
- 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.
- Create a MATLAB script to connect to Wi-Fi: In MATLAB, create a new script and enter the following code:
- 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
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Setup and Configuration 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!