LinuxCNC / linuxcnc

LinuxCNC controls CNC machines. It can drive milling machines, lathes, 3d printers, laser cutters, plasma cutters, robot arms, hexapods, and more.
http://linuxcnc.org/
GNU General Public License v2.0
1.82k stars 1.17k forks source link

mb2hal Broken pipe with TCP #1501

Open remy-mr opened 2 years ago

remy-mr commented 2 years ago

Hi. I get "ERROR Broken Pipe" , when trying to communicate with my VfD in LinuxCNC and mb2hal component.

Is this from mb2hal, LinuxCNC, or Linux Mint 19?

When I send the commands via the program QModBus everything is fine. WIN_20220109_19_32_31_Pro WIN_20220109_19_57_17_Pro

andrewheeler82 commented 2 years ago

Hello, I looked at the pictures. Can it be that there is no connection? Is it possible to get a detailed log?

hansu commented 2 years ago

Which LinuxCNC version are you using?

andrewheeler82 commented 2 years ago

somehow it doesn't go on like this. Unfortunately I don't have the possibility to test via tcp.

remy-mr commented 2 years ago

Hi. Sorry for late reply. LCNC 2.8.1

For now I switched back to wired connection via USB-RS485 adapter to my Vfd and only one TCP block in the INI for the relays. I have to mention, that I use an ESP32 module as modbus-server.

First I run TCP-RTU-bridge together with server on this ESP. Testing its function with QModBus run without problems. But mb2hal shows "Broken pipe". So all I want to know is, who is writing this error message. Is it linux kernel, Lcnc, or the mb2hal comp. From there on I hope to go on examine what is the problem.

Could it be, that two TCP ports on the same IP causes error? In my first setup with bridge, together with server, I used port 502 for the bridge and 504 for server.

hansu commented 2 years ago

I get "ERROR Broken Pipe" ... Is this from mb2hal, LinuxCNC, or Linux Mint 19?

i think the "ERROR" comes from the libmodbus library: https://github.com/stephane/libmodbus/blob/7c8dbd29e5a924f3bb157f0d37ff522bd821e0af/src/modbus.c#L84 and the "Broken pipe" from the system.

andrewheeler82 commented 2 years ago

I get "ERROR Broken Pipe" ... Is this from mb2hal, LinuxCNC, or Linux Mint 19?

i think the "ERROR" comes from the libmodbus library: https://github.com/stephane/libmodbus/blob/7c8dbd29e5a924f3bb157f0d37ff522bd821e0af/src/modbus.c#L84 and the "Broken pipe" from the system.

I agree with that. Also think it comes from libmodbus.