cleanup after a few experiments

This commit is contained in:
Justin E. Mann 2025-05-05 21:08:37 -06:00
parent 58d6f64d1a
commit ad9bc53807

View File

@ -14,20 +14,20 @@ int32_t RAK12035Sensor::runOnce()
{ {
return DEFAULT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS; return DEFAULT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS;
} }
sensor.set_sensor_addr(RAK120351_ADDR);
delay(500);
sensor.begin(nodeTelemetrySensorsMap[sensorType].first);
// TODO:: check for up to 2 additional sensors and start them if present. // TODO:: check for up to 2 additional sensors and start them if present.
sensor.set_sensor_addr(RAK120351_ADDR);
delay(100);
sensor.begin(nodeTelemetrySensorsMap[sensorType].first);
// Get sensor firmware version // Get sensor firmware version
uint8_t data = 0; uint8_t data = 0;
sensor.get_sensor_version(&data); sensor.get_sensor_version(&data);
LOG_INFO("Sensor Firmware version: %i", data); LOG_INFO("Sensor1 Firmware version: %i", data);
if (data != 0) if (data != 0)
{ {
LOG_DEBUG("RAK12035Sensor Init Succeed"); LOG_INFO("RAK12035Sensor Init Succeed");
status = true; status = true;
} }
else else
@ -55,25 +55,25 @@ void RAK12035Sensor::setup()
delay(200); delay(200);
if (zero_val == 0 || zero_val <= hundred_val) if (zero_val == 0 || zero_val <= hundred_val)
{ {
LOG_ERROR("Dry calibration value is %d", zero_val); LOG_INFO("Dry calibration value is %d", zero_val);
LOG_ERROR("Wet calibration value is %d", hundred_val); LOG_INFO("Wet calibration value is %d", hundred_val);
LOG_ERROR("This does not make sense. Youc can recalibrate this sensor using the calibration sketch included here: " LOG_INFO("This does not make sense. You can recalibrate this sensor using the calibration sketch included here: "
"https://github.com/RAKWireless/RAK12035_SoilMoisture."); "https://github.com/RAKWireless/RAK12035_SoilMoisture.");
LOG_ERROR("For now, setting default calibration value for Dry Calibration: %d", default_zero_val); LOG_INFO("For now, setting default calibration value for Dry Calibration: %d", default_zero_val);
sensor.set_dry_cal(default_zero_val); sensor.set_dry_cal(default_zero_val);
sensor.get_dry_cal(&zero_val); sensor.get_dry_cal(&zero_val);
LOG_ERROR("Dry calibration reset complete. New value is %d", zero_val); LOG_INFO("Dry calibration reset complete. New value is %d", zero_val);
} }
if (hundred_val == 0 || hundred_val >= zero_val) if (hundred_val == 0 || hundred_val >= zero_val)
{ {
LOG_ERROR("Dry calibration value is %d", zero_val); LOG_INFO("Dry calibration value is %d", zero_val);
LOG_ERROR("Wet calibration value is %d", hundred_val); LOG_INFO("Wet calibration value is %d", hundred_val);
LOG_ERROR("This does not make sense. Youc can recalibrate this sensor using the calibration sketch included here: " LOG_INFO("This does not make sense. You can recalibrate this sensor using the calibration sketch included here: "
"https://github.com/RAKWireless/RAK12035_SoilMoisture."); "https://github.com/RAKWireless/RAK12035_SoilMoisture.");
LOG_ERROR("For now, setting default calibration value for Wet Calibration: %d", default_hundred_val); LOG_INFO("For now, setting default calibration value for Wet Calibration: %d", default_hundred_val);
sensor.set_wet_cal(default_hundred_val); sensor.set_wet_cal(default_hundred_val);
sensor.get_wet_cal(&hundred_val); sensor.get_wet_cal(&hundred_val);
LOG_ERROR("Wet calibration reset complete. New value is %d", hundred_val); LOG_INFO("Wet calibration reset complete. New value is %d", hundred_val);
} }
sensor.sensor_sleep(); sensor.sensor_sleep();
delay(200); delay(200);