Closed karlp closed 13 years ago
User error. Two problems, masking each other :(
Firstly, if (rc = -1) { report failure } Found that as soon as I enabled -Wall Secondly, I was checking for success with == 0 for write_register, when it should have been checking for != -1
Ugh, total user error.
I've just found this error in your gist (!= 0) but you've already found it.
I'm having some issues with libmodbus, that as best I can tell, are problems coming from the rtu CRC check.
If I simply ignore the return codes, everything works just fine. in debug mode, I see the expected bytes and all the devices respond appropriately. However, the return code is always -1, and errno is always set to 9 Bad file descriptor.
Opening /dev/ttyUSB000 at 115200 bauds (N, 8, 1) [01][06][00][01][00][FA][58][49] Waiting for a confirmation...
<01><06><00><01><00>