/IoT-Switch

IoT app with using ESP8266 microprocessors and Linux backend REST server

Primary LanguageCSS

Smart Home Esp controllers registration and control project

Used components:

  • ESP8266 ESP-01 Microcontrollers
  • Microcomputer running ARM linux
  • Wifi router
  • Relay
  • 3.3v to 5v converter
  • Power adapter and stabilizator for esp microcontroller
  • Patience

Device and Systems of the project:

  • Lights and light bulbs control
  • Heater control
  • Cooler control
  • Stove control (SIEMENS stove Reverse Engineered :p )
  • Curtain control
  • TV remote control
  • Smart sockets
  • Window control
  • Water pump control (Water sensor used)
  • Current measurement
  • Water flow measurement
  • CCTV security
  • Fingerprint sensor access control (door builtin)
  • Fingerprint sensor access control (wireless)
  • RFID NFC card access control (Door builtin)
  • SIM900 SMS message control option
  • PIR security sensor devices
  • Face recognition service

Documentations:

Server Side (enUS)

Server Side (ruRU)

Server Side (tkTM)

Smart Home (enUS)

Smart Home (ruRU)

Smart Home (tkTM)


ESP-01 devices have two active pins - Led output (GPIO 2) and Switch (GPIO 0)

Connect those pins in a correctly by schematics and record ESP's ip-address. Add ip address to a database of python server app. Send JSON command to a linux server and let him execute the rest thing.


Compile and run the ESP8266 microprocessor code

check ip addresses to be used check devices and device commands

Esp8266-01 pinout ESP8266-01

NodeMCU-Esp8266 pinout NodeMCU

A4988 Stepper driver pinout A4988

Adafruit Fingerprint Sensor pinout Adafruit fingerprint sensor


API Testing commands

teting /control/

curl --header "Content-Type: application/json" \
	--request POST \
	--data '{"command":"test_local","state":1,"action":""}' \
	http://127.0.0.1:5000/esp/

testing /control/?args

curl --header "Content-Type: application/json" \
	--request POST \
	--data '{"command":"test_local_json","pins":[{"command":"switch_mirror","action":"1"},{"command":"switch_AI","action":"activate"}]}' \
	http://127.0.0.1:5000/esp/JsonToArg/

Browser Get request to raspberry for test:

http://192.168.1.252/esp/ArgToDB/?device_key=<device_key>&command=<sensor_command>&value=<value of water, example 112>

PIR sensor workflow

The command that sensor sends from controllino to raspberrypi

http://192.168.1.252:5000/esp/ArgToDB/?command=pir_sensor&device_key=ESP_ARDU_MASTER&isMaster=1&action=0

action should change here

The command that triggers the mode of pir work

curl --header "Content-Type: application/on" --request POST --data '{"command":"pir_led_selector_command","state":0,"action":""}' http://192.168.1.252:5000/esp/JsonToArg/

If you change state to 1, Then pir will work