Uživatelské nástroje

Nástroje pro tento web


zarizeni:olimex_esp32-poe

Olimex ESP32-POE

Komplexně zpracovaný příklad na modul Olimex ESP32-POE s displayem, 3D tištěným držákem a firmwarem ESPEasy zpracoval mikrom a nechávám ho od něj v angličtině tak jak ho poslal.

Autor příkladu: https://mikrom.cz/
Kontakt na autora: mikrom@mikrom.cz

Hardware

Olimex ESP32-POE

https://www.olimex.com/Products/IoT/ESP32/ESP32-POE/open-source-hardware
Wi-Fi is always meh, so I really like this with POE functionality!

LCD

16×2 with I2C (black board on the back).

HTU21D

Build

3D printed bracket and few computer screws (use brown paper insulated washers for ESP board!).
Model at Printables.com: https://www.printables.com/cs/model/414827-rack-environment-monitoring-bracket
Direct download: Model for print 3MF

Schematic

ESPEasy

Setup commands

Do not forget to change YourAPHere and YourPasswordHere ;-)

# Factory reset
Reset

# Wifi (powered via USB it will connect to the wifi)
WifiSSID YourAPHere
WifiKey YourPasswordHere
WifiConnect

Now you should be able to connect vias the Wi-Fi and do the basic setup.

Controllers

Set Generic HTTP controller where data will be sent:

Controller Hostname: domena-pro-zapis.tmep.cz
Controller Publish: /index.php?temp=[HTU#Temperature]&humV=[HTU#Humidity]

Hardware

Set the correct GPIO for I2C and Ethernet

Devices

Add two devices. Environment sensor, and LCD2004 display. (You can use I2C Scanner under Tools tab to get correct addresses).

LCD

Only correct I2C address is needed here as we will control what is shown later in Rules.

HTU

Select correct I2C address, output data Temp / Hum.

Interval is very important – how often data will be measured (send to the controller, rules triggered)

With Formula, you can do a basic calibration.

Tools -> Advanced

Enable Rules here. You can also set a NTP server.

Notifications

You can setup e-mail notifications here (or if you are using TMEP.cz/TMEP.eu portal, you can use them there).

Just use a standard values as for any SMTP:

Rules

Here some magic s done. Timer is used just for looping two screens on the display (Datetime, Temp, Hum / IP, MAC). Last two functions are for triggering notifications.

The code is pretty self-explanatory.

// https://www.letscontrolit.com/wiki/index.php/Tutorial_Rules
// https://espeasy.readthedocs.io/en/latest/Rules/Rules.html
// https://espeasy.readthedocs.io/en/latest/Reference/Command.html

// http://<espeasyip>/control?cmd=<command>

On System#Boot Do
  LoopTimerSet,1,10 // LoopTimerSet,<timernr>,<timeInSeconds>
Endon

On Rules#Timer=1 Do  // When Timer1 expires, do... => every 10s
  If [int#1]=0
    Let,1,1
    LCDCmd,clear

    LCD,1,1,"{substring:0:10:%lcltime%} %systm_hm%"
    LCD,2,1,"T:[HTU#Temperature]{D}C H:[HTU#Humidity]%"
  Else
    Let,1,0
    LCDCmd,clear

    LCD,1,1,"IP:%ip%"
    
    // Shorter the MAC address A8:03:2A:F8:AB:EC -> A8032AF8ABEC
LCD,2,1,"MAC:{substring:0:2:"%mac%"}{substring:3:5:"%mac%"}{substring:6:8:"%mac%"}{substring:9:11:"%mac%"}{substring:12:14:"%mac%"}{substring:15:17:"%mac%"}"

  Endif
Endon


On [HTU#Temperature]>25 Do
  Notify,1
Endon


On [HTU#Humidity]>40 Do
  Notify,1
Endon

Examples

Vrchlabi

I had to extend the rail 😊 (25° might sound little bit too high, but the AC is currently down)

Vichova