WebSocket Publish
Add-On Required: This feature requires the Simulink Support Package for Arduino Hardware add-on.
Libraries:
Simulink Support Package for Arduino Hardware /
WiFi
Description
The WebSocket Publish block publishes data from the Arduino® hardware to a WebSocket server identified by an IP address and a port. The published data is in JavaScript Object Notation (JSON) format, which can be interpreted by a WebSocket client to visualize the data.
If the WebSocket Server is hosted on Arduino hardware, any device on the network can connect to the server and access the data.
Supported Arduino Boards
Arduino MKR1000
Arduino MKR WIFI 1010
Arduino Nano 33 IoT
Arduino compatible ESP32 – WROOM board
Arduino compatible ESP32 – WROVER board
WebSocket JSON Data
This figure shows the signals in JSON format.
If the JSON string size is more than 1024 bytes, the published data is replaced with the error messages.
Ports
Input
Parameters
Version History
Introduced in R2020b