Why Ethernet cable unplugging cause connection error to TCP client?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Why Ethernet cable unplugging cause connection error to TCP client?

1,768 Views
creatorwonny
Contributor III

Hi All,

I'm using imxrt1060 evk board. I run simple modbus TCP server program using lwip socket on the board. I'm trying to test if the connection (or socket) is kept after I unplug and re-connect an Ethernet cable. If the connection is kept then modbus TCP client on PC can still communicate with the server. I expected the connection would be kept, but it wasn't. The unplugging Ethernet cable caused an error to the modbus client somehow so the connection seems lost. The modbus kept sending a packet but the server didn't receive any packet from the client. However, if I opened other modbus client program and connected it to the server then it could connect and send/receive a packet. It seems it caused by raw level software such as phy device driver or  hardware or something else.

Can anyone help me on this matter?

Labels (1)
0 Kudos
6 Replies

1,563 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi JIWON KIM ,

   Which detail lwip sample code you are using, from SDK side for MIMXRT1060?

pastedImage_1.png

Which project you are using?

Could you tell me the detail steps to reproduce your issues?

Waiting for your reply.

Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

1,563 Views
creatorwonny
Contributor III

Hi Kerry Zhou,

Thanks a lot for your reply. I used lwip_tcpecho example without changes except IP address.

The scenario are:

  1. Run tcpecho example
  2. Connect to the tcp server using Putty (ip: 192.168.3.102, port: 7)
  3. Press any keys on Putty to check it works.
  4. Unplug an Ethernet cable.
  5. A following network error occurred and the connection was closed once I unplug the cable. 

connection abort.PNG

0 Kudos

1,563 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi JIWON KIM,

   Thanks for your updated information.

   Do you try the echotool.exe, which is mentioned in the SDK readme?

echotool 192.168.0.102 /p tcp /r 7 /d hello
NOTE: The echotool.exe application can be found here https://github.com/PavelBansky/EchoTool

Whether this code also have these connection issues?

 To be honest, I think, when the Ethernet cable is disconnected, the windows report the connection issue, it should be normal, do you want when the cable is disconnected, then the windows tool have nothing notification?

Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

1,563 Views
creatorwonny
Contributor III

Hi kerryzhou

Strangely, when I used iMX SoloX, this problem didn't happen. That's why I think it is wrong and I might miss something to configure or whatever. I will check with the Sabre board again and let you know the result.

Thanks for your support!

0 Kudos

1,563 Views
felix1
Contributor IV

Hi JIWON,

As my experience, using freeModbus on RT1050 platform, the LwIP module need to update, the prior LwIP version seems has problem.

0 Kudos

1,563 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi JIWON KIM,

  Ok, you can check it again.

   Please also check the SDK recommended software, whether the same situation.

   Any updated information, kindly let me know.

Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos