Is MATLAB compatible with the ESP32 Bluetooth protocol ESP-NOW, specifically in broadcast mode?

7 ビュー (過去 30 日間)
Bret
Bret 2022 年 11 月 28 日
回答済み: Mathy 2024 年 5 月 21 日
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 件のコメント
Walter Roberson
Walter Roberson 2022 年 11 月 28 日
only audio broadcast it seems to me https://www.mathworks.com/help/bluetooth/ug/visualize-bluetooth-le-broadcast-audio-residential-scenario.html

サインインしてコメントする。

回答 (1 件)

Mathy
Mathy 2024 年 5 月 21 日
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:
  1. Modify the ESP32 code to create a Wi-Fi network and establish a TCP/IP server socket to listen for incoming connections.
  2. Modify the ESP32 code to handle incoming messages from the PC and broadcast them to all other ESP32s using the ESP-NOW protocol.
  3. Have the PC connect to the ESP32's Wi-Fi network and establish a TCP/IP client socket to communicate with the ESP32s.
  4. 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

カテゴリ

Help Center および File ExchangeBluetooth Low Energy Communication についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by