Introduction:
This log is based on the experiments on ESP-MESH with UART from June 11 to June 15 using esp32. Since other devices cannot directly communicate with the nodes in the mesh, It will be very easy for us to manage the swarm if we can directly control one esp32 with UART and use it to join the group.
Method:
The test is based on two example project of esp-idf: peripherals/uart/uart_echo & mesh/interal_communication. We use a Producer/Consumer model to link them together.
For the station, The idea is to establish two message queues, one for mesh send and another for mesh receive. Every time an esp32 receives a message from UART, it will put it in the mesh send queue. Another task will listen to the queue, once there is an item in the queue, the mesh send task will dequeue it and send it to the mesh network. Vice versa, once the station receives a message from the mesh network, it will send the message to the uart receive queue. Once the UART receive task detects that there's an item in the mesh receive queue, it will send it back to computer through UART. Thus we have an asynchronous duplex communication with the mesh network.
Coding Detail:
The data pack size sent through the mesh network is defined at the beginning of the code:
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.