Krzysztow / modbus-utils

Modbus client and server command line tools based on libmodbus.
MIT License
35 stars 21 forks source link

Modbus TCP connecting problems #4

Open Carl101098 opened 4 years ago

Carl101098 commented 4 years ago

If the arm development board is connected to 127.0.0.1, it can monitor normally root@omapl138-Tronlong:/modbusserver# ./build --debug -mtcp -p1502 127.0.0.1 Ranges: Coils: 0-0x0064 Digital inputs: 0-0x0064 Holding registers: 0-0x0064 Input registers: 0-0x0064

However, if i connect to the IP address of the network interface (set to 192.168.10.120), it cannot connect root@omapl138-Tronlong:/modbusserver# ./build --debug -mtcp -p1502 192.168.10.12 0 Ranges: Coils: 0-0x0064 Digital inputs: 0-0x0064 Holding registers: 0-0x0064 Input registers: 0-0x0064 Unable to listen TCP connection

On the host side, the IP (192.168.10.120) or the development board IP (set to 192.168.10.130) connected to the network interface cannot run the program normally root@yzw-virtual-machine:/mnt/hgfs/Myshare/client# ./build --debug -mtcp -t0x10 -r0 -p1502 192.168.10.130 0x01 0x02 0x03 Data to write: 0x0001 0x0002 0x0003 Connecting to 192.168.10.130:1502 Connection failed: Operation now in progress

can you tell me what may be the cause of this result thanks