Portserver: Disappearing device endpoints on Linux

I've been using a TS4 portserver on a project and every now and again the device driver is not present.

There are two scenario's where this happens:
  • At startup the device may not immediately be present;
  • At startup the device is not present and never re-appears.
The issue around not being immediately present is not too huge an issue as you can always add a check for the presence of the device on the filesystem and either report to the user or just keep checking until the device appears.

However every now and again the device disappears and can only be restored by re-initialising the portserver setup.

When you have what is essentially an embedded remote system this is a real pain as there is no easy way to inform the user of a problem and running the GUI tools remotely over a radio link is let us say not particularly straight forward. Yep there is a command line tool but when you are commissioning the equipment in the middle of no-where with limited internet access you tend to only find simpler solutions after the fact!

It turns out the the portserver daemon only creates the devices when it has establish communications with the device. This normally works however if you have a fluctuation in power the device sometimes screws up causing the loss of all settings on the remote device.

The only way to deal with this is to write a script that checks for the presence of the device files for a reasonable amount of time and if not present after this 'reasonable' amount of time to re-initialise the daemon. Then check again. Of course how many times do you go round this loop and do you need to reboot in-between?... you can see where this is going... and the risks of creating a very unstable system.

This IMHO is not what you should be doing with what is meant to be an industrial solution to converting RS422/RS232 serial communications to ethernet.

Comments