EXAMPLES

The following tutorials show how to use GUI-O application with ESP32 boards in various configuration and communication modes. Tutorial for automatic device pairing also shows how to include SSL/TLS for secure IoT connection.

The same principle of operation can be applied to any other board or device - check out how GUI-O works. To see more examples, visit our forum.

ESP32 & Arduino basic examples

The following examples show basic interaction between GUI-O app and ESP32 module in various communication modes.

ESP32 Bluetooth

  1. Download BasicBluetooth.ino sketch

  2. Follow Basic Bluetooth video tutorial

  3. Additional Boards Manager URLs: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json

ESP32 Bluetooth LE

  1. Download BasicBLE.ino sketch (or BasicBLE_NUS.ino for Nordic UART service)

  2. Follow Basic BLE video tutorial

  3. Additional Boards Manager URLs: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json

ESP32 MQTT (IoT)

  1. Download BasicMQTT.ino sketch

  2. Follow Basic MQTT video tutorial

  3. Additional Boards Manager URLs: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json

ESP32 USB

  1. Download BasicUSB.ino sketch

  2. Follow Basic USB video tutorial

  3. Additional Boards Manager URLs: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json

ESP32 Ethernet

  1. Download BasicEthernet.ino sketch

  2. Follow Basic Ethernet video tutorial

  3. Additional Boards Manager URLs: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json

ESP32 & Arduino & GUI-O automatic pairing (supports SSL/TLS)

The following example shows how to automatically pair GUI-O app with ESP32 in MQTT (IoT) mode. Although the example uses ESP32-WROOM-32 board, it is compatible with any other ESP32 board.

GUI-O app always uses SSL/TLS for secure (encrypted) communication. In order to also establish a secure connection from the ESP32 side, use ESP32_GUI-O_pairing_source_SSL_TLS.zip. To establish an unencrypted connection, use ESP32_GUI-O_pairing_source.zip instead (see "Prerequisites" section below).

Prerequisites

  1. Download Arduino IDE

  2. Download ESP32_GUI-O_pairing_libs.zip and extract the archive

  3. Download ESP32_GUI-O_pairing_source.zip or ESP32_GUI-O_pairing_source_SSL_TLS.zip (for secure connection) and extract the archive

Step 1: Add ESP32 board support

  1. Open Arduino IDE

  2. Select "File -> Preferences" and under Additional Boards Manager URLs enter: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json

  3. Select "Tools -> Board -> Boards manager..."

  4. Search and install "esp32" by Espressif Systems

  5. After installation select "Tools -> Board -> ESP32 Arduino -> ESP32 Dev Module"

Step 2: Include necessary libraries

  1. Select "Sketch -> Include library -> Add .ZIP library..."

  2. Navigate to location, where ESP32_GUI-O_pairing_libs.zip archive was extracted

  3. Select .zip library and confirm (repeat procedure until all .zip libraries are included)

Step 3: Upload the code

  1. Select "File -> Open"

  2. Navigate to location, where ESP32_GUI-O_pairing_source.zip archive was extracted

  3. Select PairingMQTT.ino and confirm

  4. Make sure that ESP32 board is connected to your PC

  5. Make sure that the correct port is selected

  6. Press upload button to start code upload (IMPORTANT NOTE: on some ESP32 boards, the BOOT button must be pressed when the upload starts)

  7. Reset ESP32 board after code upload

Check out the video tutorial below!

Video tutorial of Step 1 - 3

Step 4: Pair GUI-O app with ESP32 board

  1. Open GUI-O app and navigate to settings

  2. Make sure that IoT connection is active (select "Connections -> IoT")

  3. From main settings menu select "Quick pair -> Direct device pairing"

  4. Enter device name (required) and user name (optional) and confirm

  5. Make sure that mobile data plan is disabled and WiFi is enabled

  6. Search and select the WiFi network of the ESP32 (starts with guio_************)

  7. Input password 12345678 (can be changed in "program_ap.cpp" source)

  8. IMPORTANT NOTE: Wait for your device to report that no internet is available and keep WiFi connection to ESP32!

  9. Return to GUI-O app and wait for WiFi network scan

  10. Select your WiFi access point / router and input password

  11. Wait for the pairing procedure to complete and press "Connect"

  12. Wait for successful IoT connection and press the GUI-O initialize button from the home screen

Check out the video tutorial below!

Video tutorial of Step 4

Important notes

  • ESP32 operates in two WiFi modes: AP (access point - used for pairing) and STA (stationary - used for normal operation)

  • After first pairing, ESP32 stores the pairing data into its EEPROM and always boots to STA mode when powered on

  • To clear the pairing data and boot to AP mode, send the following command to ESP32 over the serial port: "!CLEAR_PARAMS\r\n" (see "serialInputHandler()" method in "program_base.cpp" source)

  • Implement custom handling of GUI-O messages within "mqttReceiveCallback(...)" method in "program_sta.cpp" source

Connect . Create . Control

Connect . Create . Control