View Issue Details

IDProjectCategoryView StatusLast Update
0002942CCdcielGeneralpublic26-08-06 08:49
ReporterHan Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status newResolutionopen 
Summary0002942: Indi, CCDCiel handling of Indi driver refusal connect
DescriptionNoted the following:

Indi, CCDCiel handling of Indi driver refusal connect result in this in the log:

026-08-04T22:18:07.201 9: Sky Simulator: Connecting to INDI server "localhost:7624" for device "Sky Simulator"
2026-08-04T22:18:07.216 2: Connecting Mount INDI "Sky Simulator" …
2026-08-04T22:18:07.278 9: Sky Simulator: INDI server send new device: "Sky Simulator"
2026-08-04T22:18:07.278 9: Sky Simulator: Exec: indi_skysimulator, Version: 1.0, Interface: 1
2026-08-04T22:18:08.622 1: Sky Simulator: Server Disconnected
2026-08-04T22:18:09.279 1: Mount connected
2026-08-04T22:18:10.404 3: Sky Simulator: Mount capabilities:
2026-08-04T22:20:47.476 9: Disconnecting devices

A driver that refuses a connection is legal INDI, and the client should say so rather than dropping the server and claiming success.
TagsNo tags attached.

Activities

Patrick Chevalley

26-08-05 11:51

administrator   ~0009916

I think it work, for example if I try to connect to a Celestron mount that is not present in my system I get the following:

2026-08-05T11:36:35.652 9: Celestron GPS: Connecting to INDI server "localhost:7624" for device "Celestron GPS"
2026-08-05T11:36:35.653 2: Connecting Mount INDI "Celestron GPS" …
2026-08-05T11:36:35.695 9: Celestron GPS: INDI server send new device: "Celestron GPS"
2026-08-05T11:36:35.695 9: Celestron GPS: Exec: indi_celestron_gps, Version: 3.6, Interface: 5
2026-08-05T11:36:37.769 1: Celestron GPS: [ERROR] Failed to connect to port (/dev/ttyUSB0). Error: Port failure Error: No such file or directory. Check if device is connected to this port.
2026-08-05T11:36:37.790 1: Celestron GPS: Server Disconnected

This is a new INDI skysimulator you do ? Can you send me the program so I can take a look at the difference.

Patrick Chevalley

26-08-05 13:12

administrator   ~0009917

I look a bit more in detail.
When the connection fail the INDI server send CONNECTION.DISCONNECT=ON.
This make the ccdciel device to perform it's disconnection procedure, showing the message "Server Disconnected" and marking the device in red.

Han

26-08-05 13:26

reporter   ~0009918

Attached the full code of a working Sky Simulator and a second version of indi_mount.pas in indi_mount_refusal.zip.

Get the sky-simulator working:
Compile the code of sky-simulator-code.zip
Select indi mount.
Optional select an indi camera.
You will need a star database. You could take this one and place in same directory:
https://sourceforge.net/projects/sky-simulator/files/program/star_databases/g16_star_database_mag16.zip/download
Press the button “start simulation”
Now you can connect in CCDciel the mount. No problems.

Now introduce the problem:
From an experiment but now abandoned, I have also attached a different version of indi_mount.pas
Replace the indi_mount.pas with the separate version and recompile & run. The difference is in procedure Doswitch and procedure SendConnection. Then the following happens after connecting the mount:

1) defSwitchVector CONNECTION state="Idle" CONNECT=Off
2) CCDciel sends newSwitchVector CONNECT=On
3) the driver answers setSwitchVector state="Alert" CONNECT=Off plus a <message>
4) CCDciel drops the server connection and then logs Mount connected


cs, Han
indi_mount_refusal.zip (8,831 bytes)

Han

26-08-05 13:51

reporter   ~0009919

The idea for the sky simulator was to keep all indi devices and alpaca devices existing but let inactive (unselected) devices refuse connection. If the client tries to connect inactive devices, the simulator would send a log message back and returned "connect=off". That confused CCDCiel and log message was not displayed. That was the reason for this issue. It worked well for Alpaca.

In the last version when servers are running the switching between Indi/Alpaca/Ascom is disabled. Pressing the stop button will stop the Indi & Alpaca servers and then allow switching between Indi/Alpaca/Ascom.

Patrick Chevalley

26-08-05 18:22

administrator   ~0009920

Thank you, this work and this will be a very nice testing tool.

I see the problem with the version in indi_mount_refusal.
This is because the driver send a valid EQUATORIAL_EOD_COORD before to disconnect.
And I use this property to validate that the connection is successful, no real driver send coordinates if the mount cannot be connected.
I need something like that because there is no "connection successful" message with indi.

Then there is some timer mismatch that process both connect and disconnect at the same time. I can probably fix that to make it more robust.

But this really change from how the indiserver work. As long the driver are not connected to the hardware they only show some minimal common properties, with the Connect function and some to define the serial port for example.
All the specific properties are defined only after successful connection.
The only case it do the same as sky_simulator is when the device is already connected, for example by another application or by another run. In this case Connect is already ON and it make no sense it refuse the connection to disconnect.

Patrick Chevalley

26-08-06 08:49

administrator   ~0009921

I make a fix for the connection process to accept this case.
Now it work correctly and end in a disconnect state when using indi_mount_refusal.

https://github.com/pchev/ccdciel/commit/a6c59ca95aeed7b4b3127e324c3c52ba0d9f3dd8

Issue History

Date Modified Username Field Change
26-08-04 23:18 Han New Issue
26-08-05 11:51 Patrick Chevalley Note Added: 0009916
26-08-05 13:12 Patrick Chevalley Note Added: 0009917
26-08-05 13:26 Han Note Added: 0009918
26-08-05 13:26 Han File Added: sky-simulator-full-code.zip
26-08-05 13:26 Han File Added: indi_mount_refusal.zip
26-08-05 13:51 Han Note Added: 0009919
26-08-05 18:22 Patrick Chevalley Note Added: 0009920
26-08-06 08:49 Patrick Chevalley Note Added: 0009921