Repository navigation
Add Heltec_v2_sensor env and environment sensors for Heltec V2 - #3747
Open
Roberto-Gomes wants to merge 1 commit into
Open
Roberto-Gomes wants to merge 1 commit into
Roberto-Gomes wants to merge 1 commit into
Conversation
Use EnvironmentSensorManager and sensor_base on Heltec V2, as heltec_v3 does, so I2C sensors on the OLED bus are detected. GPS is disabled since the board has none. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Hello! You can set -D PIN_GPS_RX=12 -D PIN_GPS_TX=13 for use external GPS module and the build will complete successfully |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Heltec_v2_sensorenv, buildingexamples/simple_sensorfor the Heltec WiFi LoRa 32 V2.Heltec_lora32_v2section now pulls${sensor_base}flags/lib_deps andhelpers/sensors, andtarget.h/.cppuseEnvironmentSensorManagerinstead ofSensorManager, the same wayheltec_v3does.ENV_INCLUDE_GPS=0: the V2 has no GPS, so noMicroNMEALocationProvideris built(same override as
minewsemi_me25ls01andwio_wm1110).Why
The V2 had no sensor env, and its
SensorManageronly reports battery. WithEnvironmentSensorManager, I2C sensors on the OLED bus (SDA=4, SCL=15) areauto-detected, e.g. an AHT25 at 0x38 next to the OLED at 0x3C.
Testing
All Heltec V2 envs build (PlatformIO). Size before (
dev428a95c) and after this change, in bytes:The cost is about 52 KB of flash and 1.8 KB of RAM per env, from the
sensor_basedrivers.The largest env (
companion_radio_ble) uses 44.2% of the 3342336-byte app partition.Hardware test with four Heltec V2 boards, all on the same build: a
Heltec_v2_companion_radio_usbdriven by meshcore-cli, a
Heltec_v2_repeater, and twoHeltec_v2_sensor, each with an AHT25on SDA=4/SCL=15.
With
-D MESH_DEBUG=1, both sensors logFound AHT10/AHT20 at address: 38at boot(AHT25 picked up by the existing
Adafruit_AHTX0driver, no code change).With the normal build, the companion received the sensors' adverts, and after
login,req_telemetryreturned the AHT25 readings on channel 2 next to the battery voltage on channel 1:I used Claude Code to help with this change. I reviewed the diff and ran the tests above on my own boards.