Conversation
|
Stelios Mavridis seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
@smavridis, Welcome to Meshtastic!Thanks for opening your first pull request. We really appreciate it. We discuss work as a team in discord, please join us in the #firmware channel. Welcome to the team 😄 |
f81d8d3 to
9e1e5a7
Compare
|
Hey! Thanks for the patch :) For adding the sensor type, a patch needs to be made to the meshtastic/protobufs repo. If you can't find it let us know! |
Thanks for the heads-up, i added the VL53L0 enum in TelemetrySensorType. |
67a73de to
c7fcb1b
Compare
|
That should be all that's required, thanks! |
|
Thank you @fifieldt and @caveman99 for your help and guidance. |
| type = TSL2561; | ||
| logFoundDevice("TSL2561", (uint8_t)addr.address); | ||
| switch (registerValue) { | ||
| case 0x00 ... 0x04: |
There was a problem hiding this comment.
getRegisterValue() defaults to 0x00 when no bytes are read, so bus/read failures can be misdetected as VL53L0X.
There was a problem hiding this comment.
Did not thinkof that and was testing with the sensor so wasnt checking that scenario, will fix.
| VL53L0X_RangingMeasurementData_t measure; | ||
| vl53l0x.rangingTest(&measure, false); | ||
|
|
||
| measurement->variant.environment_metrics.has_distance = true; |
There was a problem hiding this comment.
measure.RangeStatus should be checked for out-of-range/error readings before deciding that the result is valid
There was a problem hiding this comment.
Good idea, i didn't know it had such Status.
|
I addressed the issues by @robekl (thanks), detection of sensors and ranging should be more robust. |
| } | ||
| break; | ||
| case TSL25911_ADDR: | ||
| registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0xA0 | 0x12), 1); |
There was a problem hiding this comment.
Out of curiosity the bitwise OR of the register addresses always seemed wierd to me.
Doesn't that mean that the old code was reading register 0xB2 rather than 0xA0 and/or 0x12.
Am i missing some weird overload or c++ magic?
|
I converted this to a draft, since i decided to extend it a bit more. |
|
I have added the State message and serialization/de-serialization logic. I think i am still missing some sort of registration so that the application knows that a configuration/option exists for the sensor but i cant really understand where/how that is done. I did see a handleAdminMessage() function which i guess is relevant but i still think i am missing something. |
|
So i tried to figure out how to add/modify the android application to add a configuration menu for the sensor ... unfortunately it is way above my skill level of Android/kotlin, etc ... i might try to touch it again at a latter time or hopefully some good soul does it instead. Failing that i switched to providing a menu option in the firmware. At this point i wanted to get some feedback from you @fifieldt @robekl on the approach and any suggestions or ideas you might have. I will try tomorrow to see how to call access the VL53L0X object to get/set state and configuration, so ill get back to you. Thank you for your time. |
c50b042 to
0965bbe
Compare
|
The settings changes for your sensor need to be wired in the AdminModule and with additional functions in your sensor code, to process the changes. For testing this, it's best to use the python CLI client, since the protobufs can be updated there without too much hassle. Android App would be the next step. |
|
Thanks for the feedback @caveman99. |
Added new Environment Telemetry class VL53L0XSensor. Tested with a Heltec V3.
Need to: - See if this is acceptable, or there is a better way.
…sor mode using menu.
Added new Environment Telemetry class VL53L0XSensor. Tested with a Heltec V3.
I have deployed it with a Heltec V3, currently my only meshtastic/lora device.
Expecting RAK and Xiao boards to ensure no issues, but delayed due to Chinese New Year.
This is my first contribution, i read the contribution guide and signed the CLA, let me know if i have missed anything.
Thank you for the Meshtastic project.
🤝 Attestations