PortDisconnected VPN Ras dialer

Hello, our devices in Asia are using VPN via the RAS Dialer API. They are based on your 2.3 BSP WinCE 7 running on the Colibri T30. Our carrier board is custom and we are using a Telit LE910v2 EU modem to connect with LTE and then we connect via RasDial to our vpn server over L2TP/IPSEC.

These are occasionally failing with error PortDisconnected at least 1 or 2 times a week.

When we get a portdisconnected error we restart the unit because our previous experience was that only a reboot would fix this when using the RAS Dialer api.

a) do you have any more information about why these errors occur? It is a really generic error and there is really little to no information on it. Below is the declaration in the header file (in the “user friendly” windows 10 header, there is no comment in the windows ce header)


    • A connection to the remote computer could not be established, so the port used for this connection was closed.%0*

And here is all of the documentation over handling errors on this API in the official documentation.

We are truly lost on this.

b) how would your team track down the cause of an error like this ? I have built a checked version of the OS in platform builder, but I don’t even know where to start trying to set the proper debug zones on this or how we can find the relavant info in the system logs

c) is there anyone there that could tell us about what we could look for on the server side to see if those traces give us more info? The event viewer on our server has almost no information that helps us.

When using the RAS Dialer API, this error indicates that the connection between the modem and the VPN server has been lost. The RAS Dialer API relies on the modem to establish and maintain a connection, so if the modem loses the connection, the RAS Dialer API will report the “ERROR_PORT_DISCONNECTED” error.

It’s possible that the Telit LE910v2 modem is losing the connection due to poor signal strength, network congestion, or other environmental factors. It could also be a hardware issue with the modem itself.

So I would start investigating of this issue from enabling an then collecting internal logs from your Telit LE910v2 EU modem. Unfortunately I’m not familiar with that modem but in many cases you can enable enable modem verbose error code reporting by sending AT command


Please refer to your modem manual for more details about logging and error reporting

Do you know if the VPN connection can be recovered without rebooting?

I will try and contact the modem vendor and see if we can get more information about the stability of the connection. We use AT+CMEE=1 during the registration/attachment of the modem with the carrier network but after registration/attachment we close the serial port and use the Ras dial to control the modem port and provide info/feedback to the OS about the modem connection. We don’t have a second serial port open with the modem to find out extra information or anything.

Should we do that?

Also do you know if the VPN connection can be recovered after a PortDisconnected without rebooting? That is really the big problem here, we have no real way to reboot our probes safely and we don’t really want to in the first place.

I don’t have that knowledge, but you can refer to the VPN and RAS documentation for more information. As for debugging, you could try setting up a modem connection without RAS using just a terminal program and check if it stays stable for a week. Then, you can collect data or check for corresponding error messages in the terminal window

Had a similar problem! I usually rebooted the system modem 2-3 times and often it helped me!

We would like to avoid that if possible. I mean, if you mean reboot 2-3 times and then the device runs for several months…or a year without the error? then that will be ok. But otherwise restarting our device is really a bad thing due to safety issues and potential damaging of things like the SD cards or onboard modem.