# OPC client auto reconnect

**URL:** <https://forum.inductiveautomation.com/t/opc-client-auto-reconnect/90142>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [May 9, 2024, 6:36am UTC](https://forum.inductiveautomation.com/t/opc-client-auto-reconnect/90142 "2024-05-09T06:36:52Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![nideyijuyidong](https://avatars.discourse-cdn.com/v4/letter/n/7cd45c/32.png) [@nideyijuyidong](https://forum.inductiveautomation.com/u/nideyijuyidong)\
**Post date:** [May 9, 2024, 6:36am UTC](https://forum.inductiveautomation.com/t/opc-client-auto-reconnect/90142/1 "2024-05-09T06:36:53Z")

</div>

I'm connecting to a third party OPC server. When the server is stopped and restarted, Ignition's OPC client will not automatically connect to the server.  
Manually establishing a connection will connect to the server immediately, just click "Edit" and then "Save".  
So how can I make the OPC client automatically connect to the server?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 9, 2024, 12:20pm UTC](https://forum.inductiveautomation.com/t/opc-client-auto-reconnect/90142/2 "2024-05-09T12:20:40Z")

</div>

It should reconnect automatically. The best thing you can do for troubleshooting is to capture with Wireshark while you demonstrate the issue. Make sure the connection is made without security so the capture use useful.

---

<div class="post-metadata">

**Author:** ![nideyijuyidong](https://avatars.discourse-cdn.com/v4/letter/n/7cd45c/32.png) [@nideyijuyidong](https://forum.inductiveautomation.com/u/nideyijuyidong)\
**Post date:** [May 10, 2024, 1:48am UTC](https://forum.inductiveautomation.com/t/opc-client-auto-reconnect/90142/3 "2024-05-10T01:48:59Z")

</div>

When I connect manually, Ignition switch to a new port. Could you explain what this means?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/3/f3df5be51ecce72f4462f853b10f25b445acbec5.png)  
[disconnect.pcapng](https://forum.inductiveautomation.com/uploads/short-url/bJTgqfSnBguYBHbflrAvDiWRqU7.pcapng) (9.4 KB)  
[connect.pcapng](https://forum.inductiveautomation.com/uploads/short-url/g44BdZR017RxywPkGLWjlmibbIZ.pcapng) (182.7 KB)

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 10, 2024, 2:02am UTC](https://forum.inductiveautomation.com/t/opc-client-auto-reconnect/90142/4 "2024-05-10T02:02:36Z")

</div>

It doesn't really mean anything. When a TCP connection is opened the client side of it uses an ephemeral port, and this port usually changes every time.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 10, 2024, 2:04am UTC](https://forum.inductiveautomation.com/t/opc-client-auto-reconnect/90142/5 "2024-05-10T02:04:26Z")

</div>

These captures don't really show anything useful and seem to only have one side of the conversation (only requests, no responses).

---

<div class="post-metadata">

**Author:** ![nideyijuyidong](https://avatars.discourse-cdn.com/v4/letter/n/7cd45c/32.png) [@nideyijuyidong](https://forum.inductiveautomation.com/u/nideyijuyidong)\
**Post date:** [May 10, 2024, 2:32am UTC](https://forum.inductiveautomation.com/t/opc-client-auto-reconnect/90142/6 "2024-05-10T02:32:20Z")

</div>

Sorry. I'm new to Wireshark. During that time I shut down and restarted the OPC server. It looks like Ignition tried to connect several times but the OPC server didn't respond properly?  
[diconnect.pcapng](https://forum.inductiveautomation.com/uploads/short-url/iUFlKapbcVG0fSPW530ihomoBX4.pcapng) (14.7 KB)  
[connect.pcapng](https://forum.inductiveautomation.com/uploads/short-url/v1Iww2jZTkPH2w7MMyoW0CrBhB2.pcapng) (380.8 KB)

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 10, 2024, 2:58am UTC](https://forum.inductiveautomation.com/t/opc-client-auto-reconnect/90142/7 "2024-05-10T02:58:10Z")

</div>

Does the second "connect" capture show the connection happening because you edit/saved the connection?

It looks like the server shuts down and starts returning Bad\_ServerHalted in ServiceFaults responses but it never actually shuts down or restarts...

If you're not on Ignition 8.1.38 or later you might try upgrading, there was a small change in the reconnection logic added to work around buggy behavior observed in another server, but it might help here too.

---

<div class="post-metadata">

**Author:** ![nideyijuyidong](https://avatars.discourse-cdn.com/v4/letter/n/7cd45c/32.png) [@nideyijuyidong](https://forum.inductiveautomation.com/u/nideyijuyidong)\
**Post date:** [May 10, 2024, 6:10am UTC](https://forum.inductiveautomation.com/t/opc-client-auto-reconnect/90142/8 "2024-05-10T06:10:42Z")

</div>

> [@Kevin.Herron](#):
>
> Does the second "connect" capture show the connection happening because you edit/saved the connection?

Yes.

> [@Kevin.Herron](#):
>
> If you're not on Ignition 8.1.38

I update to 8.1.39, it works. Now Ignition reconnect to the OPC server in seconds automatically.

Thank you.
