-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add rak12035 VB Soil Monitor Tested & Working #6741
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Introduce the RAK12035 sensor as an environmental telemetry sensor, including necessary calibration checks and default values. Update relevant files to integrate the sensor into the existing telemetry system. This hardware is not just one module, but a couple.. RAK12023 and RAK12035 is the component stack, the RAK12023 does not seem to matter much and allows for multiple RAK12035 devices to be used. Co-Authored-By: @Justin-Mann
Introduce the RAK12035 sensor as an environmental telemetry sensor, including necessary calibration checks and default values. Update relevant files to integrate the sensor into the existing telemetry system. This hardware is not just one module, but a couple.. RAK12023 and RAK12035 is the component stack, the RAK12023 does not seem to matter much and allows for multiple RAK12035 devices to be used. Co-Authored-By: @Justin-Mann
Introduce the RAK12035 sensor as an environmental telemetry sensor, including necessary calibration checks and default values. Update relevant files to integrate the sensor into the existing telemetry system. This hardware is not just one module, but a couple.. RAK12023 and RAK12035 is the component stack, the RAK12023 does not seem to matter much and allows for multiple RAK12035 devices to be used. Co-Authored-By: @Justin-Mann
Introduce the RAK12035 sensor as an environmental telemetry sensor, including necessary calibration checks and default values. Update relevant files to integrate the sensor into the existing telemetry system. This hardware is not just one module, but a couple.. RAK12023 and RAK12035 is the component stack, the RAK12023 does not seem to matter much and allows for multiple RAK12035 devices to be used. Co-Authored-By: @Justin-Mann
…K: RAK19007/RAK4631/RAK12035VB/RAK12500 looks like soil monitor is working correctly, new environmental metrics are comming thru [new protos soil_moisture, soil_temperature] and GPS is working again with the RAK 12500. improvements could be made around the configuration of the monitor. next steps include updating the client(s) to react to, log and display the new proto metrics for soil temp and humidity.
…n/firmware into AddRAK12035VB_4.19.25
I am doing things and stuff.. hopefully i didn't undo a thing u did man. I'll keep working on the project and get a better understanding of how to update the proto stuff appropriately. I'm used to doing nuget things for all my dependencies... |
@thebentern @fifieldt ty for all your help, sorry is a pita. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some nitpicking about, nothing serious. see above.
Tom things.. I had them hard defined in the applicable variants.
…On Wed, May 28, 2025, 3:35 PM Thomas Göttgens ***@***.***> wrote:
***@***.**** requested changes on this pull request.
some nitpicking about, nothing serious. see above.
------------------------------
In src/modules/Telemetry/Sensor/RAK12035Sensor.cpp
<#6741 (comment)>:
> + // -- how to do this.. this could get a little complex..
+ // ie - 1> we combine them into an average and send that, 2> we send them as separate metrics
+ // ^-- these scenarios would require different handling of the metrics in the receiving end and maybe a setting in the
+ // device ui and an additional proto for that?
+ measurement->variant.environment_metrics.has_soil_temperature = true;
+ measurement->variant.environment_metrics.has_soil_moisture = true;
+
+ uint8_t moisture = 0;
+ uint16_t temp = 0;
+ bool success = false;
+
+ sensor.sensor_on();
+ delay(200);
+ success = sensor.get_sensor_moisture(&moisture);
+ delay(200);
+ success = sensor.get_sensor_temperature(&temp);
you need to AND this. success is only if both values are read successfully.
------------------------------
In src/modules/Telemetry/Sensor/RAK12035Sensor.cpp
<#6741 (comment)>:
> +
+void RAK12035Sensor::setup()
+{
+ // Set the calibration values
+ // Reading the saved calibration values from the sensor.
+ // TODO:: Check for and run calibration check for up to 2 additional sensors if present.
+ uint16_t zero_val = 0;
+ uint16_t hundred_val = 0;
+ uint16_t default_zero_val = 550;
+ uint16_t default_hundred_val = 420;
+ sensor.sensor_on();
+ delay(200);
+ sensor.get_dry_cal(&zero_val);
+ sensor.get_wet_cal(&hundred_val);
+ delay(200);
+ if (zero_val == 0 || zero_val <= hundred_val) {
Can we deduplicate this block and make the wording a little bit more
dense? e.g. output the values only once after the conditional and just set
flags there for detemining what to actually output.
------------------------------
In variants/rak4631/variant.h
<#6741 (comment)>:
> @@ -90,6 +90,8 @@ static const uint8_t A7 = PIN_A7;
// Other pins
#define PIN_AREF (2)
#define PIN_NFC1 (9)
+#define WB_IO5 PIN_NFC1
i honestly thought these were defined in the toolchain already.
—
Reply to this email directly, view it on GitHub
<#6741 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACAFYBUZMSAS54IY3GQYM3T3AYT2FAVCNFSM6AAAAAB4PKAC4CVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDQNZWGQ4TGOJQGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
sry, I fix... ... |
There was a problem hiding this 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 integrates the RAK12035 soil moisture/temperature sensor into the existing telemetry framework, wiring it through I²C, telemetry routines, and build configs.
- Add RAK12035Sensor class with setup, runOnce, and metrics collection
- Extend I²C scanning, main setup, and telemetry loop to handle RAK12035 devices
- Update variant headers and PlatformIO manifests to expose the new sensor library and pins
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
variants/*/variant.h | Define WB_IO4/5 and WB_IO2 for all RAK4631-based variants |
variants/*/platformio.ini | Add beegee-tokyo/RAK12035_SoilMoisture@^1.0.4 dependency |
src/modules/Telemetry/Sensor/RAK12035Sensor.* | New sensor class header + implementation |
src/modules/Telemetry/EnvironmentTelemetry.cpp | Register and invoke the new sensor in telemetry loops |
src/main.cpp | Map ScanI2C DeviceType::RAK12035 to telemetry sensor |
src/detect/ScanI2C.{cpp,h} | Add RAK12035 to I²C scan cases and enum |
src/configuration.h | Define default I²C addresses for up to three RAK12035 |
Comments suppressed due to low confidence (1)
src/modules/Telemetry/Sensor/RAK12035Sensor.cpp:1
- [nitpick] The new
RAK12035Sensor
integration contains non-trivial initialization and measurement logic but has no accompanying unit or integration tests. Consider adding tests for setup, calibration fallback, and successful/failed reads.
#include "configuration.h"
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
@Justin-Mann we good to go now? |
@thebentern im in the woods again, but I think so.. saw u made a few chages.. saw and looked at a few copilot suggestions.. the ones I saw were nothing burgers, but didn't see them all. Will look things over when I get back to town, but last build I tested on my device and it looked fine. |
pulled most recent branch ~8 am 5/30... build/deploy on RAK
...
|
Seems like there is an issue with the GPS and the RAK12035.. They both seem to work, but the GPS is very hit and miss.. So.. what I think is going on.. I think if there is a pin conflict then this is making it impossible for the RAK to update it's position moving forward.. I will experiment more and verify what I can around this behavior. I think there might be a pin conflict? |
@thebentern .. Can confirm 2 issues... RAK12023/12035 - IO SLOT, RAK12500 - SLOT A RAK12023/12035 - IO SLOT, RAK12500 - SLOT D |
Introduce the RAK12035 sensor as an environmental telemetry sensor, including necessary calibration checks and default values. Update relevant files to integrate the sensor into the existing telemetry system.
star of the show... https://docs.rakwireless.com/product-categories/wisblock/rak12035/quickstart/
This hardware is not just one module, but a couple.. RAK12023 and RAK12035 is the component stack, the RAK12023 does not seem to matter much and allows for multiple RAK12035 devices to be used.
Co-Authored-By: @fifieldt
This has been uploaded and tested on a RAK WIS Block hardware stack.
RAK19007 WIS Block Base Board
w/
RAK4631 WIS Block Module
RAK12500 GPS WIS Block Module
RAK12035 VB SOIL Monitor WIS Block Module
w/
solar panel
battery
Improvements could be made around the calibration of the RAK12035 devices.. I currently have it checking to see if the device has been pre-calibrated (this is highly recommended) and if not I am simply using some 'reasonable' values. the pre-calibration can be done by following the instructions and using the sketch supplied here [https://github.com/RAKWireless/RAK12035_SoilMoisture?tab=readme-ov-file#usage].
My build is currently in a waterproof case WISBLOCK Unify Enclosure and is use as part of an irrigation monitoring network we use to know when it is time to make certain adjustments to our physical irrigation resources. Pretty simple. Wanted to use WISBLOCK stuff, wanted to use Meshtastic, built using resilient enclosures and kept the code pretty simple.. Wanted the GPS for recovery purposes.. Got lots of help from @fifieldt. Things work well now. I have not finalized yet so no URL, but you can check on Instructables.com to find more detailed info about this build running in the wild (will post soon).
🤝 Attestations