jiricmi / MP_NETIO_BUTTON

Netio products button
0 stars 0 forks source link
cplusplus dokumentace esp32 html javascript measurements netio remote-control thesis

Manual

How to install on esp8266 with Netio ESP flasher

Best method is to use Visual studio code with plugin Platformio.

  1. Download 'Kód' folder of this repository
  2. After installation of VS code and Platformio override esptool.py in platformio
    • Windows path: C:\Users\username\.platformio\packages\tool-esptoolpy\esptool.py
  3. Connect
  4. Upload with platformio

NETIO button tutorial

How to set it up

  1. Turn it on with ON/OFF switch
  2. Hold both buttons until red light blinks once.
  3. Open WiFi manager and find NETIO-BUTTON network and search 192.168.4.1 in internet browser
  4. Under WiFis find your WiFi and click on it after that enter your password
  5. After connecting, copy IP address of the device, reconnect to your network and enter new IP to your browser

Connect to Netio socket

  1. Select Action list on main screen
  2. Click on button add
  3. Enter IP adress of Netio socket (only IP without http:// or /netio.json)
  4. Enter JSON string
  5. Choose which button should use this command and submit
  6. You can delete each record in table by clicking on button Delete
  7. On main screen click on button Deep sleep to end conf-mode

Basic info

This is prototype of NETIO button that allow you to control the NETIO socket. It works on sending HTTP request method. On the other side, this communication is handled by the socket via JSON API. Button is made with small consumption. Button is only up when user sends HTTP request or turns on conf-mode.

Device structure

Device has 2 buttons with S1 and S2 marks. They are used for JSON configure. User can program those buttons via conf-mode.

LED and buzzer signaling

Device has LED with green and red color. Buzzer is connected with red color of LED.
If green light is on, device is trying to connect to wlan or communicate with the socket.
If red light blinks once for longer time, device entered or quited conf-mode.
If red light blinks 2x with buzzer signalization, connection to wlan failed.
If red light blinks 3x with buzzer signalization, HTTP communication failed. Probably IP address of the socket is invalid.
If red light blinks 4x with buzzer signalization, device wasn't able to recognize input. Please hold the button little bit longer.

Conf-mode

For entering conf-mode, hold both buttons until light turn on for 400ms. After that connect to AP called NETIO-BUTTON. Open browser and search 192.168.4.1.

WiFi selection

On main screen, user is able to connect device to any close-range network without security or with WES, WPA or WPA2-personal. For update WiFi list, click on Scan button.
By clicking on button with your wanted network, you will be transfer to security page (only if network is secured). If password is checked, page will show you IP address of device selected by DHCP server in network. And now you are able to connect to conf-mode via your network and appropriate IP address.

IP address of the socket

User is able to set 10 IP addresses for each button. So one HTTP request will be send a maximum of 10 devices at once. You can add IP address via form where you also select with button should use this IP address. It is possible to delete each address.

JSON message

Behind button configure you can find feature to write JSON message to JSON API of socket. Current JSON is below the form.

Disable conf-mode button

This button will put device to sleep. Holding both buttons during conf-mode has same effect.

Factory reset button

Deletes whole EEPROM.

Obsah

📦MP_NETIO_BUTTON
┣ 📂kod - - Finální program
┣ 📂dokumentace - Dokumentace s latex soubory
┃ ┗ 📜document.pdf
┣ 📂mereni - Waveform a screenshoty
┃ ┣ 📂esp32
┃ ┃ ┣ 📂operace
┃ ┃ ┣ 📂ustalene_stavy
┃ ┃ ┗ 📜vysledky_mereni_esp32.xlsx
┃ ┗ 📂esp8266
┃ ┃ ┣ 📂operace
┃ ┃ ┣ 📂ustalene_stavy
┃ ┃ ┗ 📜vysledky_mereni_esp8266.xlsx
┣ 📂navrh_vzorku - Eagle
┃ ┣ 📂esp32
┃ ┗ 📂esp8266
┣ 📜.gitignore
┗ 📜README.md

Poděkování

Chtěl bych poděkovat panu učiteli Ing. Břetislavu Bakalovi za odborné vedení práce a cenné rady, které mi pomohly tuto práci zkompletovat. Rád bych také poděkoval technickému řediteli Ing. Břetislavu Bakalovi ml. společnosti NETIO products a.s. za cenné rady, věcné připomínky a vstřícnost při konzultacích a vypracování maturitní práce.

Úvod maturitní práce

V této maturitní práci porovnám platformy ESP8266 a ESP32 z hlediska spotřeby a reakčního času v takových podmínkách, aby bylo možné určit platformu, která je vhodnější pro funkční vzorek ovladače zásuvek od společnosti NETIO Products a. s. Jelikož je cílem vytvořit co nejvíce úsporné zařízení, jak je jen možné, budu porovnávat jednotlivé ustálené stavy. Zařízení také musí být uživatelsky přívětivé, tzn. není ideální, když uživatel musí čekat na reakci několik sekund.

Dále na každé platformě porovnám rychlost a spotřebu připojení k WiFi síti a následné odeslání HTTP requestu. Po vybrání vhodné metody ustáleného stavu, vytvořím konfigurační rozhraní pro editaci nastavení sítě a HTTP requestu, do kterého se bude přistupovat přes access point zařízení ESP.

Ve finále vytvořím dva funkční koncepty ovladačů pro každou platformu. Tento koncept bude vycházet z předchozího měření a zjištění. Funkčním vzorkem bude možné ovládat, buď dvě různé zásuvky, nebo jednu zásuvku z dvěma výstupy. V závěru práce zhodnotím, zda je možné vytvořit plnohodnotný produkt, či nikoliv.

Zadání maturitní práce

Výstupy