Failed to connect!

Questions, bug reports, requests for enhancements, etc.
Post Reply
iMustBcrazy
Posts: 338
Joined: Sun Jun 02, 2019 3:52 pm

Failed to connect!

Post by iMustBcrazy »

I think there is a lock up on indigo sky when an agent becomes disconnected.

Its easy to reproduce, all you have to do is let your Mac go to the state where it turns off the screen - and presumably goes into some kind of sleep state.

when this happens and I'm connected to work, there is no issue, wake up the laptop and my VPN is still connected like nothing has happened.

However, when this happens and I'm connected to indigo sky via wifi, the local agent becomes disconnected, but on indigo sky the driver thinks its still connected. So when my laptop wakes up and I try to reconnect to the camera, for example, I get "Failed to connect" due to the fact that the driver is still connected to camera, I guess. It seems to me, this should not happen. The driver status should show disconnected when the agent disappears so the agent can reconnect.

This is less of a problem when the agent is on indigo sky but it has happened for inexplicable reasons.

Attached are my debug logs from AI and indigo sky ...
Attachments
indigosky_log.zip
(1.85 KiB) Downloaded 5 times
ai_log.txt
(14.83 KiB) Downloaded 6 times
User avatar
Peter Polakovic
Posts: 2696
Joined: Thu Apr 21, 2016 9:38 am

Re: Failed to connect!

Post by Peter Polakovic »

Unfortunately, it is not clear from the log what agent do you use. If you use local agent and remote device, you need to be connected and it is very inefficient (the same as with version 3.x or INDI). But you have to use remote agent and its local devices. Do you?
iMustBcrazy
Posts: 338
Joined: Sun Jun 02, 2019 3:52 pm

Re: Failed to connect!

Post by iMustBcrazy »

Peter Polakovic wrote: Mon Jul 19, 2021 9:42 pm Unfortunately, it is not clear from the log what agent do you use. If you use local agent and remote device, you need to be connected and it is very inefficient (the same as with version 3.x or INDI). But you have to use remote agent and its local devices. Do you?
I used the local agent for the purpose of exposing the problem. I do use the remote agent for v4 operation but I do still get this problem once in a while.

To me the issue is a lockup, that the driver remains connected to the device yet the agent has disconnected from the driver. So reconnecting the agent is blocked. This happens in both V3 and V4 under the right conditions. To clear the problem I have to use the indigo server manager to disconnect the devices, then I can connect the agent to the devices again.
User avatar
Peter Polakovic
Posts: 2696
Joined: Thu Apr 21, 2016 9:38 am

Re: Failed to connect!

Post by Peter Polakovic »

Oh yes, so it is clear now!

There are basically 3 scenarios:

1. Local agent and local device (everything on mac)
2. Remote agent and remote device (everything on a remote server, e.g. on INDIGO Sky)
3. Local agent and remote device (agent on mac and device on remote server, e.g. on INDIGO Sky)

The first two scenarios are efficient and the second one is also independent on network. But the third one is inefficient and may hang in case of unreliable connection. There is also the problem of "locked" devices. If you connect remote device to a local agent and then close it without disconnecting the device, it remains "opened" (because it doesn't know agent doesn't run anymore). So you have to disconnect them manually, e.g. in a control panel.

Nevertheless, if it is not really necessary (e.g. because you use legacy INDI server without agents), third scenario doesn't really make a sense. It is supported just for a compatibility with legacy servers.
iMustBcrazy
Posts: 338
Joined: Sun Jun 02, 2019 3:52 pm

Re: Failed to connect!

Post by iMustBcrazy »

"If you connect remote device to a local agent and then close it without disconnecting the device, it remains "opened" (because it doesn't know agent doesn't run anymore). So you have to disconnect them manually, e.g. in a control panel."

So if understand a bit of software... the device remains "opened", the agent can't just reconnect to it - like the agent lost it's handle for the device... like losing a file handle?
User avatar
Peter Polakovic
Posts: 2696
Joined: Thu Apr 21, 2016 9:38 am

Re: Failed to connect!

Post by Peter Polakovic »

Actually, connection status is maintained on server side. The client (e.g. local agent) opens the camera (sets CONNECTION property) and this avoids other clients to try to do the same. When the local agent disappear without closing the camera, it remains opened. The protocol is not session oriented, so the server doesn't know if the client is still running.
iMustBcrazy
Posts: 338
Joined: Sun Jun 02, 2019 3:52 pm

Re: Failed to connect!

Post by iMustBcrazy »

Hi Peter, thanks for all your help and info, here and on other related threads :) I've been studying the RPi/wifi behaviour. As you recommended, things work quite predictably with a good connection so I've taken steps to get a better antenna working. I don't know why I have had a couple of seemingly corrupted SD cards - I think it may have been some sort of config error at startup because the linux system still seemed to work fine - but hopefully it won't happen when I get the wifi working better!
Post Reply