Lora-net / sx1302_hal

SX1302/SX1303 Hardware Abstraction Layer and Tools (packet forwarder...)
Other
219 stars 272 forks source link

Get successful temperature readings from SHTc3 #50

Closed percz closed 3 years ago

percz commented 3 years ago

The packet forwarder can use a third-party SHTc3 module on the systems I2C in the case of a temperature sensor not being added by OEM or the LoRa module. This partly relates to (admittedly closed) Issue #28 where some hardware manufacturers have developed modules that don't include a now-required temperature module and resolve by allowing end-users to add a readily available device.

This requires adding the line, under _SX130xconf, to _globalconf.json -> "temp_type": "SHT"

It's also becomes possible, though not advised and met with warnings, to use "temp_type": "FAKE" which will always use 30c.

Ideally, some work could be done with loragw_i2c.c so that it can 'read' more than one byte and the duplication of _i2cmsg and ioctl in _loragwsht.c can be removed. The SHTc3 requires reading in 6 bytes in its simplest usage.

percz commented 3 years ago

This PR should be ref'ed -> https://github.com/percz/sx1302_hal/tree/SHTc3