
In the Simulation tab of the Simulink model, click Run. Make sure that the IP address and port number are matching the WiFi settings specified earlier to ensure that the data is received from the correct target hardware.Ģ. Double-click on the TCP/IP Receive block.

Run the host model to receive data from the target modelġ. On the Hardware tab of the Simulink model, in the Mode section, select Run on board and then click Build, Deploy & Start. Perform Task 1 if your Arduino board is not Arduino Mega 2560 hardware.ģ. Run the Model configured for the target on the hardwareĢ. Simulink host model: TCP/IP Host Receive. Target model running on the Arduino hardware: Arduino TCP/IP Send.Ģ. This example shows how to use Simulink Support Package for Arduino hardware to send TCP/IP messages over WiFi using an Arduino board.ġ.

Task 2 - Sending TCP/IP Data Over WiFi Using Arduino Hardware Select the Hardware Implementation pane and select your required Arduino hardware from the Hardware board parameter list. In your Simulink model, click Simulation > Model Configuration Parameters to open Configuration Parameters dialog.Ģ. In this task, you will configure the model for the supported Arduino board.ġ.

You will perform this task if your Arduino board is not Arduino Mega 2560 hardware. Task 1 - Configure Simulink Model for Supported Arduino Hardware Configure Network Properties for Host Machine and WiFi hardwareįor configuring the IP Address for the host machine and the WiFi hardware refer to Configure Network Settings for WiFi. It can be used directly without any additional WiFi hardware. The Arduino MKR1000 has an on-board WiFi chip. Connect a USB cable from the PC to the Arduino MKR1000 board. Connect the ESP8266 to the Arduino board.įor more details on connecting the Arduino to ESP8266, refer to Connect ESP8266 to Arduino Hardware.ġ. Connect a USB cable from the PC to the Arduino board.įor more details on connecting the Arduino to WiFi Shield, refer to Connect Arduino WiFi Shield to Arduino Hardware.ġ.

Connect the WiFi Shield on the Arduino board.Ģ. The WiFi functionality can be used with Simulink Support Package for Arduino hardware by either of the following:ġ. In this task, you will configure the WiFi hardware. Note that Arduino MKR1000 has an on-board WiFi chip so no need to connect a WiFi Shield or ESP8266.
