diff --git a/examples/MultiDevice/platformio.ini b/examples/MultiDevice/platformio.ini index 48a6b43..7ecb960 100644 --- a/examples/MultiDevice/platformio.ini +++ b/examples/MultiDevice/platformio.ini @@ -51,9 +51,9 @@ monitor_filters = esp32_exception_decoder build_flags = -Os lib_deps = - M5StickC + M5StickC elapsedMillis TaskScheduler Button2 ArduinoJson - https://github.com/scottp/PsychicHttp.git + https://github.com/scottp/PsychicHttp.git diff --git a/examples/MultiDevice/src/main.cpp b/examples/MultiDevice/src/main.cpp index 4bcbb91..3e2fd0c 100644 --- a/examples/MultiDevice/src/main.cpp +++ b/examples/MultiDevice/src/main.cpp @@ -173,6 +173,38 @@ void setup() { DEVICE_TYPE_SOLAR_CHARGER // Device type ); + victron.addDevice( + "Rainbow48Vb", // Device name + "3ffd00b83ffd00be", + "0ec3adf7433dd61793ff2f3b8ad32ed8", // Encryption key (32 hex chars) + DEVICE_TYPE_SOLAR_CHARGER // Device type + ); + + // WHY this one work? + victron.addDevice( + "Rainbow48Vc", // Device name + "3ffd00a83ffd00ae", + "0ec3adf7433dd61793ff2f3b8ad32ed8", // Encryption key (32 hex chars) + DEVICE_TYPE_SOLAR_CHARGER // Device type + ); + + /* + * + [VictronBLE] Encrypted data: A0 01 83 2C 0E CF D6 04 89 72 6E 81 56 E4 2D F1 83 + [VictronBLE] IV: 02 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + [VictronBLE] Decrypted data: E1 1C 99 32 D5 7E 81 A3 EB 8C 25 97 3E 0E DD 2D C4 + [VictronBLE] Unknown device type: 0x10 + [VictronBLE] BLE Device: 3ffd0148:3ffd014e, RSSI: -27 dBm + [VictronBLE] BLE Device: 3ffd0148:3ffd014e, RSSI: -81 dBm, Mfg ID: 0x2e1 (Victron) + [VictronBLE] Processing data from: Rainbow48Vc + [VictronBLE] Encrypted data: A0 01 83 2C 0E CF D6 04 89 72 6E 81 56 E4 2D F1 83 + [VictronBLE] IV: 02 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + [VictronBLE] Decrypted data: E1 1C 99 32 D5 7E 81 A3 EB 8C 25 97 3E 0E DD 2D C4 + [VictronBLE] Unknown device type: 0x10 + [VictronBLE] BLE Device: 3ffd0148:3ffd014e, RSSI: -49 dBm, Mfg ID: 0x75 + [VictronBLE] BLE Device: 3ffd0148:3ffd014e, RSSI: -26 dBm + */ + // Example: Solar Charger #1 victron.addDevice( "MPPT 100/30", // Device name diff --git a/src/VictronBLE.cpp b/src/VictronBLE.cpp index 0673dfd..376b719 100644 --- a/src/VictronBLE.cpp +++ b/src/VictronBLE.cpp @@ -177,7 +177,7 @@ void VictronBLE::processDevice(BLEAdvertisedDevice advertisedDevice) { if (mfgData.length() >= 2) { uint16_t mfgId = (uint8_t)mfgData[1] << 8 | (uint8_t)mfgData[0]; if (mfgId == VICTRON_MANUFACTURER_ID) { - debugPrint("Found unmonitored Victron Device: " + mac); + debugPrint("Found unmonitored Victron Device: " + normalizeMAC(mac)); // DeviceInfo* deviceInfo = new DeviceInfo(mac, advertisedDevice.getName()); // devices.insert({normalizedMAC, deviceInfo}); // XXX What type of Victron device is it?