-
Notifications
You must be signed in to change notification settings - Fork 4
Client Connection
This guide explains how to connect to Modbus devices using both TCP and RTU protocols.
The connection panel is located in the top right section of the Client mode interface. It contains:
- Protocol toggle (TCP / RTU) - left of the Unit ID input
- Connection parameters (change based on selected protocol)
- Unit ID input (always visible for both protocols)
- Connect/Disconnect button
- Connection status indicator (button turns yellow when connected)
Modbus TCP is a network-based protocol that runs over Ethernet.
-
Select TCP using the protocol toggle (left of Unit ID input)
-
Enter the IP Address
- IPv4 address of the device (e.g.,
192.168.1.100) - Use
127.0.0.1for local testing (e.g., connecting to Modbux server simulation)
- IPv4 address of the device (e.g.,
-
Set the Port
- Default Modbus TCP port:
502 - Some devices use custom ports (check device documentation)
- Default Modbus TCP port:
-
Choose Unit ID
- Also called Slave ID
- Huawei Smart Logger example:
- Unit ID
0is typically the main device (SmartLogger itself) - Unit ID
1and higher are connected devices (e.g., inverters, weather sensors)
- Unit ID
-
Click CONNECT
- Button turns yellow when successfully connected
Modbus RTU is a serial communication protocol using RS-485.
- USB-to-RS485 adapter (most common)
- Proper wiring to the device (A/B or +/- terminals)
-
Select RTU using the protocol toggle
-
Enter the Serial Port
- See Finding Serial Ports below
-
Set Baud Rate (dropdown)
- Common values:
9600,19200,38400,57600,115200 - Must match device settings
- Check device documentation and device configuration
- Common values:
-
Set Parity
- Options:
None,Even,Odd,Mark,Space - Most common:
None - Must match device settings
- Options:
-
Set Data Bits
- Options:
5,6,7,8 - Most common:
8
- Options:
-
Set Stop Bits
- Options:
1,2 - Most common:
1
- Options:
-
Choose Unit ID
- Also called Slave ID
- Must match device configuration
- Check device settings or documentation
-
Click CONNECT
- Button turns yellow when successfully connected
Serial ports appear as COM ports:
- Open Device Manager
- Expand Ports (COM & LPT)
- Find your USB adapter (e.g.,
USB Serial Port (COM3)) - Note the COM number
- Enter in Modbux as:
COM3,COM5, etc.
Common values:
-
COM1,COM3,COM5,COM7, etc.
Serial ports appear in /dev/:
- Open Terminal
- Run:
ls /dev/cu.* - Look for entries like
/dev/cu.usbserial-XXXX - Use the
cu.variant (nottty.)
Example:
ls /dev/cu.*
# Output: /dev/cu.usbserial-0001Enter the full path: /dev/cu.usbserial-0001
Common patterns:
/dev/cu.usbserial-XXXX/dev/cu.SLAB_USBtoUART/dev/cu.usbmodem-XXXX
RS-485 is the standard for Modbus RTU:
- Two terminals: A/B or +/-
- ! Polarity matters ! - incorrect polarity = no communication
- Use shielded cable for longer distances
For reliable communication, especially on longer cables:
- Some devices have built-in termination (check documentation)
- RS-485 interface cards often have jumpers or switches to enable termination
- USB adapters (e.g., USB-COMi-M) may have internal jumpers for termination
- Modbus RTU-to-TCP converters usually handle termination automatically
- Only the devices at the ends of the bus need termination enabled
Cannot connect:
- Verify IP address and port are correct
- Check that port 502 is not blocked by firewall
- Ensure device is powered on and network cable is connected
- Use
pingto verify network connectivity first (TCP) - Check baud rate matches device settings (RTU)
- Verify correct Unit ID in device configuration
- Swap A/B wiring if incorrect polarity (RTU)
Connection timeout or drops:
- Adjust timeout via the Time Settings (clock icon in toolbar)
- Check network latency with
ping(TCP) - Increase the timeout value if device or network is slow
- Verify termination resistors are properly configured (RTU)
Wrong Unit ID:
- Try Unit ID
0(often the main device) - Try Unit ID
1(common for standalone devices) - Check device documentation or settings for correct Unit ID
- Some devices respond to multiple Unit IDs
The connection button shows the current state:
- CONNECT: Not connected, click to connect
- CONNECTING...: Connection in progress
- CONNECTED (yellow button): Active connection, click to disconnect
- DISCONNECTING...: Disconnection in progress
To disconnect from a device:
- Click the DISCONNECT button
- Wait for disconnection to complete
- You can now change connection parameters
After connecting (button turns yellow):
- Configure a register read address and length (e.g., Holding Register at address 0, length 10)
- Click Read
- Check if data appears in the grid
- Status messages appear as notifications (snackbar)
- If you encounter issues, try different register lengths - some devices have strict requirements for data frame size and may only respond to specific read lengths
If you see rows appearing in the readout table, your connection is working.