×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

Hotplug devices

  • Posts: 454
  • Thank you received: 51

Hotplug devices was created by Patrick

Hello,
As I met some problems with the qhy driver when exposure fails I wondered if it is possible to have hotplug for devices on indiserver.
Let me explain a little.My first question is : is it possible today ?
My second question is : if not, would it be possible in a future version ?
7 years 4 months ago #12692

Please Log in or Create an account to join the conversation.

  • Posts: 712
  • Thank you received: 174

Replied by Peter Polakovic on topic Hotplug devices

With INDI (now) it is quite hard to do, but with INDIGO (future INDI) it is one of the mandatory requirements for any USB device driver.

There is already PoC of QHY5L-II driver with this feature, but as fas as I know EKOS doesn't support hot-plug yet.

github.com/indigo-astronomy/indigo

Peter
7 years 4 months ago #12693

Please Log in or Create an account to join the conversation.

Replied by Jasem Mutlaq on topic Hotplug devices

INDI server restarts a crashed process (up to 10 times by default and can be increased).
7 years 4 months ago #12694

Please Log in or Create an account to join the conversation.

  • Posts: 454
  • Thank you received: 51

Replied by Patrick on topic Hotplug devices

Yes Jasem it restart the driver but the old one which remain running introduce dysfunctional stufs like the tab of the device which is not reset. The crash of the qhy driver looks like it is hanged and wait for some signal from the client. So, that is why it would be good to check if the driver is running before re-running it. Is it possible to do it other way than manually ?
7 years 4 months ago #12698

Please Log in or Create an account to join the conversation.

  • Posts: 1029
  • Thank you received: 301

Replied by Eric on topic Hotplug devices

Hello,
I had a few issues recently with devices getting lost.
One example is the eqmod driver losing sync with the mount. I tracked the issue down to a meridian flip which fumbled with the rj45 cable and/or the supply and caused a temporary disconnection, which in turn caused the driver to loop timeouts. That's one case of needed hotplug: a driver which needs to reset. That should be handled by the server, except it should be mandatory that drivers maintain a sanity heartbeat with their equipment. In the example, a manual driver reset was required, leaving the mount with 30+ degrees sync offset, which broke subsequent jobs.
Another example is a driver crashing or hanging the server: one of my jobs, estimated as 30 minutes, took more than 3 hours until the mount started complaining about sky limits. I still have to dig on what exactly occurred on that nice one. A system tool can be used to restart the server when it crashes, but Ekos will definitely have to do something better than popping a "connection lost". Probably Ekos should also take action when a job goes silently wrong too.
The last example I have is equipment hotplug. My box uses eudev rules and fifo messages to auto connect and disconnect indi devices. Works fairly well, except when for some reason a dev file remains open and inaccessible, which is rare. There's not much documentation on the various ways to do this management, and I think this could be improved.
-Eric
7 years 2 months ago #13630

Please Log in or Create an account to join the conversation.

Replied by Jasem Mutlaq on topic Hotplug devices

I guess we need a timeout loop counter in EQMod which tries to reconnect until it gives up after few tries. Can you submit a PR for that?
7 years 2 months ago #13654

Please Log in or Create an account to join the conversation.

  • Posts: 1029
  • Thank you received: 301

Replied by Eric on topic Hotplug devices

Indeed, I'll post an issue when I finish investigating the logs.
I just wanted to share more situations where controlling state of devices would be necessary.

Looking at the code in indigo-astronomy, I'm not sure the case presented by patdut is managed properly.
@patdut, could you clarify "qhy driver crashes"?

If it is the USB device getting lost, and here we're talking about hardware hot(un)plugging indeed, then there should be a way to detect the loss of the device with a filesystem check at the driver level, and cause a disconnection. Further on, it depends whether the responsibility to start indi drivers is at the level of system (udev/fifo scheme), or indi server (issuing new connection requests as long as the client asked "connect") or Ekos (same, client being end-user).

If it is libqhy which is hanging for whatever reason, the situation is a bit more complex, but a server-driver heartbeat could be a solution.

-Eric
7 years 2 months ago #13672

Please Log in or Create an account to join the conversation.

  • Posts: 454
  • Thank you received: 51

Replied by Patrick on topic Hotplug devices

Hello Eric,
Since my message more than a month ago, and disappointed by those problems I sold the QHY and bought a ZWO 120MM-S and got new problems :( .
To get back to my first message. What I experienced is that when I met problems there was two instances of the driver in the process list. The current one that was managed under the running indiserver and a remaining one coming from... I don't know.
7 years 2 months ago #13673

Please Log in or Create an account to join the conversation.

Time to create page: 0.265 seconds