Skip to content

Conversation

@Justin-Mann
Copy link
Contributor

🙏 Thank you for sending in a pull request, here's some tips to get started!

bug ##9410

fixed and tested..

logs (also in bug report)...

... a sensor that is precalibrated
INFO | ??:??:?? 13 Dry calibration value is 505
INFO | ??:??:?? 13 Wet calibration value is 382
...

... a sensor that is not precalibrated
INFO | ??:??:?? 5 Init sensor: RAK12035
INFO | ??:??:?? 5 RAK12035Sensor Init Succeed
Sensor Firmware version: 2, Sensor Name: RAK12035
INFO | ??:??:?? 7 Dry calibration not set, using default: 510
INFO | ??:??:?? 7 Wet calibration not set, using default: 390
INFO | ??:??:?? 7 Consider running the calibration sketch to improve accuracy.You can recalibrate this sensor using the calibration sketch included here: https://github.com/RAK
INFO | ??:??:?? 7 Dry calibration value: 510, Wet calibration value: 390
INFO | ??:??:?? 7 Opened RAK12035 sensor on i2c bus
...

... showing that it is reading after default calibration values set
.. probe out of water snippet
INFO | 19:02:59 89 [EnvironmentTelemetry] Send: barometric_pressure=0.000000, current=0.000000, gas_resistance=0.000000, relative_humidity=0.000000, temperature=0.000000
INFO | 19:02:59 89 [EnvironmentTelemetry] Send: voltage=0.000000, IAQ=0, distance=0.000000, lux=0.000000
INFO | 19:02:59 89 [EnvironmentTelemetry] Send: wind speed=0.000000m/s, direction=0 degrees, weight=0.000000kg
INFO | 19:02:59 89 [EnvironmentTelemetry] Send: radiation=0.000000##R/h
INFO | 19:02:59 89 [EnvironmentTelemetry] Send: soil_temperature=17.700001, soil_moisture=0
..
.. probe in water snippet
INFO | 19:59:12 123 Tell client we have new packets 11
INFO | 19:59:12 123 BLE notify fromNum
DEBUG | 19:59:12 123 FromRadio=STATE_SEND_PACKETS
DEBUG | 19:59:12 123 phone downloaded packet (id=0x175c392b fr=0xf5032f44 to=0xffffffff, transport = 0, WantAck=0, HopLim=6 Ch=0x0 Portnum=67 rxtime=1769198352 priority=10)
INFO | 19:59:44 155 [EnvironmentTelemetry] Send: barometric_pressure=0.000000, current=0.000000, gas_resistance=0.000000, relative_humidity=0.000000, temperature=0.000000
INFO | 19:59:44 155 [EnvironmentTelemetry] Send: voltage=0.000000, IAQ=0, distance=0.000000, lux=0.000000
INFO | 19:59:44 155 [EnvironmentTelemetry] Send: wind speed=0.000000m/s, direction=0 degrees, weight=0.000000kg
INFO | 19:59:44 155 [EnvironmentTelemetry] Send: radiation=0.000000##R/h
INFO | 19:59:44 155 [EnvironmentTelemetry] Send: soil_temperature=17.500000, soil_moisture=64
DEBUG | 19:59:44 155 [EnvironmentTelemetry] Partially randomized packet id 2420827436
INFO | 19:59:44 155 [EnvironmentTelemetry] Send packet to mesh
..
...

(not sure why my sensor is reading temp in Celsius atm.. not too worried about it.)

No GPS fix in this branch, isolated to other branch so no GPS icon in SS.




🤝 Attestations

  • I have tested that my proposed changes behave as described.
  • I have tested that my proposed changes do not cause any obvious regressions on the following devices:
    • Heltec (Lora32) V3
    • LilyGo T-Deck
    • LilyGo T-Beam
    • RAK WisBlock 4631
    • Seeed Studio T-1000E tracker card
    • Other (please specify below)

…er log messaging if either of the default values were used.
…lt calibration is used pointing to the actual calibration sketch so the user can find it and use it to improve accuracy.
@fifieldt fifieldt added the bugfix Pull request that fixes bugs label Jan 24, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug in the RAK12035 soil moisture sensor initialization logic and improves user-facing log messages. The issue addressed is that sensors without pre-calibration values were not being properly initialized with default values.

Changes:

  • Fixed the calibration detection logic to properly handle uncalibrated sensors by checking for zero values and setting appropriate defaults (510 for dry, 390 for wet)
  • Improved log messaging to be clearer and more helpful, including a complete URL to the calibration documentation
  • Added sensor.begin() call and additional delays in the setup sequence to ensure proper sensor initialization

@Justin-Mann
Copy link
Contributor Author

@thebentern

tried push to resolve the weird thing copilot found man.. cannot push..
getting error...
/bin/bash: C:UsersjustiAppDataLocaltrunkreposeaceabc603d153a2893300e9e338031agit-hooks/pre-push: No such file or directory
error: failed to push some refs to 'https://github.com/Justin-Mann/firmware.git'
...

not sure what I'm doing incorrectly, but you can line me out or make the fix or ignore the copilot review completely.. the results will be the same. :)

moral of the story.. the line sensor.begin(dev->address.address) isn't doing what the person that put it there thought it was i don't think. It simple results in sensor.begin(true) which is the same as sensor.begin() as it is the default.

@thebentern thebentern merged commit 334a4f0 into meshtastic:develop Jan 29, 2026
83 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Pull request that fixes bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants