Configure Network Settings for WiFi
You can configure the network settings for the WiFi on the Configuration Parameters dialog box. To do so, select WiFi properties.
To configure the network settings for WiFi:
Go to Configuration Parameters > Hardware Implementation > WiFi properties.
In the WiFi hardware list, select the hardware that you are using for Wi-Fi® connectivity. When you set the WiFi hardware as
ESP8266, the Hardware Serial Port parameter appears.
The WiFi hardware parameter does not appear if the Hardware board parameter is set to
In the Hardware Serial Port list, select the port using which the Arduino® board communicates with the ESP8266. The hardware serial port is the port on the Arduino board that is connected to ESP8266. For more information on serial ports available on different Arduino boards, see Pin Mapping for Arduino Timer Independent Blocks.
The Arduino board by default gets its IP address through DHCP. Alternatively, you can assign a static IP address to the board by selecting the Use static IP address and disable DHCP check box and specifying the IP address. For the default mode, make sure that the network to which your hardware board connects, supports DHCP for IP address assignment.
When your model is deployed to the hardware, you can view the DHCP assigned IP address in the diagnostic viewer below the memory usage information. Alternatively, a MATLAB base workspace variable with the name <
modelname _IPaddress> is created with the value of the IP address.
When you specify the WiFi IP address, make sure of the following:
IP address is in the 4 octet format. For example, 192.168.1.20.
When connected to a computer, the IP address of the Arduino WiFi hardware and the IP address of the computer must be in the same range so they can communicate with each other.
However, make sure they are different.
When connected to a router, the IP address must be in the valid range of the supported IP addresses and must not be in the filtered list for that router.
Specify the Service set identifier (SSID) parameters.
In WiFi encryption parameter,
Noneoption, if you connect to a WiFi network that is not encrypted.
WEP encryptionoption, if you connect to a WiFi network that uses WEP encryption.
Enter WEP key and WEP key index values.
WPA encryptionoption, if you connect to a WiFi network that uses WPA encryption.
Enter WPA password.
WEP encryptionis not supported with ESP8266.
DHCP is not supported in External mode for Arduino Leonardo, Arduino Yun boards due to memory constraints.