I have an RB411AR configured to allow me to telnet to the serial port;
/port remote-access
add port=serial0 tcp-port=10001
This gives me an ethernet/wifi to serial adapter and works fine.
However, if the Lan or Wifi link to the RB411AR is disconnected, I am unable to sucessfully reestablish a sucessful link to the serial port from my host.
The host reports a new valid telnet session sucessfully established and I am sending serial data, but no serial data is being passed thru.
If I disable the Remote Access server in the Ports section, and then reenable it, the session will be correctly restablished.
Also when the Lan connection is down, the Remote Access Server still shows a valid connection and does not change when a new Telnet session is established.
Is the Remote Access server not releasing the connection and/or not allowing a new session to be connected?
Any ideas?
Upon further reflection on this, I think I may know why this is happening.
I have no data being sent in the other direction; no packets being sent to the host.
So the remote access server has no idea that the connection was lost. So it holds the connection open.
I guess the access server will allow multiple sessions and that is why I am able to create a new telnet session into the unit.
But there is only one serial port and it is tied up with the first server and therfore the new session isnt connected to the serial port.
I dont know if my assumptions above are correct or not.
I had my serial device send out some characters on a regular basis and the unit will detect a Lan disconnect since packets are being sent to the Host and when they dont recieve an ack, the session properly times out.
This is an ugly hack; sending data when I shouldn’t be, but it is the only workaround I can think of.
If anyone has any other ideas, please let me know.
Update:
I was able to write a script to alleviate the problem. The script periodically checks the connection list for connections matching the remote access server’s configured IP and host address.
Then compares the entry’s src-address to remote-address that the access server thinks it is connected to. If they dont match, that is an orphaned session and disabling and then re-enabling the remote access server clears the established connections and allows the host to reconnect. I can post the script if anyone cares to see it.
This seems to work fine even though for some reason, once I re-enable the remote access server, it shows up with a status of invalid from then on. But it works and I dont know what is invalid about it.
This is not the most elegant solution to this problem. Although I suspect MT is not interested in solving this issue I can see a few ways in which it could/should be addressed:
- Implement a TCP keepalive on the remote access server with adjustable timeout and retries.
- Don’t allow another TCP telnet client to sucessfully create a TCP session to an access server that requires a already in-use serial port. This might not solve the problem but would at least not allow the host to think all is well with the connection when it is not the case.
So how about it Mikrotik? Care to chime in on what may be happening here and possible fixes you may have or be willing to incorporate in the future?
Why does the status of the remote access server show up as Invalid after I have cycled the disabled property?
Hello!
have You still this script available?
BR
Tarmo
Hello! Eight years and this is still not resolved. I am trying to retrieve NMEA data from GPS device on Mikrotik LTAP. I have configured remote access to serial port “serial1” and when I connect and correctly disconnect, all goes well. However when the connection between my computer and LTAP is disrupted (cable unplugged, computer forcibly restarted, application crashes, …), LTAP still holds on to the connection and never releases it.
Please, Miktorik, look at this issue, this must be resolved or the serial port capability and the GPS chip on LTAP are pretty useless ![]()
Bump! ![]()