Mesh Setup Block
Configuration Parameter |
Selectable Option/Value |
Description |
Mesh ID |
|
Enter a unique mesh ID. |
Mesh AP Authentication Mode |
WIFI_AUTH_OPEN--WIFI_AUTH_WPA_PSK--WIFI_AUTH_WPA2_PSK--WIFI_AUTH_WPA_WPA2_PSK |
Select the authentication mode. |
Mesh AP Password |
|
Enter the mesh password. |
Mesh AP Connections |
|
Enter the number of nodes in the mesh. |
Mesh Max Layers |
1 to 6 |
Enter the maximum number of layers which the node hierarchy should be adjusted to. |
Router SSID |
|
Enter the router SSID. |
Router Password |
|
Enter the router password. |
Channel |
|
Enter the router channel. |
Mesh Network Status |
Check--Uncheck |
Enable/disable status output. |
This block can be used to setup a mesh network between several ESP32 devices.
Each node in the mesh network should contain this block. This will automatically identify the other nodes in the network and set the hierarchy according to the user configurations depending on the signal strength from router.
If ‘Mesh Network Status’ is ‘Checked’ it will indicate the completion of this setup process.
Note : The size (total number of nodes) in an ESP-WIFI-MESH network is dependent on the maximum number of layers permitted in the network, and the maximum number of downstream connections each node can have. Both of these variables can be configured to limit the size of the network.
Mesh Receive Block
Configuration Parameter |
Selectable Option/Value |
Description |
Output Data Buffer Size |
32--64--128--256--512--1024 |
Select the output buffer size. |
Port Name |
Port Type |
Date Type |
Description |
Data |
Scalar/Vector |
uint8 |
Data receiving from other devices |
From |
Vector |
uint8 |
Signal Mac address of the device data transmitted |
This block can be used to send data from other nodes in a mesh network.
Mesh Transmit Block
Configuration Parameter |
Selectable Option/Value |
Description |
Number of Receivers |
|
Enter the number of nodes at the receiving end. |
Port Name |
Port Type |
Date Type |
Description |
Data |
Scalar/Vector |
uint8 |
Data to be transmitted to the other specified address |
From |
Vector |
uint8 |
Signal Mac address of the device data transmitted |
To |
Vector |
uint8 |
Destination device Mac address of the data to be sent |
This block can be used to receive data from one node to other nodes in a mesh network.
Demo file : esp32_wifi_mesh_receive_demo.slx & esp32_wifi_mesh_transmit_demo.slx
This demo shows how to use the WIFI_mesh_block. This demo consist of two Simulink enable subsystem models, one for transmit data & one for receive data. The data is sent according to the Mac Address of the device entered to the respective blocks.
The Mac address of the each device should be identified before uploading the model. The buffer size of the transmitting data should be set by sprintf block.
This buffer size should match the receiver block buffer size.
You can find the Mac address using the following command, enter the command esptool.py read_mac in the esp-idf console.
For more info about ESP-IDF commands
Note:
•Enter credential of your nearby router to work without any errors.
•Sending buffer size should match the receiving buffer size.
•Setup_ESP-IDF_Command_Console
Once the model is uploaded to the respective devices, it should transmit data to the respective receiving device.
In this scenario, Hello world is transmitted from one device to another. Receiving esp32 boards need to be observed using a serial monitor to observe the output.