Minor logging changes
This commit is contained in:
@@ -59,7 +59,7 @@ bool PMSA003ISensor::getMetrics(meshtastic_Telemetry *measurement)
|
||||
}
|
||||
|
||||
#ifdef PMSA003I_I2C_CLOCK_SPEED
|
||||
LOG_INFO("%s: attempting to reclock speed to %uHz", sensorName, PMSA003I_I2C_CLOCK_SPEED);
|
||||
LOG_DEBUG("%s: attempting to reclock speed to %uHz", sensorName, PMSA003I_I2C_CLOCK_SPEED);
|
||||
reClockI2C.setClock(PMSA003I_I2C_CLOCK_SPEED);
|
||||
#endif /* PMSA003I_I2C_CLOCK_SPEED */
|
||||
|
||||
@@ -67,7 +67,7 @@ bool PMSA003ISensor::getMetrics(meshtastic_Telemetry *measurement)
|
||||
if (_bus->available() < PMSA003I_FRAME_LENGTH) {
|
||||
LOG_WARN("%s: read failed: incomplete data (%d bytes)", sensorName, _bus->available());
|
||||
#ifdef PMSA003I_I2C_CLOCK_SPEED
|
||||
LOG_INFO("%s: restoring clock speed", sensorName);
|
||||
LOG_DEBUG("%s: restoring clock speed", sensorName);
|
||||
reClockI2C.restoreClock();
|
||||
#endif /* PMSA003I_I2C_CLOCK_SPEED */
|
||||
return false;
|
||||
@@ -78,7 +78,7 @@ bool PMSA003ISensor::getMetrics(meshtastic_Telemetry *measurement)
|
||||
}
|
||||
|
||||
#ifdef PMSA003I_I2C_CLOCK_SPEED
|
||||
LOG_INFO("%s: restoring clock speed", sensorName);
|
||||
LOG_DEBUG("%s: restoring clock speed", sensorName);
|
||||
reClockI2C.restoreClock();
|
||||
#endif /* PMSA003I_I2C_CLOCK_SPEED */
|
||||
|
||||
|
||||
@@ -59,22 +59,21 @@ bool SCD30Sensor::getMetrics(meshtastic_Telemetry *measurement)
|
||||
float co2, temperature, humidity;
|
||||
|
||||
#ifdef SCD30_I2C_CLOCK_SPEED
|
||||
LOG_INFO("%s: attempting to reclock speed to %uHz", sensorName, SCD30_I2C_CLOCK_SPEED);
|
||||
LOG_DEBUG("%s: attempting to reclock speed to %uHz", sensorName, SCD30_I2C_CLOCK_SPEED);
|
||||
reClockI2C.setClock(SCD30_I2C_CLOCK_SPEED);
|
||||
#endif /* SCD30_I2C_CLOCK_SPEED */
|
||||
|
||||
if (scd30.readMeasurementData(co2, temperature, humidity) != SCD30_NO_ERROR) {
|
||||
LOG_ERROR("%s: Failed to read measurement data", sensorName);
|
||||
#ifdef SCD30_I2C_CLOCK_SPEED
|
||||
LOG_INFO("%s: restoring clock speed", sensorName);
|
||||
LOG_DEBUG("%s: restoring clock speed", sensorName);
|
||||
reClockI2C.restoreClock();
|
||||
#endif /* SCD30_I2C_CLOCK_SPEED */
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef SCD30_I2C_CLOCK_SPEED
|
||||
LOG_INFO("%s: restoring clock speed", sensorName);
|
||||
LOG_DEBUG("%s: restoring clock speed", sensorName);
|
||||
reClockI2C.restoreClock();
|
||||
#endif /* SCD30_I2C_CLOCK_SPEED */
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ bool SCD4XSensor::getMetrics(meshtastic_Telemetry *measurement)
|
||||
float temperature, humidity;
|
||||
|
||||
#ifdef SCD4X_I2C_CLOCK_SPEED
|
||||
LOG_INFO("%s: attempting to reclock speed to %uHz", sensorName, SCD4X_I2C_CLOCK_SPEED);
|
||||
LOG_DEBUG("%s: attempting to reclock speed to %uHz", sensorName, SCD4X_I2C_CLOCK_SPEED);
|
||||
reClockI2C.setClock(SCD4X_I2C_CLOCK_SPEED);
|
||||
#endif /* SCD4X_I2C_CLOCK_SPEED */
|
||||
|
||||
@@ -108,7 +108,7 @@ bool SCD4XSensor::getMetrics(meshtastic_Telemetry *measurement)
|
||||
error = scd4x.getDataReadyStatus(dataReady);
|
||||
if (error != SCD4X_NO_ERROR || !dataReady) {
|
||||
#ifdef SCD4X_I2C_CLOCK_SPEED
|
||||
LOG_INFO("%s: restoring clock speed", sensorName);
|
||||
LOG_DEBUG("%s: restoring clock speed", sensorName);
|
||||
reClockI2C.restoreClock();
|
||||
#endif /* SCD4X_I2C_CLOCK_SPEED */
|
||||
LOG_ERROR("SCD4X: Data is not ready");
|
||||
@@ -118,7 +118,7 @@ bool SCD4XSensor::getMetrics(meshtastic_Telemetry *measurement)
|
||||
error = scd4x.readMeasurement(co2, temperature, humidity);
|
||||
|
||||
#ifdef SCD4X_I2C_CLOCK_SPEED
|
||||
LOG_INFO("%s: restoring clock speed", sensorName);
|
||||
LOG_DEBUG("%s: restoring clock speed", sensorName);
|
||||
reClockI2C.restoreClock();
|
||||
#endif /* SCD4X_I2C_CLOCK_SPEED */
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@ bool SEN5XSensor::sendCommand(uint16_t command, uint8_t *buffer, uint8_t byteNum
|
||||
#endif /* SEN5X_I2C_CLOCK_SPEED */
|
||||
|
||||
if (writtenBytes != bufferSize) {
|
||||
LOG_ERROR("%s: Error writting on I2C bus", sensorName);
|
||||
LOG_ERROR("%s: Error writing on I2C bus", sensorName);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -573,7 +573,7 @@ bool SEN5XSensor::initDevice(TwoWire *bus, ScanI2C::FoundDevice *dev)
|
||||
delay(50); // without this there is an error on the deviceReset function
|
||||
|
||||
if (!sendCommand(SEN5X_RESET)) {
|
||||
LOG_ERROR("%s: error reseting device", sensorName);
|
||||
LOG_ERROR("%s: error resetting device", sensorName);
|
||||
return false;
|
||||
}
|
||||
delay(200); // From Sensirion Datasheet
|
||||
|
||||
@@ -154,21 +154,21 @@ bool SFA30Sensor::getMetrics(meshtastic_Telemetry *measurement)
|
||||
float temperature = 0.0;
|
||||
|
||||
#ifdef SFA30_I2C_CLOCK_SPEED
|
||||
LOG_INFO("%s attempting to reclock speed to %uHz", sensorName, SFA30_I2C_CLOCK_SPEED);
|
||||
LOG_DEBUG("%s attempting to reclock speed to %uHz", sensorName, SFA30_I2C_CLOCK_SPEED);
|
||||
reClockI2C.setClock(SFA30_I2C_CLOCK_SPEED);
|
||||
#endif /* SFA30_I2C_CLOCK_SPEED */
|
||||
|
||||
if (this->isError(sfa30.readMeasuredValues(hcho, humidity, temperature))) {
|
||||
LOG_WARN("%s: No values", sensorName);
|
||||
#ifdef SFA30_I2C_CLOCK_SPEED
|
||||
LOG_INFO("%s restoring clock speed", sensorName);
|
||||
LOG_DEBUG("%s restoring clock speed", sensorName);
|
||||
reClockI2C.restoreClock();
|
||||
#endif /* SFA30_I2C_CLOCK_SPEED */
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef SFA30_I2C_CLOCK_SPEED
|
||||
LOG_INFO("%s restoring clock speed", sensorName);
|
||||
LOG_DEBUG("%s restoring clock speed", sensorName);
|
||||
reClockI2C.restoreClock();
|
||||
#endif /* SFA30_I2C_CLOCK_SPEED */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user