indigo icon indicating copy to clipboard operation
indigo copied to clipboard

Mount_synscan enhancement; dealing with mount connection issues

Open JohanBakk opened this issue 6 years ago • 6 comments

Mount_synscan can be enhanced with better messages and slightly different behaviour when there are mount connection issues;

Four scenario’s:

1 - Driver start & AT connect, mount not powered up 2 - Driver start & AT connect, serial connection does not exist 3 - Driver start & AT connect, serial connection not responding 4 - Driver connected, communication lost during session (powered down the mount)

1 - Driver start, mount not powered up

Dec 30 11:36:06 ZGAstroScope indiboot[4833]: 11:36:06.275548 indigo_server: LX200 Server Agent: Server started on 4030 Dec 30 11:37:56 ZGAstroScope indiboot[4833]: 11:37:56.836850 indigo_server: XML Parser: parser finished Dec 30 11:37:57 ZGAstroScope indiboot[4833]: 11:37:57.036260 indigo_server: indigo_mount_synscan: connected to /dev/rfcomm1 Dec 30 11:38:02 ZGAstroScope indiboot[4833]: 11:38:02.142346 indigo_server: indigo_mount_synscan[141, synscan_command, 0x7267c360]: SYNSCAN_TIMEOUT Dec 30 11:38:02 ZGAstroScope indiboot[4833]: 11:38:02.142514 indigo_server: indigo_mount_synscan[158, synscan_command, 0x7267c360]: Reading response failed Dec 30 11:38:02 ZGAstroScope indiboot[4833]: 11:38:02.242726 indigo_server: indigo_mount_synscan[127, synscan_command, 0x7267c360]: Sending command failed Dec 30 11:38:02 ZGAstroScope indiboot[4833]: 11:38:02.242891 indigo_server: indigo_mount_synscan[46, synscan_configure, 0x7267c360]: ERROR GETTING FIRMWARE … … powered up the mount and selected the driver again in AT … … Dec 30 11:38:57 ZGAstroScope indiboot[4833]: 11:38:57.256720 indigo_server: XML Parser: parser finished Dec 30 11:38:57 ZGAstroScope indiboot[4833]: 11:38:57.318835 indigo_server: indigo_mount_synscan: connected to /dev/rfcomm1

Observations:

  • In AT the user sees a message “Failed to connect to mount” for the first attempt
  • After the retry with the mount powered on, the user sees “connected to mount!”

Suggested improvements:

  • Functionally none, seems to work the way it should
  • Would be good to log a message in AT "Connected to /dev/rfcomm1..." first as well, to be able to distinguish between serial and mount issues
  • It would be more elegant to start the current connected message with a capital (as the other messages) and remove the exclamation mark (you should not “alert” a user to something normal or good)
  • If you could make this last message “Connected to mount …”, that would also be a good moment to set the driver properties “Mount -> Vendor” and “Mount -> Model” so they look correct in ICP

2 - Driver start, serial connection down

Dec 30 11:48:00 ZGAstroScope indiboot[4833]: 11:48:00.738003 indigo_server: indigo_mount_synscan[165, synscan_open, 0x7267c360]: failed to connect to /dev/rfcomm1a

Observations:

  • In AT the user sees a messages:
    • “/dev/rfcomm1a does not exist”
    • “Failed to connect tot /dev/rfcomm1a”
    • “Failed to connect to mount”

Suggested improvements:

  • Functionally none, works as it should
  • Style; maybe the first message could be extended a bit like “Serial port /dev/rfcomm1a does not exist”, so a first time / novice user knows what to fix (and will find in ICP easier)

2 - Driver start, serial connection not responding (removed BT2EQ dongle)

Dec 30 12:09:43 ZGAstroScope indiboot[4833]: 12:09:43.954420 indigo_server: XML Parser: parser finished Dec 30 12:09:44 ZGAstroScope indiboot[4833]: 12:09:44.027504 indigo_server: indigo_mount_synscan: connected to /dev/rfcomm1 Dec 30 12:09:49 ZGAstroScope indiboot[4833]: 12:09:49.151430 indigo_server: indigo_mount_synscan[141, synscan_command, 0x71cff360]: SYNSCAN_TIMEOUT Dec 30 12:09:49 ZGAstroScope indiboot[4833]: 12:09:49.151573 indigo_server: indigo_mount_synscan[158, synscan_command, 0x71cff360]: Reading response failed Dec 30 12:09:49 ZGAstroScope indiboot[4833]: 12:09:49.251785 indigo_server: indigo_mount_synscan[127, synscan_command, 0x71cff360]: Sending command failed Dec 30 12:09:49 ZGAstroScope indiboot[4833]: 12:09:49.251939 indigo_server: indigo_mount_synscan[46, synscan_configure, 0x71cff360]: ERROR GETTING FIRMWARE

Observations:

  • In AT the user sees a message “Failed to connect to mount”

Suggested improvements:

  • Functionally none, works as it should
  • It would be good to report "Connected to /dev/rfcomm1..." first, to point the user to the actual problem

4 - Driver connected, communication lost during session (powered down the mount)

