h0l0gram / omega2-checkHumidity

Read temperature and humidity from dht11 and dht22 over gpio of omega2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Read temperature and humidity from dht11 and dht22 over gpio of omega2


Languages

Language:C++ 78.3%Language:C 16.0%Language:Makefile 5.7%