meshtastic / firmware

Meshtastic device firmware
https://meshtastic.org
GNU General Public License v3.0
3k stars 719 forks source link

[Feature Request]: add support for linux iio (Industrial I/O) subsystem for sensors #3857

Open Jorropo opened 1 month ago

Jorropo commented 1 month ago

Platform

Linux Native

Description

Linux iio provide many drivers for different kind of sensors: https://www.kernel.org/doc/html/latest/driver-api/iio/intro.html

  • analog to digital converters (ADCs)
  • accelerometers
  • capacitance to digital converters (CDCs)
  • digital to analog converters (DACs)
  • gyroscopes
  • inertial measurement units (IMUs)
  • color and light sensors
  • magnetometers
  • pressure sensors
  • proximity sensors
  • temperature sensors

It would be nice if sensors that are already supported in meshtastic (pressure, temperature, ...) could fetch data through /sys/bus/iio so any pressure or temperature sensor with a linux driver would be usable in meshtastic.

jp-bennett commented 1 month ago

@Jorropo have a suggested affordable sensor to start with?

Jorropo commented 1 month ago

There a couple sensors supported by mesthastic already would allow to confirm the feature work properly. BMP and BME family are the one that come to my mind. https://github.com/torvalds/linux/blob/master/drivers/iio/pressure/bmp280-spi.c#L120-L141

rexbyrns commented 1 month ago

1-wire is very rich.... I2C to 1-wire bridges are cool..

thebentern commented 1 month ago

As much as I love the Dallas 1-wire sensors and use them a lot in other projects, we removed support for those in Meshtastic in favor of a rich i2c ecosystem of sensors where we have a clearly defined bus and don't have to add yet-another-gpio pin for a user to hunt down in potentially problematic boards. If you can get i2c to 1-wire bridges going, that would be a welcome addition :-)