项目作者: catchhariharan

项目描述 :
Reads DHT sensor in ESP8266 Development board
高级语言: PHP
项目地址: git://github.com/catchhariharan/esp8266-12E-DHT.git
创建时间: 2017-06-09T11:38:22Z
项目社区:https://github.com/catchhariharan/esp8266-12E-DHT

开源协议:

下载


esp8266-12E-DHT

Objective:
Read the temperature from DHT sensor and populate the HTML file in server, so that it can be seen anywhere from the world. This project uses HTTPclient configuration.

Hardware used:

  1. ESP8266MOD development board
  2. DHT11 sensor
  3. Raspberry Pi 3 (optional)

Software used:

  1. Arduino IDE to program ESP8266 - used nodemcu v1.0 board
  2. Arduino IDE is loaded in the Raspberry Pi 3

Hardware connection ESP8266 to DHT:

  1. Pin2 is used in software config of DHT, which is data pin of the sensor (note: which is D4 in the development board)
  2. Sensor positive is connected 3V3 (next pin to D4 in dev board)
  3. Sensor negative is connected to GND (next pin to 3V3 in dev board)

Software Configurations:

  1. HTTP basic client logic used in the Arduinoi IDE
  2. Included DHT sensor library

Server side configurations:

  1. created a sub domain iot
  2. If you are using raspberry pi as server ensure permissions is given to read/write from www
    use below command

sudo chown -R www-data: *

Raspberry Pi3 as Host:

  1. Loaded hostapd, dnsmasq and apache, php5 in raspberry pi,
  2. used internal wifi dongle and external wifi dongle created a tunnel to wlan1
    sudo iptables -t nat -A POSTROUTING -o wlan1 -j MASQUERADE
  3. internal wifi can be used as AP and external dongle to connect to your wifi router

TODO:

  1. Connect to MySQL, enable login script php for security
  2. You can see the Door Open switch, which can connect the built in LED in esp8266 development board upon button down (onmousedown) and turn off during button up (onmouseup) events