Open paul-matthews opened 6 years ago
It seems the snippet you linked to is missing a call to registerTemperatureSensor()
. For now, please refer to the Activity code in the Bmx280 driver sample, which demonstrates the same use case.
Maybe a duplicate? https://github.com/androidthings/contrib-drivers/issues/102
@plattysoft Not quite a duplicate (at least I don't think so), I think @paul-matthews issue is the code snippet is missing a call to registerTemperatureSensor()
, so the sensor never actually becomes available.
Using the code snippet for Continuously reporting temperature sensor, no ambient temperature sensor is connected. However reading a single temperature value works fine. Is this library registering the driver for the Bmx280 on the board, because the sample doesn't cover it.
Repro steps:
1) Copy code snippet into onCreate. 2) Run activity on a Pi 3 (with working other functions)
Expected:
3) Observe logging of temperature sensor
Actual:
3) Observed logging only includes: "I/SensorManager: DYNS Register dynamic sensor callback"
On further inspection (attempting to use the getDefaultSensor() ) no sensors exist.