bytedreamer / OSDP.Net

A .NET Core control panel implementation of the Open Supervised Device Protocol(OSDP)
Apache License 2.0
47 stars 19 forks source link

Need help on multi-drop communication using OSDP #85

Closed DeepaGRao closed 2 years ago

DeepaGRao commented 2 years ago

Hi, We have 3 card readers multi-dropped(in the order 1,2,3) having different address. We are using the below code for OSDP communication. It works fine when all the 3 card readers are up and running. If one of the in-between card reader like Card reader with device address 2 is switched off, we are not able to get the response from any of the reader. The event triggered for device connection status change-online or offline is also not coming for rest of the card readers(1 and 3 in this case). Please help on this...

string IPAddr = "10.77.47.99"; int port = 965; int baudRate = 9600; byte deviceAddress1 = byte.Parse("01"); byte deviceAddress2 = byte.Parse("02"); byte deviceAddress3 = byte.Parse("03");

var panel = new ControlPanel(); panel.ConnectionStatusChanged += (_, eventArgs) => { Console.WriteLine("Device with address:" + eventArgs.Address + " is " + (eventArgs.IsConnected ? "Online" : "Offline")); }; _connectionId = panel.StartConnection(new TcpClientOsdpConnection(IPAddr, port, baudRate));

panel.AddDevice(_connectionId, deviceAddress1, true, true); panel.AddDevice(_connectionId, deviceAddress2, true, true); panel.AddDevice(_connectionId, deviceAddress3, true, true);

while(true) { panel.IsOnline(_connectionId, deviceAddress1); System.Threading.Thread.Sleep(100); panel.IsOnline(_connectionId, deviceAddress2); System.Threading.Thread.Sleep(100); panel.IsOnline(_connectionId, deviceAddress3); System.Threading.Thread.Sleep(100); }

bytedreamer commented 2 years ago

K, I didn't realize you were connecting to devices over a Ethernet network. I've been testing multiple devices on RS-485. I can take a look at it in a couple of days. It is likely a timeout issue.

What is the model of the Ethernet to Serial converter device are you using?

bytedreamer commented 2 years ago

I made some changes in 2.1.6 that should help with your issue.

bytedreamer commented 2 years ago

Closing since there has been no response.

DeepaGRao commented 2 years ago

Hi, We are using multiple devices multi-dropped and connected over RS-485. Serial to Ethernet converter that we are using is MOXA NPort 6650-16 With the latest 2.1.6, I am still facing the issue. If among the 3 multi-dropped devices, one of the device is switched off, we are not able to get response from any of the other devices Can you please check this?