Difference between revisions of "Component: Bluetooth BLE (ESP32 SPP Server) (Wireless)"
(Created page with "{| style="width:50%" |- | width="20%" style="color:gray;" | Author | Matrix TSL |- | width="20%" style="color:gray;" | Version | 1.0 |- | width="20%" style="color:gray...") |
|||
| Line 17: | Line 17: | ||
==Detailed description== | ==Detailed description== | ||
| − | + | This component requires the Bluetooth and Bluedroid libraries from the ESP32 IPE. | |
| + | |||
| + | If you get this error when compiling: esp_bt.h: No such file or directory | ||
| + | |||
| + | Then you may not have Bluetooth enabled. | ||
| + | |||
| + | To fix this navigate to C:\FC_ESP\mtx<chiptype>_sdkconfig\ | ||
| + | |||
| + | Then run menuconfig.bat to open the configuration editor. | ||
| + | |||
| + | Goto Component Config -> Bluetooth | ||
| + | |||
| + | Check the item Bluetooth. | ||
| + | |||
| + | Then go into Bluedroid Options and ensure the Enable BLE 4.2 features near the bottom is ticked. | ||
| + | |||
| + | Save and exit and then re-compile 🙂 | ||
==Examples== | ==Examples== | ||
Revision as of 16:13, 2 December 2025
| Author | Matrix TSL |
| Version | 1.0 |
| Category | Wireless |
Contents
Bluetooth BLE (ESP32 SPP Server) component
Bluetooth BLE server component designed to run on a ESP32 providing GATT SPP functionality. BT BLE functionality must be switched on via the sdkconfig file.
Detailed description
This component requires the Bluetooth and Bluedroid libraries from the ESP32 IPE.
If you get this error when compiling: esp_bt.h: No such file or directory
Then you may not have Bluetooth enabled.
To fix this navigate to C:\FC_ESP\mtx<chiptype>_sdkconfig\
Then run menuconfig.bat to open the configuration editor.
Goto Component Config -> Bluetooth
Check the item Bluetooth.
Then go into Bluedroid Options and ensure the Enable BLE 4.2 features near the bottom is ticked.
Save and exit and then re-compile 🙂
Examples
No additional examples
Macro reference
CheckConnectionStatus
| CheckConnectionStatus | |
| Checks to see if the Bluetooth device is connected. Returns 1 if connected. | |
| Return | |
Initialise
| Initialise | |
| Starts up the Bluetooth communications SPP service. | |
| Return | |
ReceiveArray
ReceiveByte
| ReceiveByte | |
| Attempts to receive a byte from the bluetooth serial port. 0-255 = a valid received value 256 = a timeout has occured | |
| Timeout | |
| Number of ms to wait for incoming data | |
| Return | |
ReceiveCount
| ReceiveCount | |
| Collects the number of bytes currently stored in the receive buffer. | |
| Return | |
ReceiveINTArray
ReceiveString
| ReceiveString | |
| MaxBytes | |
| Max number of bytes to try and read within the time | |
| Timeout | |
| Number of ms to wait for incoming data | |
| Return | |
SendArray
| SendArray | |
| Sends a byte to the Bluetooth serial connection | |
| Data | |
| Data Array to send | |
| NumBytes | |
| Number of bytes to send | |
| Return | |
SendByte
| SendByte | |
| Sends a byte to the Bluetooth serial connection | |
| Data | |
| Return | |
SendINTArray
SendString
| SendString | |
| Sends a string to the Bluetooth serial connection | |
| Data | |
| Data Array to send | |
| Return | |
SetBTName
| SetBTName | |
| Overrides the current friendly name | |
| Name | |
| Name you want to use | |
| Return | |
Uninitialise
| Uninitialise | |
| Shots down the Bluetooth communications SPP service. | |
| Return | |
Property reference
Component Source Code
Please click here to download the component source project: FC_Comp_Source_Bluetooth_ESP32_BLE_GATT_SPP_Server.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_Bluetooth_ESP32_BLE_GATT_SPP_Server.fcfx