use Serial.print for important info like wifi stuff

.. and for other important info.
Will be muted automatically in case that serial is in used for other purposes.
This commit is contained in:
Frank
2022-12-04 17:52:10 +01:00
parent 1a9a1cbbbe
commit 676cc26171
10 changed files with 93 additions and 41 deletions

View File

@@ -164,7 +164,7 @@ class UsermodTemperature : public Usermod {
temperature = -127.0f; // default to -127, DS18B20 only goes down to -50C
if (enabled) {
// config says we are enabled
DEBUG_PRINTLN(F("Allocating temperature pin..."));
USER_PRINTLN(F("Finding temperature pin..."));
// pin retrieved from cfg.json (readFromConfig()) prior to running setup()
if (temperaturePin >= 0 && pinManager.allocatePin(temperaturePin, true, PinOwner::UM_Temperature)) {
oneWire = new OneWire(temperaturePin);
@@ -175,13 +175,14 @@ class UsermodTemperature : public Usermod {
}
} else {
if (temperaturePin >= 0) {
DEBUG_PRINTLN(F("Temperature pin allocation failed."));
USER_PRINTLN(F("Temperature pin allocation failed."));
}
temperaturePin = -1; // allocation failed
}
}
lastMeasurement = millis() - readingInterval + 10000;
initDone = true;
USER_PRINTLN(F("temperature usermod initialized."));
}
void loop() {

View File

@@ -1302,9 +1302,11 @@ class AudioReactive : public Usermod {
#ifdef WLED_DEBUG
DEBUG_PRINTLN(F("AR: Failed to initialize sound input driver. Please check input PIN settings."));
#else
ERRORSR_PRINTLN(F("AR: Failed to initialize sound input driver. Please check input PIN settings."));
USER_PRINTLN(F("AR: Failed to initialize sound input driver. Please check input PIN settings."));
#endif
disableSoundProcessing = true;
} else {
USER_PRINTLN(F("AR: sound input driver initialized successfully."));
}
if (enabled) connectUDPSoundSync();

View File

@@ -177,9 +177,9 @@ class FourLineDisplayUsermod : public Usermod {
isHW = (ioPin[0]==i2c_scl && ioPin[1]==i2c_sda);
//isHW = true;
if (isHW) po = PinOwner::HW_I2C; // allow multiple allocations of HW I2C bus pins
if (ioPin[0] < 0 || ioPin[1] < 0) { type=NONE; return; } //WLEDMM bugfix - ensure that "final" GPIO are valid
if (ioPin[0] < 0 || ioPin[1] < 0) { type=NONE; enabled = false; return; } //WLEDMM bugfix - ensure that "final" GPIO are valid
PinManagerPinType pins[2] = { { ioPin[0], true }, { ioPin[1], true } };
if (!pinManager.allocateMultiplePins(pins, 2, po)) { type=NONE; return; }
if (!pinManager.allocateMultiplePins(pins, 2, po)) { type=NONE; enabled = false; return; }
}
DEBUG_PRINTLN(F("Allocating display."));
@@ -224,14 +224,14 @@ class FourLineDisplayUsermod : public Usermod {
}
if (nullptr == u8x8) {
DEBUG_PRINTLN(F("Display init failed."));
USER_PRINTLN(F("Display init failed."));
pinManager.deallocateMultiplePins((const uint8_t*)ioPin, (type == SSD1306_SPI || type == SSD1306_SPI64) ? 5 : 2, po);
type = NONE;
return;
}
initDone = true;
DEBUG_PRINTLN(F("Starting display."));
USER_PRINTLN(F("Starting display."));
/*if (!(type == SSD1306_SPI || type == SSD1306_SPI64))*/ u8x8->setBusClock(ioFrequency); // can be used for SPI too
u8x8->begin();
setFlipMode(flip);

View File

@@ -339,8 +339,8 @@ class FourLineDisplayUsermod : public Usermod {
// isHW = true;
if (isHW) po = PinOwner::HW_I2C; // allow multiple allocations of HW I2C bus pins
PinManagerPinType pins[2] = { {ioPin[0], true }, { ioPin[1], true } };
if (ioPin[0] < 0 || ioPin[1] < 0) { type=NONE; return; } //WLEDMM bugfix - ensure that "final" GPIO are valid
if (!pinManager.allocateMultiplePins(pins, 2, po)) { type=NONE; return; }
if (ioPin[0] < 0 || ioPin[1] < 0) { type=NONE; enabled=false; return; } //WLEDMM bugfix - ensure that "final" GPIO are valid
if (!pinManager.allocateMultiplePins(pins, 2, po)) { type=NONE; enabled=false; return; }
}
DEBUG_PRINTLN(F("Allocating display."));
@@ -418,14 +418,14 @@ class FourLineDisplayUsermod : public Usermod {
}
if (nullptr == u8x8) {
DEBUG_PRINTLN(F("Display init failed."));
USER_PRINTLN(F("Display init failed."));
pinManager.deallocateMultiplePins((const uint8_t*)ioPin, isSPI ? 5 : 2, po);
type = NONE;
return;
}
lineHeight = u8x8->getRows() > 4 ? 2 : 1;
DEBUG_PRINTLN(F("Starting display."));
USER_PRINTLN(F("Starting display."));
u8x8->setBusClock(ioFrequency); // can be used for SPI too
u8x8->begin();
setFlipMode(flip);