Thanks for the test Bernd. I have started to investigate this a bit deeper, The problem seems to be following:

When the driver ist started it enummerates all Touptec and Touptec OEM Cameras.

For each camera it creates a new instance of ToupBase and stores the information from the enummeration process (m_Instance) that is needed to open the camera with the Touptec library.

When the camera is unplugged and reconncted some USB parameters change. I am not an USB expert... but I think it is the USB bus number.

When the user disconnect the driver, unplug and plug in the camera and reconnect the driver the connect inforation for the Touptec library is no longer valid and the driver is not working correctly. This causes a crash of the driver

What I have done is to enummerate the cameras when the user reconnects the driver after the initial connect.

you can find this code here: github.com/42-max/indi-3rdparty/tree/ReconnectTests

This code works fine for me but the solution has still some problems:

  • It will only work with cameras that can be enummerated by the touptec (or Omegon) libraries.
    This driver has a very tricky solution to enummerate also OEM Cameras that are compatible to Touptec but that can not be found by the Touptec library. This process has to be incooperated to the enummeration process in the Toupbase class.

  • After the reconnect of the driver, the instance of Toupbase has to find the camera that was connected before if there is more than one Touptec camera connected.
    I did not found a good solution for this problem until now. If I store the serial number of the camera when the instance of Toupbase is created and try to find this serial number later I have to open the camera with the Touptec library to get the serial number. If the camera is already opend by another instance the driver crashes. So I store the the display name of the camera to find it back, The display name is part of the enummeration information from the library. As a result, this solution works only if you have different models of the camera connected.

  • I do not understand completely the id that is retured by the Touptec libary enummeration function. If the camera can be clearly identified by this id, this would be the solution. Does anybody have more information about the Touptec library?

  • I found some rare random instabilities when the cameras were reconncted and images were taken. I will work on this issue.

CS, AstroMax