Ich habe dazu folgendes ESP32 Modul benutzt: ESP32-D0WD-V3 (revision v3.1) / diymore ESP32 NodeMCU ESP32 WROOM 32D - development board CH340.
Zusätzlich benötigt ihr nur noch die MAC Adresse eurer Enterprise, z.B. herauszufinden über Wireshark (ggf. auch über BLE Scanner App?), und den Code unten für den ESP32. Danach in Loxone http-get Befehle triggern, z.B. mit http://192.168.1.XXX/M1 (XXX=vergebene lokale IP, herausfinden am Router!).
Ich habe die BLE-Befehle der iPhone App an die Enterprise über iPhone Bluetooth Logging in Erfahrung gebracht (nach Aktivierung des Loggings die App benutzt und die Befehle der Reihe nach ausgeführt), und zwar so wie hier beschrieben per Wireshark und dem Filter: bluetooth.dst == ac:XX:XX:26:c5:22. Hier muss man die passende MAC Adresse für euere Enterprise in Wireshark herausfinden (suche nach: "TexasInstrum_26:c5:22", oder nach Timestamp die entsprechenden Befehle im BT Protokoll wiederfinden) um übersichtlich alle Befehle (=Values) an die Enterprise gelistet zu bekommen. Man bekommt so die einzelnen Befehle heraus um die entsprechenden Aktionen zu triggern. Das habe ich bereits gemacht und findet sich unter im Code im byte-Array PmUSSECMDs wieder!
Schnell konnte ich so (geht auch über BLE scanner Apps am Smartphone) den entsprechenden BLE Service UUID und die Charcteristic UUID herausfinden:
[Destination Device Name: Pm_USSE_6C522] ← hierunter ist die Enterprise in BLE Scanner Apps schnell zu finden.
[Service UUID: bc2f4cc6aaef43519034d66268e328f0]
[UUID: 06d1e5e779ad4a718faa373789f7d93c]
über eine iPhone App wie z.B. "BLE Scanner" (dort: connect to "Pm_USSE_6C522" → Custom Service → Custom Characteristic → click "W" symbol → Hex → e.g.: aa0701ffff) oder aber am Mac über eine App wie "LightBlue" (dort: connect to "Pm_USSE_6C522" → USSE Command (="Characteristic user description") → "Write new value") kann man die Befehle (=Values) auch vorher mal testen.
Der nächste Schritt war die Verbindung zur Enterprise analog zu meinem Vorgehen hier: link, d.h. unter Nutzung der "BLEDevice.h"-Library. (siehe code anbei)
Außerdem läuft dann auf dem ESP32 ein Server über die Bibliotheken: "WiFi.h" / "WiFiClient.h" / "HTTPClient.h", sodass das Modul die passenden BLE Befehle auf http-get Befehl hin sendet...
Anwendungsfälle:
- Kopplung des "Roter Alarm"-Sounds an die Alarm-Anlage
- Lichter der Enterprise an BWM Koppeln...
Viel Spaß damit!
// Playmobile USS Enterprise
#include <WiFi.h> //Wifi support
#include <WiFiClient.h> //Wifi support
#include <HTTPClient.h> //Wifi server support
#include "BLEDevice.h" //BLE support
//On-chip LED GPIO (depends on used ESP32 board)
int LED_BUILTIN = 2;
const byte LED_Blue = 32;
const byte LED_White = 33;
const byte LED_Red = 27;
int LED_BlueStatic = 0;
//Wifi SSID and password
const char* ssid = "YourSSID";
const char* password = "YourPW";
unsigned long previousMillis = 0;
unsigned long timeoutTime = 30000; //timeout for Wifi-Connection
unsigned long previousMillisS = 0;
unsigned long timeoutTimeS = 1000; // Define timeout for Server connection /BUGFIX: const long to unsigned long
WiFiServer server(80);
//BLE UUIDs: The pattern is 8-4-4-4-12
#define EnterpriseBLEAddress "ac:1f:0f:26:XX:XX"
// The remote service we wish to connect to: Pm_USSE_6CXXX (Playmobil USS Enterprise)
static BLEUUID serviceUUID("bc2f4cc6-aaef-4351-9034-d66268e328f0");
// The characteristic of the remote service we are interested in: "USSE Command"
static BLEUUID charUUID("06d1e5e7-79ad-4a71-8faa-373789f7d93c");
static BLERemoteCharacteristic* pRemoteCharacteristic;
//variable holding connection status
bool BLEConnectionStatus;
//define commands ("Values") sniffed from Playmobil Enterprise iPhone APP
static byte PmUSSECMDs[58][5] = {
{0xaa, 0x07, 0x01, 0xff, 0xff}, // ||| CMD 1 / E1 / Warp: aa0701ffff
{0xaa, 0x07, 0x02, 0x00, 0xff}, // CMD 2 / E2 / Alarm: aa070200ff
{0xaa, 0x07, 0x03, 0x00, 0xff}, // CMD 3 / E3 / Torpedo: aa070300ff |||
{0xaa, 0x08, 0x01, 0xc8, 0xff}, // ||| CMD 4 / S1 / sound Brückenambiente: aa0801c8ff
{0xaa, 0x08, 0x02, 0xc8, 0xff}, // CMD 5 / S2 / sound Pfeife: aa0802c8ff
{0xaa, 0x08, 0x03, 0xc8, 0xff}, // CMD 6 / S3 / sound: Astrogator aa0803c8ff
{0xaa, 0x08, 0x04, 0xc8, 0xff}, // CMD 7 / S4 / sound: Dilithiumkern entfernt inkl. Alarm aa0804c8ff
{0xaa, 0x08, 0x05, 0xc8, 0xff}, // CMD 8 / S5 / sound Torpedo: aa0805c8ff
{0xaa, 0x08, 0x07, 0xc8, 0xff}, // CMD 9 / S6 / sound Alarm: aa0807c8ff
{0xaa, 0x08, 0x09, 0xc8, 0xff}, // CMD 10 / S7 / sound: BeepBeep aa0809c8ff
{0xaa, 0x08, 0x0a, 0xc8, 0xff}, // CMD 11 / S8 / sound Warp Drive Confirmation: aa080ac8ff
{0xaa, 0x08, 0x0b, 0xc8, 0xff}, // CMD 12 / S9 / sound Dematerialisieren: aa080bc8ff
{0xaa, 0x08, 0x06, 0xc8, 0xff}, // CMD 13 / SA / sound Scotty James to Enterprise: aa0806c8ff
{0xaa, 0x08, 0x08, 0xc8, 0xff}, // CMD 14 / SB / sound Live long and Prosper: aa0808c8ff |||
{0xaa, 0x08, 0x01, 0x80, 0xff}, // ||| CMD 15 / Q1 / sound Brückenambiente: aa080180ff (50%) (NEU Nov2025)
{0xaa, 0x08, 0x02, 0x80, 0xff}, // CMD 16 / Q2 / sound Pfeife: aa080280ff (50%) (NEU Nov2025)
{0xaa, 0x08, 0x03, 0x80, 0xff}, // CMD 17 / Q3 / sound: Astrogator aa080380ff (50%) (NEU Nov2025)
{0xaa, 0x08, 0x04, 0x80, 0xff}, // CMD 18 / Q4 / sound: Dilithiumkern entfernt inkl. Alarm aa080480ff (50%) (NEU Nov2025)
{0xaa, 0x08, 0x05, 0x80, 0xff}, // CMD 19 / Q5 / sound Torpedo: aa080580ff (50%) (NEU Nov2025)
{0xaa, 0x08, 0x07, 0x80, 0xff}, // CMD 20 / Q6 / sound Alarm: aa080780ff (50%) (NEU Nov2025)
{0xaa, 0x08, 0x09, 0x80, 0xff}, // CMD 21 / Q7 / sound: BeepBeep aa080980ff (50%) (NEU Nov2025)
{0xaa, 0x08, 0x0a, 0x80, 0xff}, // CMD 22 / Q8 / sound Warp Drive Confirmation: aa080a80ff (50%) (NEU Nov2025)
{0xaa, 0x08, 0x0b, 0x80, 0xff}, // CMD 23 / Q9 / sound Dematerialisieren: aa080b80ff (50%) (NEU Nov2025)
{0xaa, 0x08, 0x06, 0x80, 0xff}, // CMD 24 / QA / sound Scotty James to Enterprise: aa080680ff (50%) (NEU Nov2025)
{0xaa, 0x08, 0x08, 0x80, 0xff}, // CMD 25 / QB / sound Live long and Prosper: aa080880ff (50%) (NEU Nov2025) |||
{0xaa, 0x04, 0x01, 0xc8, 0xff}, // ||| CMD 26 / PL1 / pulsing lights: Konsode (Brücke): aa0401c8ff
{0xaa, 0x04, 0x02, 0xc8, 0xff}, // CMD 27 / PL2 / pulsing lights: roter Alarm (Brücke): aa0402c8ff
{0xaa, 0x04, 0x03, 0xc8, 0xff}, // CMD 28 / PL3 / pulsing lights: Torpedo: aa0403c8ff
{0xaa, 0x04, 0x04, 0xc8, 0xff}, // CMD 29 / PL4 / pulsing lights: Warp-Console Seite Rot (Maschinenraum): aa0404c8ff (NEU Nov2025)
{0xaa, 0x04, 0x06, 0xc8, 0xff}, // CMD 30 / PL5 / pulsing lights: Dilithiumkern (Maschinenraum): aa0406c8ff
{0xaa, 0x04, 0x07, 0xc8, 0xff}, // CMD 31 / PL6 / pulsing lights: Warp Gondeln: aa0407c8ff
{0xaa, 0x05, 0x01, 0xc8, 0xff}, // CMD 32 / PL7 / pulsing lights: Torpedo Twice: aa0501c8ff
{0xaa, 0x05, 0x07, 0xc8, 0xff}, // CMD 33 / PL8 / pulsing lights: Go to Warp: aa0507c8ff
{0xaa, 0x04, 0x07, 0x80, 0xff}, // CMD 34 / PLq6 / pulsing lights: Warp Gondeln: aa040780ff (50%) (NEU Nov2025) |||
{0xaa, 0x06, 0x01, 0xc8, 0xff}, // ||| CMD 35 / SL1 / static lights: Konsode (Brücke): aa0601c8ff (NEU Nov2025)
{0xaa, 0x06, 0x02, 0xc8, 0xff}, // CMD 36 / SL2 / static lights: roter Alarm (Brücke): aa0602c8ff (NEU Nov2025)
{0xaa, 0x06, 0x03, 0xc8, 0xff}, // CMD 37 / SL3 / static lights: Torpedo: aa0603c8ff (NEU Nov2025)
{0xaa, 0x06, 0x04, 0xc8, 0xff}, // CMD 38 / SL4 / static lights: Warp-Console Seite Blau (Maschinenraum): aa0604c8ff (NEU Nov2025)
{0xaa, 0x06, 0x05, 0xc8, 0xff}, // CMD 39 / SL5 / static lights: Warp-Console Seite Rot (Maschinenraum): aa0605c8ff (NEU Nov2025)
{0xaa, 0x06, 0x06, 0xc8, 0xff}, // CMD 40 / SL6 / static lights: Dilithiumkern (Maschinenraum): aa0406c8ff (NEU Nov2025)
{0xaa, 0x06, 0x07, 0xc8, 0xff}, // CMD 41 / SL7 / static lights: Warp Gondeln: aa0407c8ff (NEU Nov2025)
{0xaa, 0x06, 0x07, 0x80, 0xff}, // CMD 42 / SLq7 / static lights: Warp Gondeln: aa040780ff (50%) (NEU Nov2025) |||
{0xaa, 0x03, 0xff, 0x00, 0xff}, // ||| CMD 43 / v1 / Vol 100: aa03ff00ff
{0xaa, 0x03, 0x83, 0x00, 0xff}, // CMD 44 / v2 / Vol 50: aa038300ff
{0xaa, 0x03, 0x80, 0x00, 0xff}, // CMD 45 / v3 / Vol 30: aa038000ff
{0xaa, 0x03, 0x00, 0x00, 0xff}, // CMD 46 / v4 / Vol 0: aa030000ff |||
{0xaa, 0x07, 0x04, 0x00, 0xff}, // ||| CMD 47 / x / Alles AUS: aa070400ff |||
{0xaa, 0x08, 0x01, 0x40, 0xff}, // ||| CMD 48 / QQ1 / sound Brückenambiente: aa080180ff (25%) (NEU Nov2025)
{0xaa, 0x08, 0x02, 0x40, 0xff}, // CMD 49 / QQ2 / sound Pfeife: aa080280ff (25%) (NEU Nov2025)
{0xaa, 0x08, 0x03, 0x40, 0xff}, // CMD 50 / QQ3 / sound: Astrogator aa080380ff (25%) (NEU Nov2025)
{0xaa, 0x08, 0x04, 0x40, 0xff}, // CMD 51 / QQ4 / sound: Dilithiumkern entfernt inkl. Alarm aa080480ff (25%) (NEU Nov2025)
{0xaa, 0x08, 0x05, 0x40, 0xff}, // CMD 52 / QQ5 / sound Torpedo: aa080580ff (25%) (NEU Nov2025)
{0xaa, 0x08, 0x07, 0x40, 0xff}, // CMD 53 / QQ6 / sound Alarm: aa080780ff (25%) (NEU Nov2025)
{0xaa, 0x08, 0x09, 0x40, 0xff}, // CMD 54 / QQ7 / sound: BeepBeep aa080980ff (25%) (NEU Nov2025)
{0xaa, 0x08, 0x0a, 0x40, 0xff}, // CMD 55 / QQ8 / sound Warp Drive Confirmation: aa080a80ff (25%) (NEU Nov2025)
{0xaa, 0x08, 0x0b, 0x40, 0xff}, // CMD 56 / QQ9 / sound Dematerialisieren: aa080b80ff (25%) (NEU Nov2025)
{0xaa, 0x08, 0x06, 0x40, 0xff}, // CMD 57 / QQA / sound Scotty James to Enterprise: aa080680ff (25%) (NEU Nov2025)
{0xaa, 0x08, 0x08, 0x40, 0xff} // CMD 58 / QQB / sound Live long and Prosper: aa080880ff (25%) (NEU Nov2025) |||
};
WiFiClient espClient;
// Standard Arduino function which is called once when the device first starts up
void setup() {
// Setup for Serial Monitor (when connected to Arduino IDE: Tools -> Serial Monitor)
Serial.begin(9600);
while(!Serial) {
delay(10);
}
// Initialize digital pin LED_BUILTIN, & the external LED pins (LED_Blue, LED_White) as an output.
pinMode(LED_BUILTIN, OUTPUT);
pinMode(LED_Blue, OUTPUT);
pinMode(LED_White, OUTPUT);
pinMode(LED_Red, OUTPUT);
//status LED shows light
digitalWrite(LED_White, HIGH); // turn the external status LED on (HIGH is the voltage level)
//Alarm LED (red) off by default
digitalWrite(LED_Red, LOW); // turn the external status LED on (HIGH is the voltage level)
//connect to Pm_USSE_6C522 (Playmobil USS Enterprise)
BLEDevice::init("");
BLEClient* pClient = BLEDevice::createClient();
Serial.println("\nTrying to connect to Pm_USSE_6C522");
//BLE address of Pm_USSE_6C522 (Playmobil USS Enterprise)
if (pClient->connect(BLEAddress(EnterpriseBLEAddress))) {
Serial.println("Connected!");
BlinkLED();BlinkLED();
Serial.println("\nTrying to connect to BLE-Service");
BLERemoteService* pRemoteService = pClient->getService(serviceUUID);
if (pRemoteService == nullptr) {
Serial.println("Failed to get service");
return;
} else Serial.println("Got service");
Serial.println("\nTrying to connect to BLE-Characteristic of Service");
pRemoteCharacteristic = pRemoteService->getCharacteristic(charUUID);
if (pRemoteCharacteristic == nullptr) {
Serial.println("Failed to get characteristic");
return;
} else Serial.println("Got characteristic");
} else Serial.println("Failed to connect");
Serial.println("\nPrint Status:");
BLEConnectionStatus = pClient->isConnected();
Serial.println(BLEConnectionStatus);
// Connect to WiFi
Serial.println("\nConnecting to WiFi");
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
while(WiFi.status() != WL_CONNECTED){
Serial.print(".");
delay(500);
}
Serial.print("\nConnected to the WiFi network: ");
Serial.print(String(ssid));
Serial.print(" | local ESP32 IP: ");
Serial.print(WiFi.localIP());
Serial.print(" | RSSI: ");
Serial.println(WiFi.RSSI());
//start server to allow control via http commands
server.begin();
// Blink LED on Chip once on Startup
BlinkLED();BlinkLED();BlinkLED();
}
// Blink LED on Chip
void BlinkLED() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
if (LED_BlueStatic == 0) {
digitalWrite(LED_Blue, HIGH); // turn the external LED on (HIGH is the voltage level)
}
delay(100); // LED on for 100msec
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
if (LED_BlueStatic == 0) {
digitalWrite(LED_Blue, LOW); // turn the external LED off
}
delay(100); // wait / off for 100msec
}
// Standard Arduino function that is called in an endless loop after setup
void loop() {
unsigned long currentMillis = millis(); //works for ca. 50 days before reset to 0
unsigned long currentMillisS = millis(); //works for ca. 50 days before reset to 0
// if WiFi is down, try reconnecting every timeoutTime seconds
if ((WiFi.status() != WL_CONNECTED) && (currentMillis - previousMillis >= timeoutTime)) {
Serial.print(millis());
Serial.println("Reconnecting to WiFi...");
WiFi.disconnect();
WiFi.reconnect();
Serial.print("\nConnected to the WiFi network: ");
Serial.print(String(ssid));
Serial.print(" | local ESP32 IP: ");
Serial.print(WiFi.localIP());
Serial.print(" | RSSI: ");
Serial.println(WiFi.RSSI());
previousMillis = currentMillis;
}
//bugfix: removed rollover handling! unsigned long never <0!
//get restart command from external http command to server
WiFiClient client = server.available();
if (client) {
currentMillisS = millis();
previousMillisS = currentMillisS;
Serial.println("New Client");
String currentLine = "";
while (client.connected() && (currentMillisS - previousMillisS <= timeoutTimeS)) {
currentMillisS = millis();
if (client.available()) {
char c = client.read();
Serial.write(c);
if (c == '\n') {
if (currentLine.length() == 0) {
// HTTP headers always start with a response code (e.g. HTTP/1.1 200 OK)
// and a content-type so the client knows what's coming, then a blank line:
client.println("HTTP/1.1 200 OK");
client.println("Content-type:text/html");
//client.println("Connection: close");
client.println();
//create the buttons
client.print("Enterprise: <a href=\"/x\">AUS</a><br><br>");
client.print("Effect: <a href=\"/E1\">Warp</a><br>");
client.print("Effect: <a href=\"/E2\">Alarm</a><br>");
client.print("Effect: <a href=\"/E3\">Torpedo</a><br><br>");
client.print("Sound: <a href=\"/S1\">Brueckenambiente (100%)</a> / <a href=\"/Q1\">(50%)</a> / <a href=\"/QQ1\">(25%)</a><br>");
client.print("Sound: <a href=\"/S2\">Pfeife (100%)</a> / <a href=\"/Q2\">(50%)</a> / <a href=\"/QQ2\">(25%)</a><br>");
client.print("Sound: <a href=\"/S3\">Astrogator (100%)</a> / <a href=\"/Q3\">(50%)</a> / <a href=\"/QQ3\">(25%)</a><br>");
client.print("Sound: <a href=\"/S4\">Dilithiumkern entfernt (inkl. Alarm) (100%)</a> / <a href=\"/Q4\">(50%)</a> / <a href=\"/QQ4\">(25%)</a><br>");
client.print("Sound: <a href=\"/S5\">Torpedo (100%)</a> / <a href=\"/Q5\">(50%)</a> / <a href=\"/QQ5\">(25%)</a><br>");
client.print("Sound: <a href=\"/S6\">Alarm (100%)</a> / <a href=\"/Q6\">(50%)</a> / <a href=\"/QQ6\">(25%)</a><br>");
client.print("Sound: <a href=\"/S7\">Beep Beep (100%)</a> / <a href=\"/Q7\">(50%)</a> / <a href=\"/QQ7\">(25%)</a><br>");
client.print("Sound: <a href=\"/S8\">Warp Drive Confirmation (100%)</a> / <a href=\"/Q8\">(50%)</a> / <a href=\"/QQ8\">(25%)</a><br>");
client.print("Sound: <a href=\"/S9\">Dematerialisieren (100%)</a> / <a href=\"/Q9\">(50%)</a> / <a href=\"/QQ9\">(25%)</a><br>");
client.print("Sound: <a href=\"/SA\">Scotty James Enterprise (100%)</a> / <a href=\"/QA\">(50%)</a> / <a href=\"/QQA\">(25%)</a><br>");
client.print("Sound: <a href=\"/SB\">Live Long and Prosper (100%)</a> / <a href=\"/QB\">(50%)</a> / <a href=\"/QQB\">(25%)</a><br><br>");
client.print("Pulsing Lights: <a href=\"/PL1\">Konsole (Bruecke)</a><br>");
client.print("Pulsing Lights: <a href=\"/PL2\">roter Alarm (Bruecke)</a><br>");
client.print("Pulsing Lights: <a href=\"/PL3\">Torpedo</a><br>");
client.print("Pulsing Lights: <a href=\"/PL4\">Warp-Konsole Rot (Maschinenraum, Seite)</a><br>");
client.print("Pulsing Lights: <a href=\"/PL5\">Dilithiumkern (Maschinenraum)</a><br>");
client.print("Pulsing Lights: <a href=\"/PL6\">Warp-Gondeln</a> / <a href=\"/PLq6\">Warp-Gondeln (50%)</a><br>");
client.print("Pulsing Lights: <a href=\"/PL7\">Torpedo Twice</a><br>");
client.print("Pulsing Lights: <a href=\"/PL8\">Go to Warp</a><br><br>");
client.print("Static Lights: <a href=\"/SL1\">Konsole (Bruecke)</a><br>");
client.print("Static Lights: <a href=\"/SL2\">roter Alarm (Bruecke)</a><br>");
client.print("Static Lights: <a href=\"/SL3\">Torpedo</a><br>");
client.print("Static Lights: <a href=\"/SL4\">Warp-Konsole Blau (Maschinenraum, Seite)</a><br>");
client.print("Static Lights: <a href=\"/SL5\">Warp-Konsole Rot (Maschinenraum, Seite)</a><br>");
client.print("Static Lights: <a href=\"/SL6\">Dilithiumkern (Maschinenraum)</a><br>");
client.print("Static Lights: <a href=\"/SL7\">Warp-Gondeln</a> / <a href=\"/SLq7\">Warp-Gondeln (50%)</a><br><br>");
client.print("Volume: <a href=\"/v1\">100%</a><br>");
client.print("Volume: <a href=\"/v2\">50%</a><br>");
client.print("Volume: <a href=\"/v3\">30%</a><br>");
client.print("Volume: <a href=\"/v4\">0%</a><br><br>");
client.print("ESP32 Modul: <a href=\"/T\">Blink!</a><br>");
client.print("ESP32 Modul: <a href=\"/W0\">Status LED Off</a><br>");
client.print("ESP32 Modul: <a href=\"/W1\">Status LED On</a><br>");
client.print("ESP32 Modul: <a href=\"/B0\">Blue LED: Blink on BLE CMDs</a><br>");
client.print("ESP32 Modul: <a href=\"/B1\">Blue LED: keep ON</a><br>");
client.print("ESP32 Modul: <a href=\"/A0\">RED LED: Off</a><br>");
client.print("ESP32 Modul: <a href=\"/A1\">RED LED: On</a><br><br>");
client.print("ESP32 Modul: <a href=\"/d\">deep sleep</a><br>");
client.print("ESP32 Modul: <a href=\"/R\">restart</a><br>");
// The HTTP response ends with another blank line:
client.println();
// break out of the while loop:
break;
} else {
currentLine = "";
}
} else if (c != '\r') {
currentLine += c;
}
// Execute commands
if (currentLine.endsWith("GET /T")) {
Serial.println(" command received to Blink ESP32 Module");
BlinkLED();BlinkLED();BlinkLED();
}
if (currentLine.endsWith("GET /R")) {
Serial.println(" command received to restart ESP32 Module");
BlinkLED();BlinkLED();BlinkLED();
ESP.restart();
}
if (currentLine.endsWith("GET /E1")) {
Serial.println(" command received to send BLE-command 1 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[0],sizeof(PmUSSECMDs[0]));
}
if (currentLine.endsWith("GET /E2")) {
Serial.println(" command received to send BLE-command 2 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[1],sizeof(PmUSSECMDs[1]));
}
if (currentLine.endsWith("GET /E3")) {
Serial.println(" command received to send BLE-command 3 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[2],sizeof(PmUSSECMDs[2]));
}
if (currentLine.endsWith("GET /S1")) {
Serial.println(" command received to send BLE-command 4 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[3],sizeof(PmUSSECMDs[3]));
}
if (currentLine.endsWith("GET /S2")) {
Serial.println(" command received to send BLE-command 5 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[4],sizeof(PmUSSECMDs[4]));
}
if (currentLine.endsWith("GET /S3")) {
Serial.println(" command received to send BLE-command 6 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[5],sizeof(PmUSSECMDs[5]));
}
if (currentLine.endsWith("GET /S4")) {
Serial.println(" command received to send BLE-command 7 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[6],sizeof(PmUSSECMDs[6]));
}
if (currentLine.endsWith("GET /S5")) {
Serial.println(" command received to send BLE-command 8 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[7],sizeof(PmUSSECMDs[7]));
}
if (currentLine.endsWith("GET /S6")) {
Serial.println(" command received to send BLE-command 9 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[8],sizeof(PmUSSECMDs[8]));
}
if (currentLine.endsWith("GET /S7")) {
Serial.println(" command received to send BLE-command 10 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[9],sizeof(PmUSSECMDs[9]));
}
if (currentLine.endsWith("GET /S8")) {
Serial.println(" command received to send BLE-command 11 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[10],sizeof(PmUSSECMDs[10]));
}
if (currentLine.endsWith("GET /S9")) {
Serial.println(" command received to send BLE-command 12 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[11],sizeof(PmUSSECMDs[11]));
}
if (currentLine.endsWith("GET /SA")) {
Serial.println(" command received to send BLE-command 13 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[12],sizeof(PmUSSECMDs[12]));
}
if (currentLine.endsWith("GET /SB")) {
Serial.println(" command received to send BLE-command 14 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[13],sizeof(PmUSSECMDs[13]));
}
if (currentLine.endsWith("GET /Q1")) {
Serial.println(" command received to send BLE-command 15 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[14],sizeof(PmUSSECMDs[14]));
}
if (currentLine.endsWith("GET /Q2")) {
Serial.println(" command received to send BLE-command 16 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[15],sizeof(PmUSSECMDs[15]));
}
if (currentLine.endsWith("GET /Q3")) {
Serial.println(" command received to send BLE-command 17 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[16],sizeof(PmUSSECMDs[16]));
}
if (currentLine.endsWith("GET /Q4")) {
Serial.println(" command received to send BLE-command 18 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[17],sizeof(PmUSSECMDs[17]));
}
if (currentLine.endsWith("GET /Q5")) {
Serial.println(" command received to send BLE-command 19 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[18],sizeof(PmUSSECMDs[18]));
}
if (currentLine.endsWith("GET /Q6")) {
Serial.println(" command received to send BLE-command 20 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[19],sizeof(PmUSSECMDs[19]));
}
if (currentLine.endsWith("GET /Q7")) {
Serial.println(" command received to send BLE-command 21 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[20],sizeof(PmUSSECMDs[20]));
}
if (currentLine.endsWith("GET /Q8")) {
Serial.println(" command received to send BLE-command 22 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[21],sizeof(PmUSSECMDs[21]));
}
if (currentLine.endsWith("GET /Q9")) {
Serial.println(" command received to send BLE-command 23 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[22],sizeof(PmUSSECMDs[22]));
}
if (currentLine.endsWith("GET /QA")) {
Serial.println(" command received to send BLE-command 24 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[23],sizeof(PmUSSECMDs[23]));
}
if (currentLine.endsWith("GET /QB")) {
Serial.println(" command received to send BLE-command 25 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[24],sizeof(PmUSSECMDs[24]));
}
if (currentLine.endsWith("GET /QQ1")) {
Serial.println(" command received to send BLE-command 48 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[47],sizeof(PmUSSECMDs[47]));
}
if (currentLine.endsWith("GET /QQ2")) {
Serial.println(" command received to send BLE-command 49 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[48],sizeof(PmUSSECMDs[48]));
}
if (currentLine.endsWith("GET /QQ3")) {
Serial.println(" command received to send BLE-command 50 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[49],sizeof(PmUSSECMDs[49]));
}
if (currentLine.endsWith("GET /QQ4")) {
Serial.println(" command received to send BLE-command 51 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[50],sizeof(PmUSSECMDs[50]));
}
if (currentLine.endsWith("GET /QQ5")) {
Serial.println(" command received to send BLE-command 52 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[51],sizeof(PmUSSECMDs[51]));
}
if (currentLine.endsWith("GET /QQ6")) {
Serial.println(" command received to send BLE-command 53 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[52],sizeof(PmUSSECMDs[52]));
}
if (currentLine.endsWith("GET /QQ7")) {
Serial.println(" command received to send BLE-command 54 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[53],sizeof(PmUSSECMDs[53]));
}
if (currentLine.endsWith("GET /QQ8")) {
Serial.println(" command received to send BLE-command 55 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[54],sizeof(PmUSSECMDs[54]));
}
if (currentLine.endsWith("GET /QQ9")) {
Serial.println(" command received to send BLE-command 56 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[55],sizeof(PmUSSECMDs[55]));
}
if (currentLine.endsWith("GET /QQA")) {
Serial.println(" command received to send BLE-command 57 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[56],sizeof(PmUSSECMDs[56]));
}
if (currentLine.endsWith("GET /QQB")) {
Serial.println(" command received to send BLE-command 58 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[57],sizeof(PmUSSECMDs[57]));
}
if (currentLine.endsWith("GET /PL1")) {
Serial.println(" command received to send BLE-command 26 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[25],sizeof(PmUSSECMDs[25]));
}
if (currentLine.endsWith("GET /PL2")) {
Serial.println(" command received to send BLE-command 27 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[26],sizeof(PmUSSECMDs[26]));
}
if (currentLine.endsWith("GET /PL3")) {
Serial.println(" command received to send BLE-command 28 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[27],sizeof(PmUSSECMDs[27]));
}
if (currentLine.endsWith("GET /PL4")) {
Serial.println(" command received to send BLE-command 29 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[28],sizeof(PmUSSECMDs[28]));
}
if (currentLine.endsWith("GET /PL5")) {
Serial.println(" command received to send BLE-command 30 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[29],sizeof(PmUSSECMDs[29]));
}
if (currentLine.endsWith("GET /PL6")) {
Serial.println(" command received to send BLE-command 31 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[30],sizeof(PmUSSECMDs[30]));
}
if (currentLine.endsWith("GET /PL7")) {
Serial.println(" command received to send BLE-command 32 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[31],sizeof(PmUSSECMDs[31]));
}
if (currentLine.endsWith("GET /PL8")) {
Serial.println(" command received to send BLE-command 33 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[32],sizeof(PmUSSECMDs[32]));
}
if (currentLine.endsWith("GET /PLq6")) {
Serial.println(" command received to send BLE-command 34 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[33],sizeof(PmUSSECMDs[33]));
}
if (currentLine.endsWith("GET /SL1")) {
Serial.println(" command received to send BLE-command 35 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[34],sizeof(PmUSSECMDs[34]));
}
if (currentLine.endsWith("GET /SL2")) {
Serial.println(" command received to send BLE-command 36 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[35],sizeof(PmUSSECMDs[35]));
}
if (currentLine.endsWith("GET /SL3")) {
Serial.println(" command received to send BLE-command 37 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[36],sizeof(PmUSSECMDs[36]));
}
if (currentLine.endsWith("GET /SL4")) {
Serial.println(" command received to send BLE-command 38 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[37],sizeof(PmUSSECMDs[37]));
}
if (currentLine.endsWith("GET /SL5")) {
Serial.println(" command received to send BLE-command 39 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[38],sizeof(PmUSSECMDs[38]));
}
if (currentLine.endsWith("GET /SL6")) {
Serial.println(" command received to send BLE-command 40 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[39],sizeof(PmUSSECMDs[23]));
}
if (currentLine.endsWith("GET /SL7")) {
Serial.println(" command received to send BLE-command 41 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[40],sizeof(PmUSSECMDs[40]));
}
if (currentLine.endsWith("GET /SLq7")) {
Serial.println(" command received to send BLE-command 42 to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[41],sizeof(PmUSSECMDs[41]));
}
if (currentLine.endsWith("GET /v1")) {
Serial.println(" command received to send BLE-command 43 = v1 = Vol 100% to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[42],sizeof(PmUSSECMDs[42]));
}
if (currentLine.endsWith("GET /v2")) {
Serial.println(" command received to send BLE-command 44 = v2 = Vol 50% to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[43],sizeof(PmUSSECMDs[43]));
}
if (currentLine.endsWith("GET /v3")) {
Serial.println(" command received to send BLE-command 45 = v3 = Vol 30% to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[44],sizeof(PmUSSECMDs[44]));
}
if (currentLine.endsWith("GET /v4")) {
Serial.println(" command received to send BLE-command 46 = v4 = Vol 0% to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[45],sizeof(PmUSSECMDs[45]));
}
if (currentLine.endsWith("GET /x")) {
Serial.println(" command received to send BLE-command 47 = x = AUS to Enterprise");
BlinkLED();
pRemoteCharacteristic->writeValue(PmUSSECMDs[46],sizeof(PmUSSECMDs[46]));
}
if (currentLine.endsWith("GET /W0")) {
Serial.println(" command received to turn OFF Status LED");
digitalWrite(LED_White, LOW);
}
if (currentLine.endsWith("GET /W1")) {
Serial.println(" command received to turn ON Status LED");
digitalWrite(LED_White, HIGH);
}
if (currentLine.endsWith("GET /A0")) {
Serial.println(" command received to turn OFF Red LED");
digitalWrite(LED_Red, LOW);
}
if (currentLine.endsWith("GET /A1")) {
Serial.println(" command received to turn ON Red LED");
digitalWrite(LED_Red, HIGH);
}
if (currentLine.endsWith("GET /B0")) {
Serial.println(" command received to make blue LED blink only on BLE CMDs");
LED_BlueStatic = 0;
digitalWrite(LED_Blue, LOW); // turn the external LED on (HIGH is the voltage level)
}
if (currentLine.endsWith("GET /B1")) {
Serial.println(" command received to keep blue LED ON");
LED_BlueStatic = 1;
digitalWrite(LED_Blue, HIGH); // turn the external LED on (HIGH is the voltage level)
}
if (currentLine.endsWith("GET /d")) {
Serial.println(" command received to deep-sleep ESP32 (disconnect from Enterprise). Repower to reconnect");
esp_deep_sleep_start();
}
}
}
client.stop();
Serial.println("Client disconnected");
}
}
PPS: der Befehl aa080ac8ff fehlte noch. Er entspricht "Warpanrieb einschalten".
...
. Ab und an gibt es die Enterprise für 199 € im Angebot...
Kommentar