Google Chat: zj734465502@gmail.com
+86-0755-88291180
sales01@spotpear.com
dragon_manager@163.com
services01@spotpear.com
manager01@spotpear.com
WhatsApp:13246739196
ESP32-S3-ETH-8DI-8RO is an industrial-grade 8-channel WiFi network relay based on ESP32-S3 main controller and supports WiFi, Bluetooth, RS485, network port and other peripheral interfaces. It has built-in protection circuits such as power supply isolation and optodecoupler isolation, which is safe, stable and reliable, and suitable for the AIoT field.
Item | Parameter |
Supply voltage | 7~36V (or 5V/1A Type-C port) |
Relay channels | 8 channels |
Digital input channels | 8 channels |
Contact Form | 1NO 1NC |
Wiring port | Type-C |
Communication protocol | USB protocol |
Dimensions | 90 (H) x 175 (V) (mm) |
1. ESP32-S3 2. High-quality relay 3. Optocoupler isolation 4. RESET button 5. PoE port 6. BOOT button 7. Power chip 8. Digital isolation 9. Power isolation 10. Bidirectional optocoupler isolation 11. RTC battery header 12. Buzzer 13. Digital input interface | 14. Pin header interface 15. Operating status indicator 16. USB Type-C interface 17. WS2812 RGB colorful LED 18. Network port 19. External antenna socket 20. Power supply screw terminal 21. RS485 communication interface 22. RS485 matching resistor 23. Relay screw terminal |
24. Onboard TVS (Transient voltage suppressor) 25. RS485 conversion chip 26. MP1605GTF-Z 27. PCF85063ATL | 28. TCA9554PWR 29. W5500 30. TF card slot |
Control EXIO | Function |
EXIO1 | Relay 1 control pin |
EXIO2 | Relay 2 control pin |
EXIO3 | Relay 3 control pin |
EXIO4 | Relay 4 control pin |
EXIO5 | Relay 5 control pin |
EXIO6 | Relay 6 control pin |
EXIO7 | Relay 7 control pin |
EXIO8 | Relay 8 control pin |
Control GPIO | Function |
GPIO12 | ETH_INT |
GPIO13 | ETH_MOSI |
GPIO14 | ETH_MISO |
GPIO15 | ETH_SCLK |
GPIO16 | ETH_CS |
Control GPIO | Function |
GPIO45 | MISO |
GPIO47 | MOSI |
GPIO48 | SCLK |
NC | CS |
NC | SD_D1 |
NC | SD_D2 |
Control GPIO | Function |
GPIO17 | UART TX pin, corresponding to RS485 |
GPIO18 | UART RX pin, corresponding to RS485 |
Control GPIO | Function |
GPIO41 | RTC_SCL, SCL (Serial clock line) |
GPIO42 | RTC_SDA, SDA (Serial data line) |
Control GPIO | Function |
GPIO38 | RGB control pin |
Control GPIO | Function |
GPIO46 | Buzzer control pin |
Control GPIO | Function |
GPIO0 | BOOT button control pin |
ESP32-S3-ETH-8DI-8RO currently provides the Arduino IDE development tool and framework.
Arduino IDEArduino IDE is an open source electronic prototyping platform, convenient and flexible, easy to get started. After a simple learning, you can start to develop quickly. At the same time, Arduino has a large global user community, providing an abundance of open source code, project examples and tutorials, as well as rich library resources, encapsulating complex functions, allowing developers to quickly implement various functions. |
Each of these two development approaches has its own advantages, and developers can choose according to their needs and skill levels. Arduino and MicroPython are suitable for beginners and non-professionals because they are easy to learn and quick to get started.
This chapter introduces setting up the Arduino environment, including the Arduino IDE, management of ESP32 boards, installation of related libraries, program compilation and downloading, as well as testing demos. It aims to help users master the development board and facilitate secondary development.
Board name | Board installation requirement | Version number requirement |
---|---|---|
esp32 by Espressif Systems | "Install Offline" / "Install Online" | 3.0.0 and above |
Library Name | Description | Version | Library Installation Requirement |
---|---|---|---|
ArduinoJson | Lightweight JSON library | v6.21.4 | "Install Online" or "Install Offline" |
PubSubClient | MQTT message subscription publishing library | v2.8.0 | "Install Online" or "Install Offline" |
NTPClient | Network time synchronization client library | v3.2.1 | "Install Online" or "Install Offline" |
File
-> New Sketch
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
}
void loop() {
// put your main code here, to run repeatedly:
Serial.println("Hello, World!");
delay(2000);
}
File
-> Save As...
. In the pop-up menu, select the path to save the project, and enter a project name, such as Hello_World, click Save
①. Click to select the dropdown menu option Select Other Board and Port;
②. Search for the required development board model esp32s3 dev module and select;
③. Select COM Port;
④. Save the selection.
①. Compile the program; ②. Compile and download the program; ③. Download successful.
Demo | Basic Description | Dependency Library |
---|---|---|
01_MAIN_WIFI_AP | RS485 interface control, Bluetooth control, Bluetooth send IP, Web page control (short distance) | Can be flashed directly Web pages are only available if they are connected to device WIFI |
02_MAIN_WIFI_STA | RS485 interface control, Bluetooth control, Bluetooth send IP, Web page control (short distance) | Need to modify the WIFI to be connected Web pages can only be used within the intranet |
03_MAIN_WIFI_MQTT | RS485 interface control, Bluetooth control, Bluetooth transmit IP, Waveshare cloud control (long distance) | Need to modify the WIFI to be connected The device must be created in the Waveshare cloud |
04_MAIN_ALL | RS485 interface control, Bluetooth control, Bluetooth send IP, Web page control (short distance), Waveshare cloud control (long distance) | Need to modify the WIFI to be connected The device must be created in the Waveshare cloud Web pages can only be used within the intranet |
Demo description
Precautions
Code analysis
uint8_t *buf
: A pointer to an unsigned 8-bit integer array, which is supposed to store the received data, and the function determines the content of the command based on the value of the first element (buf[0]
) of the array.uint8_t Mode_Flag
: The mode flag is used to represent the data source, and the corresponding data source prompt information (such as Bluetooth data, Wi-Fi data, or RS485 data) is output by judging this flag, and different relay operations are performed according to different commands.Mode_Flag
.switch
statement to perform different operations based on the value of buf[0]
:CH1
to CH8
, the digitalToggle
function is used to switch the level states of the corresponding EXIO pins (such as GPIO_PIN_CH1
, etc.), and the corresponding elements of the Relay_Flag
array are updated to record the change in relay status. The Buzzer_PWM
function is called to control the buzzer, and the corresponding on or off prompt information is output according to the final state of the relay.ALL_ON
command, set all GPIO pins (corresponding to 8 channel relays) to high level (on state), use the memset
function to set all elements of the Relay_Flag
array to 1, indicating that all relays are turned on, output all relay ON prompt information, and control the buzzer.ALL_OFF
command, set all relevant GPIO pins to low level (off state) similarly, update the Relay_Flag
array elements to 0, output a message that all relays are turned off and control the buzzer, and perform two additional buzzer control operations (with a delay in between).buf[0]
does not belong to the above command cases, a prompt message for non-instruction data is output.WIFI_AP
, and then attempt to create a soft AP through WiFi.softAP(ssid, password)
. If it fails, it will loop through prompt and retry until it succeedsipStr
and output it for easy network address recognitionhandleRoot
, handleGetData
, etc.) for multiple paths (such as "/", "/getData", etc.) through server.on
, each function should be defined elsewhere for different functional operations like returning pages, getting data, controlling switches etc.server.begin()
to start the Web server and output a startup prompt message.Demo description
Precautions
Code analysis
WIFI_STA
mode and enable sleep mode, then start connecting to the specified network. In the cyclic wait of unsuccessful connection, a point is output as a prompt every half second, and the RGB light briefly turns red on every even number of attempts (except the first attempt). If every 10 attempts fail, the connection is disconnected and reconnected. If the number of attempts exceeds 22, the connection is considered a failure and the loop is exited.WIFI_Connection
to 1, light up the green light for 1 second to indicate success, and then obtain and display the local IP address. Next, register callback functions corresponding to multiple paths for the web server (such as root path, data retrieval, control of different switches, etc.), and finally start the server and output startup prompt, so that the device can receive corresponding control through the web page.WIFI_Connection
to 0, output a prompt to inform that the device can be controlled through Bluetooth debugging assistant, and light a red light to indicate a connection failure statusDemo description
Precautions
Code analysis
CH1
, ALL_ON
etc.) are sent to the device via Bluetooth, Wi-Fi, or RS485. The device parses and executes the corresponding operation after receiving a command. For example, when the command CH1
is received, the function will switch the state of relay 1printf
(e.g., relay status update: "Relay CH1 on") and fed back via the buzzer Buzzer_PWM
). This allows users to see real-time status updatesBluetooth_Init()
, and the device can establish connections with other Bluetooth devices and receive control commandsMQTT_Init()
, the device will connect to the Wi-Fi network and be able to communicate with remote servers through the MQTT protocolAcquisition_time()
function will synchronize the current time to RTC through the network, ensuring that the device has accurate system timeDemo description
Precautions
Operation Command | Command Function |
06 01 | Switch the CH1 relay status of Modbus RTU Relay |
06 02 | Switch the CH2 relay status of Modbus RTU Relay |
06 03 | Switch the CH3 relay status of Modbus RTU Relay |
06 04 | Switch the CH4 relay status of Modbus RTU Relay |
06 05 | Switch the CH5 relay status of Modbus RTU Relay |
06 06 | Switch the CH6 relay status of Modbus RTU Relay |
06 07 | Switch the CH7 relay status of Modbus RTU Relay |
06 08 | Switch the CH8 relay status of Modbus RTU Relay |
06 09 | Turn on all relays of Modbus RTU Relay |
06 0A | Turn off all relays of Modbus RTU Relay |
...\ESP32-S3-POE-ETH-8DI-8RO-Demo\Firmware\Factory bin
The product can be controlled online through the Homeassistant built on the Raspberry Pi, and the relevant operations can be found in Reference link
①View through Device Manager: Press the Windows + R keys to open the "Run" dialog box; input devmgmt.msc and press Enter to open the Device Manager; expand the "Ports (COM and LPT)" section, where all COM ports and their current statuses will be listed.
②Use the command prompt to view: Open the Command Prompt (CMD), enter the "mode" command, which will display status information for all COM ports.
③Check hardware connections: If you have already connected external devices to the COM port, the device usually occupies a port number, which can be determined by checking the connected hardware.
①Use the dmesg command to view: Open the terminal.
①Use the ls command to view: Enter ls /dev/ttyS* or ls /dev/ttyUSB* to list all serial port devices.
③Use the setserial command to view: Enter setserial -g /dev/ttyS* to view the configuration information of all serial port devices.
Monday-Friday (9:30-6:30) Saturday (9:30-5:30)
Email: services01@spotpear.com