Is MATLAB compatible with the ESP32 Bluetooth protocol ESP-NOW, specifically in broadcast mode?
3 views (last 30 days)
Show older comments
I have a design which has several(up to 10) ESP32s talking to each other using the Espressif Bluetooth protocol ESP-NOW in broadcast mode. Any device can send messages to every other device simultaneously by sending a message where the broadcast address is set to all F's, and all devices will recieve and process that message.
I would like to include a Bluetooth capable PC running MATLAB into that network. This is a long shot, but will MATLAB support that protocol?
1 Comment
Walter Roberson
on 28 Nov 2022
only audio broadcast it seems to me https://www.mathworks.com/help/bluetooth/ug/visualize-bluetooth-le-broadcast-audio-residential-scenario.html
Answers (1)
Amith
on 21 May 2024
Hi,
It is possible to communicate with the ESP32s using the ESP-NOW protocol from MATLAB. However, it will require some additional work as MATLAB does not have built-in support for the ESP-NOW protocol.
One approach would be to use the ESP32s to create a Wi-Fi network and have the Bluetooth capable PC connect to this network. This way, the ESP32s can communicate with the PC using standard TCP/IP sockets, and MATLAB has built-in support for TCP/IP communication.
To implement this approach, you would need to modify your ESP32 code to create a Wi-Fi network and establish TCP/IP sockets with the PC. The PC can then use MATLAB's TCP/IP functions to communicate with the ESP32s. The exact implementation details will depend on your specific application and network setup, but the general steps would be:
- Modify the ESP32 code to create a Wi-Fi network and establish a TCP/IP server socket to listen for incoming connections.
- Modify the ESP32 code to handle incoming messages from the PC and broadcast them to all other ESP32s using the ESP-NOW protocol.
- Have the PC connect to the ESP32's Wi-Fi network and establish a TCP/IP client socket to communicate with the ESP32s.
- Use MATLAB's TCP/IP functions, such as tcpip, fread, and fwrite, to communicate with the ESP32s.
kindly keep in mind that this approach may introduce additional latency and overhead compared to using the ESP-NOW protocol directly, so it may not be suitable for all applications. It is also important to properly secure the Wi-Fi network to prevent unauthorized access.
I hope this helps!
Amith
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!