Hallo,
ich möchte via Bluetooth seriell Daten zwischen ESP32 und PC
austauschen.
Im ESP32 benutze ich zum testen folgenden Code:
1 | //This example code is in the Public Domain (or CC0 licensed, at your option.)
|
2 | //By Evandro Copercini - 2018
|
3 | //
|
4 | //This example creates a bridge between Serial and Classical Bluetooth (SPP)
|
5 | //and also demonstrate that SerialBT have the same functionalities of a normal Serial
|
6 |
|
7 | #include "BluetoothSerial.h"
|
8 |
|
9 | #if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)
|
10 | #error Bluetooth is not enabled! Please run `make menuconfig` to and enable it
|
11 | #endif
|
12 |
|
13 | BluetoothSerial SerialBT;
|
14 |
|
15 | void setup() {
|
16 | Serial.begin(115200);
|
17 | SerialBT.begin("ESP32test"); //Bluetooth device name
|
18 | Serial.println("The device started, now you can pair it with bluetooth!");
|
19 | }
|
20 |
|
21 | void loop() {
|
22 | if (Serial.available()) {
|
23 | SerialBT.write(Serial.read());
|
24 | }
|
25 | if (SerialBT.available()) {
|
26 | Serial.write(SerialBT.read());
|
27 | }
|
28 | delay(20);
|
29 | }
|
Ich kann den ESP32test mit dem Windows-PC koppeln und finde im
Gerätemanager für Bluetooth folgende Serial-Ports:
Port 3 für abgehende
und
Port 5 für eingehende Daten
Um Daten mit dem ESP32 über die COM-Ports austauschen zu können, muß ich
in meine Windows-Software COM-Objekte einbinden. Kein Problem, aber ich
muß in den COM-Objekten die Ports bezüglich Baudrate, Start/Stopbits,
Parytie-Bit usw konfigurieren.
Trotz intensiver Recherche konnte keine Angaben über das Default-setting
der Ports des Bluetotthserial.h geschweige denn eine Dokumentation über
die Bluetotthserial.h Library finden.
Kann mir da Jemand weiterhelfen?