Main Content

Configure Network Settings for Wi-Fi

You can configure the network settings for the Wi-Fi® on the Configuration Parameters dialog box. To do so, select WiFi properties.

To configure the network settings for Wi-Fi:

  1. Go to Configuration Parameters > Hardware Implementation > WiFi properties.

  2. In the WiFi hardware list, select the hardware that you are using for Wi-Fi connectivity. When you set the Wi-Fi hardware as ESP8266, the Hardware Serial Port parameter appears.

    The WiFi hardware parameter does not appear if the Hardware board parameter is set to MKR1000.

  3. 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.

    Note

    When selecting a hardware serial port, select a different port number from the number specified in the Port number parameter of Serial Receive and Serial Transmit blocks.

  4. 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 Wi-Fi 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 Wi-Fi 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.

  5. Specify the Service set identifier (SSID) parameters.

  6. In WiFi encryption parameter,

    • Select None option, if you connect to a Wi-Fi network that is not encrypted.

    • Select WEP encryption option, if you connect to a Wi-Fi network that uses WEP encryption.

      Enter WEP key and WEP key index values.

    • Select WPA encryption option, if you connect to a Wi-Fi network that uses WPA encryption.

      Enter WPA password.

      Note

      WEP encryption is not supported with ESP8266.

    Note

    DHCP is not supported in External mode for Arduino Leonardo, Arduino Yun boards due to memory constraints.

See Also

|