Dec 30 11:23:17 ZGAstroScope indiboot[3767]: 11:23:17.798687 indigo_server: indigo_mount_synscan: connected to /dev/rfcomm1 Dec 30 11:23:22 ZGAstroScope indiboot[3767]: 11:23:22.733239 indigo_server: XML Parser: parser finished Dec 30 11:23:22 ZGAstroScope indiboot[3767]: 11:23:22.752859 indigo_server: XML Parser: parser finished Dec 30 11:23:59 ZGAstroScope indiboot[3767]: 11:23:59.742339 indigo_server: indigo_mount_synscan[141, synscan_command, 0x727ff360]: SYNSCAN_TIMEOUT <- powered down the mount Dec 30 11:23:59 ZGAstroScope indiboot[3767]: 11:23:59.742512 indigo_server: indigo_mount_synscan[158, synscan_command, 0x727ff360]: Reading response failed Dec 30 11:24:04 ZGAstroScope indiboot[3767]: 11:24:04.862310 indigo_server: indigo_mount_synscan[141, synscan_command, 0x727ff360]: SYNSCAN_TIMEOUT Dec 30 11:24:04 ZGAstroScope indiboot[3767]: 11:24:04.862452 indigo_server: indigo_mount_synscan[158, synscan_command, 0x727ff360]: Reading response failed Dec 30 11:24:09 ZGAstroScope indiboot[3767]: 11:24:09.982309 indigo_server: indigo_mount_synscan[141, synscan_command, 0x727ff360]: SYNSCAN_TIMEOUT Dec 30 11:24:09 ZGAstroScope indiboot[3767]: 11:24:09.982451 indigo_server: indigo_mount_synscan[158, synscan_command, 0x727ff360]: Reading response failed Dec 30 11:24:14 ZGAstroScope indiboot[3767]: 11:24:14.302618 indigo_server: indigo_mount_synscan[141, synscan_command, 0x727ff360]: SYNSCAN_TIMEOUT Dec 30 11:24:14 ZGAstroScope indiboot[3767]: 11:24:14.302767 indigo_server: indigo_mount_synscan[158, synscan_command, 0x727ff360]: Reading response failed Dec 30 11:24:14 ZGAstroScope indiboot[3767]: 11:24:14.906008 indigo_server: indigo_mount_synscan[127, synscan_command, 0x727ff360]: Sending command failed Dec 30 11:24:14 ZGAstroScope indiboot[3767]: 11:24:14.302767 indigo_server: indigo_mount_synscan[158, synscan_command, 0x727ff360]: Reading response failed Dec 30 11:24:14 ZGAstroScope indiboot[3767]: 11:24:14.906008 indigo_server: indigo_mount_synscan[127, synscan_command, 0x727ff360]: Sending command failed Dec 30 11:24:15 ZGAstroScope indiboot[3767]: 11:24:15.006298 indigo_server: indigo_mount_synscan[127, synscan_command, 0x727ff360]: Sending command failed Dec 30 11:24:15 ZGAstroScope indiboot[3767]: 11:24:15.609565 indigo_server: indigo_mount_synscan[127, synscan_command, 0x727ff360]: Sending command failed Dec 30 11:24:15 ZGAstroScope indiboot[3767]: 11:24:15.709895 indigo_server: indigo_mount_synscan[127, synscan_command, 0x727ff360]: Sending command failed … … Continues until i kill the driver … … Dec 30 11:24:34 ZGAstroScope indiboot[3767]: 11:24:34.734791 indigo_server: indigo_mount_synscan[127, synscan_command, 0x727ff360]: Sending command failed Dec 30 11:24:35 ZGAstroScope indiboot[3767]: 11:24:35.106894 indigo_server: Restarting... Dec 30 11:24:35 ZGAstroScope indiboot[3767]: 11:24:35.107966 indigo_server: Server detached

Observations:

  • There is no message in AT at all, so the user is not aware of the connection problems. This is not good.
  • The driver will report "0x727ff360]: Sending command failed “ in syslog until infinity but will not reconnect to the mount, once it is powered up again. So it would be better to stop trying.

Suggested improvements:

  • Report a message in AT “Communication to mount failed, retrying…” for each of the SYNSCAN_TIMEOUT events
  • After the 4 retries report a message in AT “Communication to mount lost…” and reinitialise/restart the driver after that (so it will disconnect from AT and the user can investigate the problem)

JohanBakk avatar Dec 30 '18 20:12 JohanBakk

I have a Orion SkyView Pro mount with a Synscan v5 handset (has USB jack). I see the same similar issues. I get SYNSCAN_TIMEOUT twice, then ERROR GETTING FIRMWARE. From what I can see in the code, it looks like the Skywatcher motor controller command set, but the synscan handset uses the serial communication protocol. I can connect to mount through usb cable to the synscan handset with SkySafari and a serial console. Both work as expected (drive the mount). I am confused as how one is supposed to connect the mount to use this driver.

cpmeadors avatar Sep 17 '19 02:09 cpmeadors

Also, trying to connect to the mount through PHD2 using the the synscan INDI driver frequently results in PHD2 and the INDIGO server to hang and a reboot is necessary to reset it.

cpmeadors avatar Sep 17 '19 02:09 cpmeadors

You're right, I'll fix it.

polakovic avatar Sep 17 '19 06:09 polakovic

Partially fixed in fc6f8421201b7704f03c78ec9bd7226adcd45ca8 and 4c0b01880e976bcbbd2206b11ccce037b8394871, but it turned to be more complicated I supposed. On UDP connection it may have a sense to wait and repeat, but on serial port once command failed, there is no easy and safe way how to recover.

polakovic avatar Sep 17 '19 18:09 polakovic

For UDP is makes sense to retry as network can be interrupted. Not sure if I would expect a serial physical connection to work the second time if it didn’t work the first time. It is most important to me that an appropriate error is returned and that the hard ware is release back in a good state so I can manually retry the connection.

cpmeadors avatar Sep 17 '19 20:09 cpmeadors

Yes, that is what I did. Whenever a communication error occurs and it is not UDP connection, message is sent and device is logically disconnected.

polakovic avatar Sep 18 '19 06:09 polakovic