Examples

Link to GitHub repository

Hello World

ESP32 Open IoT and IIoT Gateways (P01 & P02)

Link to repositories:

Description

This example use UART0 in the MCU which is reserved for the console. Simple string and device info is printed on the console and then the MCU restarts after 10 seconds.

Console output

image.png

RGB LED

ESP32 Open IoT and IIoT Gateways (P01 & P02)

Link to repositories:

Description

This example shows how to use the programmable RGB LED via the 74HC595BQ shift register. After flashing the device, the RGB LED should change its color between red, green and blue. It can be used to check if the device was connected and flashed properly.

Console output

image.png

Switch

ESP32 Open IoT and IIoT Gateways (P01 & P02)

Link to repositories:

Description

This example shows how to use the button located on the board. There is a simple interrupt handler implemented with a queue used to send a parameter from the handler to a main loop. The board should react on every button press or release with a communicate on the console log.

Console output

image.png

ADC

ESP32 Open IoT and IIoT Gateways (P01 & P02)

Link to repositories:

Description

This example shows how to use the ADC (analog-digital converter) located on the board. In the beginning of the program there is an ADC calibration performed. Thanks to that a raw reading can be converted to a corresponding voltage level.

Console output

image.png

RS232

ESP32 Open IoT and IIoT Gateways (P01 & P02)

Link to repositories:

Connection

Connect RS232_1 port to the RS232_2 port in the loopback configuration.

1qnimage.png

Description

This example shows how to handle the RS232 communication via UART. After flashing both ports should send and read data from each other. 

Console output

image.png

RS485

ESP32 Open IoT and IIoT Gateways (P01 & P02)

Link to repositories:

Connection

Connect RS485_1 port to the RS485_2 port in the loopback configuration.

image.png

Description

This example shows how to handle the RS485 communication via UART and UART-RS485 MAX481 converter. There is also a function implemented for each line termination via the 74HC595BQ shift register. After flashing both ports should send and read data from each other. 

Console output

image.png

I2C Scanner

ESP32 Open IoT and IIoT Gateways (P01 & P02)

Link to repositories:

Description

This example scans through the I2C adresses from 0x03 to 0x78 and lists all available devices. It can be used to detect new I2C devices connected to the board.

Console output

image.png

Ethernet

ESP32 Open IoT and IIoT Gateways (P01 & P02)

Link to repositories:

Connection

ETHERNET adapter should be connected to WLAN with a RJ45 cable.

image-33.webp

Description

This example demonstrates basic usage of ETHERNET driver. After flashing the CGE2 will try to obtain an IP address in a network it will be connected to. Once it will be done it will be possible to ping the device in this network. This example is a good base for developing own network solutions.

Console output

image.png

image.png

WiFi

ESP32 Open IoT and IIoT Gateways (P01 & P02)

Link to repositories:

Description

This example shows how to create a  Wi-Fi station or access point with CGE2. Access point is a device that hosts WI-FI network. Station is a device that can be connected to an existing Wi-Fi network. User can add their own network names, passwords and security features. Keep in mind that external antenna will extend the range of the device.

Console output

Access point

image.png

Station

image.png

More Examples

ESP32 Open IoT and IIoT Gateways (P01 & P02)

More examples from Espressif can be found here.

Also the ESP-IDF documentation can found here.

MicroPython examples and documentation can be found here