Cleanup only
This commit is contained in:
@@ -143,7 +143,7 @@ MyVictronCallback callback;
|
|||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
delay(2000);
|
delay(1000);
|
||||||
|
|
||||||
Serial.println("\n\n=================================");
|
Serial.println("\n\n=================================");
|
||||||
Serial.println("VictronBLE Multi-Device Example");
|
Serial.println("VictronBLE Multi-Device Example");
|
||||||
@@ -155,14 +155,12 @@ void setup() {
|
|||||||
Serial.println(victron.getLastError());
|
Serial.println(victron.getLastError());
|
||||||
while (1) delay(1000);
|
while (1) delay(1000);
|
||||||
}
|
}
|
||||||
delay(1000);
|
|
||||||
|
|
||||||
// Enable debug output (optional)
|
// Enable debug output (optional)
|
||||||
victron.setDebug(true);
|
victron.setDebug(true);
|
||||||
|
|
||||||
// Set callback for data updates
|
// Set callback for data updates
|
||||||
victron.setCallback(&callback);
|
victron.setCallback(&callback);
|
||||||
delay(1000);
|
|
||||||
|
|
||||||
// Add your devices here
|
// Add your devices here
|
||||||
// Replace with your actual MAC addresses and encryption keys
|
// Replace with your actual MAC addresses and encryption keys
|
||||||
@@ -189,7 +187,6 @@ void setup() {
|
|||||||
"0ec3adf7433dd61793ff2f3b8ad32ed8", // Encryption key (32 hex chars)
|
"0ec3adf7433dd61793ff2f3b8ad32ed8", // Encryption key (32 hex chars)
|
||||||
DEVICE_TYPE_SOLAR_CHARGER // Device type
|
DEVICE_TYPE_SOLAR_CHARGER // Device type
|
||||||
);
|
);
|
||||||
delay(1000);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
@@ -209,41 +206,47 @@ void setup() {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Example: Solar Charger #1
|
// Example: Solar Charger #1
|
||||||
|
/*
|
||||||
victron.addDevice(
|
victron.addDevice(
|
||||||
"MPPT 100/30", // Device name
|
"MPPT 100/30", // Device name
|
||||||
"E7:48:D4:28:B7:9C", // MAC address
|
"E7:48:D4:28:B7:9C", // MAC address
|
||||||
"0df4d0395b7d1a876c0c33ecb9e70dcd", // Encryption key (32 hex chars)
|
"0df4d0395b7d1a876c0c33ecb9e70dcd", // Encryption key (32 hex chars)
|
||||||
DEVICE_TYPE_SOLAR_CHARGER // Device type
|
DEVICE_TYPE_SOLAR_CHARGER // Device type
|
||||||
);
|
);
|
||||||
|
*/
|
||||||
|
|
||||||
// Example: Solar Charger #2
|
// Example: Solar Charger #2
|
||||||
|
/*
|
||||||
victron.addDevice(
|
victron.addDevice(
|
||||||
"MPPT 75/15",
|
"MPPT 75/15",
|
||||||
"AA:BB:CC:DD:EE:FF",
|
"AA:BB:CC:DD:EE:FF",
|
||||||
"1234567890abcdef1234567890abcdef",
|
"1234567890abcdef1234567890abcdef",
|
||||||
DEVICE_TYPE_SOLAR_CHARGER
|
DEVICE_TYPE_SOLAR_CHARGER
|
||||||
);
|
);
|
||||||
|
*/
|
||||||
|
|
||||||
// Example: Battery Monitor (SmartShunt)
|
// Example: Battery Monitor (SmartShunt)
|
||||||
|
/*
|
||||||
victron.addDevice(
|
victron.addDevice(
|
||||||
"SmartShunt",
|
"SmartShunt",
|
||||||
"11:22:33:44:55:66",
|
"11:22:33:44:55:66",
|
||||||
"fedcba0987654321fedcba0987654321",
|
"fedcba0987654321fedcba0987654321",
|
||||||
DEVICE_TYPE_BATTERY_MONITOR
|
DEVICE_TYPE_BATTERY_MONITOR
|
||||||
);
|
);
|
||||||
|
*/
|
||||||
|
|
||||||
// Example: Inverter/Charger
|
// Example: Inverter/Charger
|
||||||
|
/*
|
||||||
victron.addDevice(
|
victron.addDevice(
|
||||||
"MultiPlus",
|
"MultiPlus",
|
||||||
"99:88:77:66:55:44",
|
"99:88:77:66:55:44",
|
||||||
"abcdefabcdefabcdefabcdefabcdefab",
|
"abcdefabcdefabcdefabcdefabcdefab",
|
||||||
DEVICE_TYPE_INVERTER
|
DEVICE_TYPE_INVERTER
|
||||||
);
|
);
|
||||||
|
*/
|
||||||
|
|
||||||
delay(1000);
|
|
||||||
Serial.println("Configured " + String(victron.getDeviceCount()) + " devices");
|
Serial.println("Configured " + String(victron.getDeviceCount()) + " devices");
|
||||||
Serial.println("\nStarting BLE scan...\n");
|
Serial.println("\nStarting BLE scan...\n");
|
||||||
delay(1000);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
|
|||||||
@@ -698,6 +698,7 @@ void VictronBLE::debugPrint(const String& message) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// XXX Can't we use debugPrintf instead for hex struct etc?
|
||||||
void VictronBLE::debugPrintHex(const char* label, const uint8_t* data, size_t len) {
|
void VictronBLE::debugPrintHex(const char* label, const uint8_t* data, size_t len) {
|
||||||
if (!debugEnabled) return;
|
if (!debugEnabled) return;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user