Please enable JavaScript to view this site.

Waijung 2 User Guide

Mesh Setup Block

How this block appears in a Simulink model?

wifi_mesh_block_3

What can be configured?

wifi_mesh_block_4

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.

When to use this block?

This block can be used to setup a mesh network between several ESP32 devices.

How does this block work?

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

How this block appears in a Simulink model?

wifi_mesh_block_1

What can be configured?

wifi_mesh_block_2

Configuration Parameter

Selectable Option/Value

Description

Output Data Buffer Size

32--64--128--256--512--1024

Select the output buffer size.

INPUT/ OUTPUT Port

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

When to use this block?

This block can be used to send data from other nodes in a mesh network.

 

Mesh Transmit Block

How this block appears in a Simulink model?

wifi_mesh_block_7

What can be configured?

wifi_mesh_block_8

Configuration Parameter

Selectable Option/Value

Description

Number of Receivers

 

Enter the number of nodes at the receiving end.

INPUT/ OUTPUT Port

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

When to use this block?

This block can be used to receive data from one node to other nodes in a mesh network.

Demo

Demo file : esp32_wifi_mesh_receive_demo.slx & esp32_wifi_mesh_transmit_demo.slx

 

Main Model

wifi_mesh_block_9

Transmit Subsystem

wifi_mesh_block_10

Receive Subsystem

wifi_mesh_block_11

Description

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.

wifi_mesh_block_12

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.

wifi_mesh_block_13

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

What should be happening?

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.

wifi_mesh_block_14

Copyright 2024 Aimagin Co.,Ltd. Rev.1659