Skip to content

Latest commit

 

History

History
47 lines (38 loc) · 2.71 KB

README.md

File metadata and controls

47 lines (38 loc) · 2.71 KB

Hardware

Required components

  • Microcontroller of your choice:
  • Moisture sensor (Amazon)

Schematics

Software

IDE: Arduino

Dependencies

Installation

  1. Install Arduino IDE from link above
  2. Add ESP8266 Addon (See tutorial from Sparkfun)
  3. Install all dependencies with library manager
    • Sketch > Include Library > Manage Libraries
    • Search for each dependency (see list above) except ESP8266 Board and install the appropriate versions.
  4. Download this repository and open it with the IDE
  5. Connect ESP8266 to the computer
  6. Select the board from Tools > Board > NodeMCU 1.0 (ESP-12E Module) (This might vary depending on the board you are using)
  7. Select the COM port where ESP8266 is connected Tools > Board > Port > COMxx
  8. Push RST and FLASH button, release RST and then release FLASH (This might vary depending on the board you are using)
  9. Flash the firmware from the Arduino IDE
  10. The microcontroller will create a new access point. Connect there and navigate with a browser to 192.168.4.1.
  11. Provide in the webinterface the SSID and password for your network.
  12. After the microcontroller connected to you network figure out the IP address of it. This can be done by:
    • checking serial monitor Tools > Serial Monitor
    • checking webinterface of your router
    • use a network scanning tool
  13. Configure mqtt by issuing the following command:
    curl -i -X PUT -d {\"host\":\"host\",\"port\":1234,\"client\":\"clientname\",\"user\":\"user\",\"pwd\":\"password\",\"ssl\":false} http://<ip of µC>/api/config/mqtt
  14. Configure actors by issuing the following command:
    curl -i -X PUT -d [{\"pin\":1,\"topic\":\"topic\"}] http://<ip of µC>/api/config/actors
  15. Configure sensors by issuing the following command:
    curl -i -X PUT -d "[{\"pin\":0,\"sensorName\":\"sensor name\",\"location\":\"location\",\"type\":\"water\"}]" http://<ip of µC>/api/config/sensors
  16. Restart the microcontroller