rossmann-engineering / EasyModbusTCP.NET

Modbus TCP, Modbus UDP and Modbus RTU client/server library for .NET implementations
928 stars 402 forks source link

Exception: Serial Port already opened #52

Open hannekedo opened 3 years ago

hannekedo commented 3 years ago

I use the EasyModbus lib for communication with several modbus devices over RS485.

The following happens quite regularly:

I use version 4.4.1.0 of EasyModbus, which I realize is old. However I tried updating and that also doesn't seem to work flawlessly. Therefore my question is if this is a known issue to this version? Is there something that can be done while using 4.4.1.0 that could resolve this? Do you have any clue as to why this could happen? Thanks for your help!

Padanian commented 3 years ago

Never had this problem whatsoever before. I've been using EasyModbus for quite some time, with no such issue. I'm afraid this could be caused by a faulty serial converter. Possibly a USB to RS485 converter going into sleep mode unexpectedly.

martin1ehm commented 3 years ago

@hannekedo I also never had this problem but I strongly recommend to use an USB converter with FTDI chip and disable the power savings settings for USB devices. https://www.windowscentral.com/how-prevent-windows-10-turning-usb-devices image

hannekedo commented 3 years ago

Thanks for the quick replies and advice. I am going to look into the cables used. I am not using serial to USB though, but various different cable setups to different devices. It happens in all of these setups, which made me think it could be a library issue.

Forgot to mention: the OS it runs on is Ubuntu 18.04.