stephane / libmodbus

A Modbus library for Linux, Mac OS, FreeBSD and Windows
http://libmodbus.org
GNU Lesser General Public License v2.1
3.41k stars 1.74k forks source link

Modbus Connection Issue #293

Closed mhdazeem closed 8 years ago

mhdazeem commented 8 years ago

Hi,

Really appreciate for the library. Actually I am implementing Modbus RTU in an embedded device Digi Module Connect me 9210. I am having the connection issue on both RTU and TCP Side. could you please help me out in this. I am using Digi ESP Net OS SDK for the implementation. I am implementing V 3.1.2

dhruvvyas90 commented 8 years ago

@mhdazeem What exactly is the problem ?

mhdazeem commented 8 years ago

Thanks for the reply, When i try to make the connection with the slave using the " ctx = modbus_new_rtu("/dev/ttyUSB0", 19200, 'N', 8, 1); modbus_set_slave(ctx, SERVER_ID);" sample code its dosent make the connection keep saying connection failed.

mhdazeem commented 8 years ago

server id is 1

in the Digi ESP SDK i am replacing "/dev/ttyUSB0" ---> "/com/0"

karlp commented 8 years ago

so... check errno, check you have perms on the serial port, check your return codes...

ctx = modbus_new_rtu(xxxxx);
if (!ctx) {
       fprintf(stderr, "things are b0rked: %s\n", modbus_strerror(errno);
}
mhdazeem commented 8 years ago

Main Issue is I cannot see the error no. I am using docklight scripting for verbose. The only thing I get is "Connection Failed"

stephane commented 8 years ago

@mhdazeem, the issue tracker is reserved for identified bugs. For your problem, you must use the libmodbus mailing list with a detailed description (as already asked).