You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18-9Lines changed: 18 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,7 @@ Arduino-based Modbus RTU to Modbus TCP/UDP gateway with web interface. Allows yo
11
11
-[IP Settings](#ip-settings)
12
12
-[TCP/UDP Settings](#tcpudp-settings)
13
13
-[RTU Settings](#rtu-settings)
14
+
-[Tools](#tools)
14
15
*[Integration](#integration)
15
16
-[Loxone](#loxone)
16
17
-[Home Assistant](#home-assistant)
@@ -73,22 +74,25 @@ Allows you to connect your Modbus devices (such as sensors, energy meters, HVAC
73
74
# Hardware
74
75
Get the hardware (cheap clones from China are sufficient) and connect together:
75
76
76
-
***Arduino Nano, Uno or Mega** (and possibly other boards with Atmel chips).<br>On Mega you have to configure Serial in advanced settings in the sketch.
77
+
***Arduino Nano, Uno or Mega** (and possibly other boards with ATmega chips).<br>On Mega you have to configure Serial in advanced settings in the sketch.
77
78
***Ethernet shield with WIZnet chip (W5100, W5200 or W5500)**.<br>The ubiquitous W5100 shield for Uno/Mega is sufficient. If available, I recommend W5500 Ethernet Shield. You can also use combo board MCU + ethernet (such as ATmega328 + W5500 board from Keyestudio).<br>ATTENTION: Ethernet shields with ENC28J60 chip will not work !!!
78
-
***TTL to RS485 module with an automatic flow direction control**.<br>You can buy cheap modules with MAX3485, MAX13487, SP485 or SP3485 chips (some of these modules are branded as "XY-017", "XY-485", "XY-G485", etc.) from Aliexpress and other marketplaces. Use stabilized external power supply 5V for both Arduino (incl. ethernet shield) and the RS485 module.<br>ATTENTION: Modules with MAX485 chip will work (use pin 6 for DE,RE), but are NOT recommended (no auto-direction, no ESD protection, no hot-swap protection)!!!
79
+
***TTL to RS485 module with an automatic flow direction control**.<br>You can buy cheap modules with MAX3485, MAX13487, SP485 or SP3485 chips (some of these modules are branded as "XY-017", "XY-485", "XY-G485", etc.) from Aliexpress and other marketplaces.<br>ATTENTION: Modules with MAX485 chip will work (use pin 6 for DE+RE), but are NOT recommended (no auto-direction, no ESD protection, no hot-swap protection) !!!
80
+
***External power supply**.<br>Use regulated 5V external power supply for both the Arduino (+ the ethernet shield) and the RS485 module.<br>ATTENTION: By using the 5V pin, you are bypassing Arduino's built-in voltage regulator and reverse-polarity protection curcuit. Make sure your external power supply does not exceed 5,5V !!!
-** Download and flash my pre-compiled firmware** from "Releases".
91
-
-**Compile your own firmware**. Download this repository (all *.ino files) and open arduino-modbus-rtu-tcp-gateway.ino in Arduino IDE. Download all required libraries (they are available in "library manager"). If you want, you can check the default factory settings (can be later changed via web interface) and advanced settings (can only be changed in the sketch). Compile and upload your program to Arduino.
92
+
-**Download and flash my pre-compiled firmware** from "Releases".
93
+
-**Compile your own firmware**. Download this repository (all *.ino files) and open arduino-modbus-rtu-tcp-gateway.ino in Arduino IDE. If you want, you can check advanced_settings.h for advanced settings (can only be changed in the sketch) and for default factory settings (can be later changed via web interface). Download all required libraries, compile and upload your program to Arduino. The program uses the following external libraries (all are available in Arduino IDE's "library manager"):
**Load Default Settings**. Loads default settings (see DEFAULT_CONFIG in advanced settings). MAC address is retained.
103
-
104
-
**Reboot**.
105
-
106
106
**EEPROM Health**. Keeps track of EEPROM write cycles (this counter is persistent, never cleared during factory resets). Replace your Arduino once you reach 100 000 write cycles (with 6 hours EEPROM_INTERVAL you have more than 50 years lifespan).
107
107
108
108
**Ethernet Sockets**. Max number of usable sockets. See Limitations bellow. One socket is reserved for Modbus UDP, remaining sockets are shared between Modbus TCP and WebUI.
109
109
110
+
**Ethernet Chip**. Wiznet chip on the ethernet shield.
111
+
110
112
**MAC Address**. First 3 bytes are fixed 90:A2:DA, remaining 3 bytes are random. You can also set manual MAC in IP Settings.
111
113
112
114
## Modbus Status
@@ -197,6 +199,13 @@ Enjoy :-)
197
199
198
200
**Attempts**. Number of attempts before error (Code 11) is sent back to the Modbus TCP/UDP master.
**Load Default Settings**. Loads default settings (see DEFAULT_CONFIG in advanced settings). MAC address is retained.
206
+
207
+
**Reboot**.
208
+
200
209
# Integration
201
210
202
211
This gateway adheres to the Modbus protocol specifications, so you can use it to connect any compliant Modbus RTU slave (Modbus device) with any compliant Modbus TCP/UDP master (such as home automation system). Here is a quick overview how you can integrate the gateway into the most popular home automation systems:
0 commit comments