Skip to content
Read temperature and humidity from dht11 and dht22 over gpio of omega2
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
include
src
README.md
makefile

README.md

omega2-checkHumidity

Adapted code (fastgpio) to get DHT11-DHT22-Sensor-Examples working on Omega2(+).

omega2+ with DHT22

Prerequisites

  • Omega2(+)
  • Compiled binary requires firmware 0.1.10 b160 (you may be able to compile from source for older firmware as well) (See Updating the Omega2 to check or update firmware)

Install

root@Omega-1234:~# mkdir checkHumidity && cd checkHumidity
root@Omega-1234:~/checkHumidity# wget https://github.com/h0l0gram/omega2-checkHumidity/raw/master/bin/checkHumidity
root@Omega-1234:~/checkHumidity# chmod -R 755 checkHumidity

Run

./checkHumidity <GPIO-PIN> <DHT-TYPE>
GPIO-PIN : 0-19
DHT-TYPE : DHT11 or DHT22

Example

root@Omega-1234:~#cd checkHumidity
root@Omega-1234:~/checkHumidity# ./checkHumidity 19 DHT22
48.299999
28.299999

See https://wiki.onion.io/Tutorials/PHP-DHT11-DHT22-Sensor-Examples

Hints/improvements welcome!

Cross compile env used:

docker run -it --name omega2-sdk-app -v /mysource:/remote jlcs/omega2-sdk bash
cd /lede;make

git clone https://github.com/h0l0gram/omega2-checkHumidity.git /mysource

Origin tutorial and source

Links

Credits

You can’t perform that action at this time.