Skip to content

ciberp/esp8266-universal-sensor

Repository files navigation

esp8266 universal sensor firmware

An open source arduino based firmware for esp8266. To which we connect the desired sensors and configure them in the settings. Sensors data is displayed on webpage and can be pushed or pulled from it. Data can be periodically pushed to:

  • Domoticz (home automation system) via domoticz http api
  • influxdb (TCP or UDP)
  • carbon (UDP)
  • redis (TCP)

or pulled via http as json data.

Sensors data can be subscribed through MQTT protocol to mqtt broker/server. Output ports can be controlled via MQTT publish.

Logging is also supported as syslog using UDP.

Currently supported sensors: DS18B20, DHT11, DHT22, DHT21, AM2302, BME280, K-type with MAX6675, ultrasonic HC-SR04. I/O pins as output can be button or url controlled.

Flashing/upgrading via OTA

  • open url:

     http://sensors_ip_address/espupdate
    
  • browse and upload binary file

  • if everything goes well esp8266 will reboot and boot up with new firmware

Flashing the firmware using windows tool NodeMCU Flasher

Download Win32 Windows Flasher
Download Win64 Windows Flasher
Download universal-sensor.bin

Set universal-sensor.bin and set offset to 0x00000
flasher
Choose proper COM port and click Flash
flasher

Flashing the firmware using python tool esptool.py

  • install esptool (debian):

     user@hp:~ > sudo pip install esptool
    
  • connect esp8266 board

  • find to which port is connected:

     user@hp:~ > dmesg | grep USB
    

    and search for something like:

     usb 6-1: ch341-uart converter now attached to ttyUSB0
    
  • download universal-sensor.bin

  • run esptool:

     user@hp:~ > esptool.py --port /dev/ttyUSB0 write_flash 0x0000  universal-sensor.bin
    
  • esptool output:

     user@hp:~ > esptool.py --port /dev/ttyUSB0 write_flash 0x0000 universal-sensor.bin 
     esptool.py v2.2
     Connecting....
     Detecting chip type... ESP8266
     Chip is ESP8266EX
     Uploading stub...
     Running stub...
     Stub running...
     Configuring flash size...
     Auto-detected Flash size: 4MB
     Compressed 345008 bytes to 238239...
     Wrote 345008 bytes (238239 compressed) at 0x00000000 in 21.1 seconds (effective 131.0 kbit/s)...
     Hash of data verified.
    
     Leaving...
     Hard resetting...
    

After flashing esp8266 will boot up and turn on software access point with ssid universal. Connect to esp8266 ssid using psk password. When connected open url:

http://192.168.4.1/settings

and configure system settings to your needs. Next time esp8266 will reboot it will automatically connect to your AP set in settings. If it can't connect it will again automatically turn on own AP with ap ssid and ap psk set in settings. To see esp8266 IP address when connected to your wifi check serial terminal:

user@hp:~ > miniterm.py /dev/ttyUSB0 115200
--- Miniterm on /dev/ttyUSB0  115200,8,N,1 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
;l␀d��|␀�$�|␃␄␌␄�␌d�␄c|ǃ␂�␛�{�c�␌b��og�l'o���␌#␜x�l{l{$p�'�␘␃␄
AP IP address: 192.168.4.1


Connecting to WiFi..
Connected to SSID: W32.Blaster.Worm
IP address: 172.22.0.18
Looking for 1-Wire devices...

Screenshots

root webpage universal-sensor-root settings (http://IP_address/settings) universal-sensor-settings json (http://IP_address/json) universal-sensor-json

About

esp8266 universal sensor firmware

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages