Page MenuHomeFreeBSD

Add driver for temperature/humidity sensor DHT11 to expose data via sysctl
ClosedPublic

Authored by mizhka on Jan 14 2017, 10:27 PM.

Details

Summary

Hi,

This patch adds driver for temperature/humidity sensor connected via GPIO. It called gpioths. Just add "device gpioths" into kernel and hints like:

# Temp/Humidity sensors
hint.gpioths.0.at="gpiobus0"
hint.gpioths.0.pins=1

As results it will provide temperature/humidity values via sysctl:

dev.gpioths.0.temperature: 28
dev.gpioths.0.humidity: 31

DHT11 is cheap & popular temperature/humidity sensor and there is significant amount of blog posts how to meet freebsd & DHT11 (last dated by today, Jan14). It's really worth to bring support into tree. DHT11 is single-wire sensor. It can be connected via GPIO to device like Raspberry Pi or Onion Omega.

Missing bits:

  • man page
Test Plan

Tested on Onion Omega & DHT11

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mizhka retitled this revision from to Add driver for temperature/humidity sensor DHT11 to expose data via sysctl.Jan 14 2017, 10:27 PM
mizhka updated this object.
mizhka edited the test plan for this revision. (Show Details)
mizhka added reviewers: adrian, loos.
mizhka set the repository for this revision to rS FreeBSD src repository.
mizhka updated this revision to Diff 24007.
adrian edited edge metadata.Jan 15 2017, 8:51 PM
adrian accepted this revision.
This revision is now accepted and ready to land.Jan 15 2017, 8:51 PM
This revision was automatically updated to reflect the committed changes.