Here's the latest attempt that seems to work (so far ;-)):

#!/bin/bash
HOME_DIR=/home/stellarmate
LOG_DIR=$HOME_DIR/.local/share/kstars/logs
MOUNT_NAME="iOptron CEM40"

LATEST_LOG_FILE=$(find $LOG_DIR -type f -exec ls -t1 {} + | head -1)
echo "Latest lof file: $LATEST_LOG_FILE"
while true
do
  latest_log_statement=$(tail -n 1 $LATEST_LOG_FILE)  
  if [[ $latest_log_statement = *'Input/output error'* ]]; then
      echo "Lost connection - reconnect..."
      indi_setprop "$MOUNT_NAME.CONNECTION.DISCONNECT=On"
      indi_setprop "$MOUNT_NAME.CONNECTION.CONNECT=On"
      sleep 2;
      indi_setprop "$MOUNT_NAME.TELESCOPE_PARK.PARK=Off"
      indi_setprop "$MOUNT_NAME.TELESCOPE_PARK.UNPARK=On"
      sleep 2;
      indi_setprop "$MOUNT_NAME.TELESCOPE_TRACK_STATE.TRACK_OFF=Off"
      indi_setprop "$MOUNT_NAME.TELESCOPE_TRACK_STATE.TRACK_ON=On"
  else
      echo "All OK"
  fi
  sleep 2;
done


Read More...

It seems none of these mount parameters changes during tracking, so I'm back on square one... :-(
Wonder if there is any other parameter in the system that changes?

iOptron CEM40.CONNECTION.CONNECT=On
iOptron CEM40.CONNECTION.DISCONNECT=Off
iOptron CEM40.DRIVER_INFO.DRIVER_NAME=iOptronV3
iOptron CEM40.DRIVER_INFO.DRIVER_EXEC=indi_ioptronv3_telescope
iOptron CEM40.DRIVER_INFO.DRIVER_VERSION=1.7
iOptron CEM40.DRIVER_INFO.DRIVER_INTERFACE=5
iOptron CEM40.POLLING_PERIOD.PERIOD_MS=1000
iOptron CEM40.DEBUG.ENABLE=Off
iOptron CEM40.DEBUG.DISABLE=On
iOptron CEM40.SIMULATION.ENABLE=Off
iOptron CEM40.SIMULATION.DISABLE=On
iOptron CEM40.CONFIG_PROCESS.CONFIG_LOAD=Off
iOptron CEM40.CONFIG_PROCESS.CONFIG_SAVE=Off
iOptron CEM40.CONFIG_PROCESS.CONFIG_DEFAULT=Off
iOptron CEM40.CONFIG_PROCESS.CONFIG_PURGE=Off
iOptron CEM40.CONNECTION_MODE.CONNECTION_SERIAL=On
iOptron CEM40.CONNECTION_MODE.CONNECTION_TCP=Off
iOptron CEM40.SYSTEM_PORTS.Pegasus_Astro_PPB_revE_PPB5A5OTE=Off
iOptron CEM40.SYSTEM_PORTS.Pegasus_Astro_FocusCube_2_PA5EJ6BM=Off
iOptron CEM40.SYSTEM_PORTS.FTDI_FT230X_Basic_UART_D309DKAF=Off
iOptron CEM40.DEVICE_PORT.PORT=/dev/mount
iOptron CEM40.DEVICE_BAUD_RATE.9600=Off
iOptron CEM40.DEVICE_BAUD_RATE.19200=Off
iOptron CEM40.DEVICE_BAUD_RATE.38400=Off
iOptron CEM40.DEVICE_BAUD_RATE.57600=Off
iOptron CEM40.DEVICE_BAUD_RATE.115200=On
iOptron CEM40.DEVICE_BAUD_RATE.230400=Off
iOptron CEM40.DEVICE_AUTO_SEARCH.INDI_ENABLED=Off
iOptron CEM40.DEVICE_AUTO_SEARCH.INDI_DISABLED=On
iOptron CEM40.DEVICE_PORT_SCAN.Scan Ports=Off
iOptron CEM40.ACTIVE_DEVICES.ACTIVE_GPS=GPS Simulator
iOptron CEM40.ACTIVE_DEVICES.ACTIVE_DOME=Dome Simulator
iOptron CEM40.DOME_POLICY.DOME_IGNORED=On
iOptron CEM40.DOME_POLICY.DOME_LOCKS=Off
iOptron CEM40.TELESCOPE_INFO.TELESCOPE_APERTURE=0
iOptron CEM40.TELESCOPE_INFO.TELESCOPE_FOCAL_LENGTH=0
iOptron CEM40.TELESCOPE_INFO.GUIDER_APERTURE=0
iOptron CEM40.TELESCOPE_INFO.GUIDER_FOCAL_LENGTH=0
iOptron CEM40.SCOPE_CONFIG_NAME.SCOPE_CONFIG_NAME=
iOptron CEM40.ON_COORD_SET.TRACK=On
iOptron CEM40.ON_COORD_SET.SLEW=Off
iOptron CEM40.ON_COORD_SET.SYNC=Off
iOptron CEM40.EQUATORIAL_EOD_COORD.RA=14.220802777777777237
iOptron CEM40.EQUATORIAL_EOD_COORD.DEC=32.298066666666663593
iOptron CEM40.TELESCOPE_ABORT_MOTION.ABORT=Off
iOptron CEM40.TELESCOPE_TRACK_MODE.TRACK_SIDEREAL=On
iOptron CEM40.TELESCOPE_TRACK_MODE.TRACK_LUNAR=Off
iOptron CEM40.TELESCOPE_TRACK_MODE.TRACK_SOLAR=Off
iOptron CEM40.TELESCOPE_TRACK_MODE.TRACK_KING=Off
iOptron CEM40.TELESCOPE_TRACK_MODE.TRACK_CUSTOM=Off
iOptron CEM40.TELESCOPE_TRACK_STATE.TRACK_ON=On
iOptron CEM40.TELESCOPE_TRACK_STATE.TRACK_OFF=Off
iOptron CEM40.TELESCOPE_TRACK_RATE.TRACK_RATE_RA=15.04106717867020393
iOptron CEM40.TELESCOPE_TRACK_RATE.TRACK_RATE_DE=0
iOptron CEM40.TELESCOPE_MOTION_NS.MOTION_NORTH=Off
iOptron CEM40.TELESCOPE_MOTION_NS.MOTION_SOUTH=Off
iOptron CEM40.TELESCOPE_MOTION_WE.MOTION_WEST=Off
iOptron CEM40.TELESCOPE_MOTION_WE.MOTION_EAST=Off
iOptron CEM40.TELESCOPE_REVERSE_MOTION.REVERSE_NS=Off
iOptron CEM40.TELESCOPE_REVERSE_MOTION.REVERSE_WE=Off
iOptron CEM40.TELESCOPE_SLEW_RATE.1x=Off
iOptron CEM40.TELESCOPE_SLEW_RATE.2x=Off
iOptron CEM40.TELESCOPE_SLEW_RATE.3x=Off
iOptron CEM40.TELESCOPE_SLEW_RATE.4x=Off
iOptron CEM40.TELESCOPE_SLEW_RATE.5x=Off
iOptron CEM40.TELESCOPE_SLEW_RATE.6x=Off
iOptron CEM40.TELESCOPE_SLEW_RATE.7x=Off
iOptron CEM40.TELESCOPE_SLEW_RATE.8x=Off
iOptron CEM40.TELESCOPE_SLEW_RATE.9x=On
iOptron CEM40.TARGET_EOD_COORD.RA=0
iOptron CEM40.TARGET_EOD_COORD.DEC=0
iOptron CEM40.TIME_UTC.UTC=2024-03-10T14:08:05
iOptron CEM40.TIME_UTC.OFFSET=1
iOptron CEM40.GEOGRAPHIC_COORD.LAT=57.70216666666667038
iOptron CEM40.GEOGRAPHIC_COORD.LONG=11.770833333333333925
iOptron CEM40.GEOGRAPHIC_COORD.ELEV=-10
iOptron CEM40.TELESCOPE_PARK.PARK=Off
iOptron CEM40.TELESCOPE_PARK.UNPARK=On
iOptron CEM40.TELESCOPE_PARK_POSITION.PARK_AZ=0
iOptron CEM40.TELESCOPE_PARK_POSITION.PARK_ALT=57.701943999999997459
iOptron CEM40.TELESCOPE_PARK_OPTION.PARK_CURRENT=Off
iOptron CEM40.TELESCOPE_PARK_OPTION.PARK_DEFAULT=Off
iOptron CEM40.TELESCOPE_PARK_OPTION.PARK_WRITE_DATA=Off
iOptron CEM40.TELESCOPE_PARK_OPTION.PARK_PURGE_DATA=Off
iOptron CEM40.TELESCOPE_PIER_SIDE.PIER_WEST=On
iOptron CEM40.TELESCOPE_PIER_SIDE.PIER_EAST=Off
iOptron CEM40.PEC.PEC OFF=On
iOptron CEM40.PEC.PEC ON=Off
iOptron CEM40.APPLY_SCOPE_CONFIG.SCOPE_CONFIG1=On
iOptron CEM40.APPLY_SCOPE_CONFIG.SCOPE_CONFIG2=Off
iOptron CEM40.APPLY_SCOPE_CONFIG.SCOPE_CONFIG3=Off
iOptron CEM40.APPLY_SCOPE_CONFIG.SCOPE_CONFIG4=Off
iOptron CEM40.APPLY_SCOPE_CONFIG.SCOPE_CONFIG5=Off
iOptron CEM40.APPLY_SCOPE_CONFIG.SCOPE_CONFIG6=Off
iOptron CEM40.USEJOYSTICK.ENABLE=Off
iOptron CEM40.USEJOYSTICK.DISABLE=On
iOptron CEM40.SNOOP_JOYSTICK.SNOOP_JOYSTICK_DEVICE=Joystick
iOptron CEM40.HOME.FindHome=Off
iOptron CEM40.HOME.SetCurrentAsHome=Off
iOptron CEM40.HOME.GoToHome=Off
iOptron CEM40.PEC_TRAINING.PEC_Recording=Off
iOptron CEM40.PEC_TRAINING.PEC_Status=Off
iOptron CEM40.PEC_INFOS.PEC_INFO=None
iOptron CEM40.TELESCOPE_TIMED_GUIDE_NS.TIMED_GUIDE_N=0
iOptron CEM40.TELESCOPE_TIMED_GUIDE_NS.TIMED_GUIDE_S=0
iOptron CEM40.TELESCOPE_TIMED_GUIDE_WE.TIMED_GUIDE_W=0
iOptron CEM40.TELESCOPE_TIMED_GUIDE_WE.TIMED_GUIDE_E=0
iOptron CEM40.GUIDE_RATE.RA_GUIDE_RATE=0.5
iOptron CEM40.GUIDE_RATE.DE_GUIDE_RATE=0.5
iOptron CEM40.Firmware Info.Model=CEM40
iOptron CEM40.Firmware Info.Board=210605
iOptron CEM40.Firmware Info.Controller=xxxxxx
iOptron CEM40.Firmware Info.RA=210420
iOptron CEM40.Firmware Info.DEC=210420
iOptron CEM40.GPS_STATUS.Off=On
iOptron CEM40.GPS_STATUS.On=Off
iOptron CEM40.GPS_STATUS.Data OK=Off
iOptron CEM40.TIME_SOURCE.RS232=Off
iOptron CEM40.TIME_SOURCE.Controller=On
iOptron CEM40.TIME_SOURCE.GPS=Off
iOptron CEM40.HEMISPHERE.South=Off
iOptron CEM40.HEMISPHERE.North=On
iOptron CEM40.Slew Type.Counterweight UP=Off
iOptron CEM40.Slew Type.Normal=On
iOptron CEM40.DaylightSaving.ON=Off
iOptron CEM40.DaylightSaving.OFF=On
iOptron CEM40.CWState.Up=Off
iOptron CEM40.CWState.Normal=On
iOptron CEM40.MERIDIAN_ACTION.IOP_MB_STOP=On
iOptron CEM40.MERIDIAN_ACTION.IOP_MB_FLIP=Off
iOptron CEM40.MERIDIAN_LIMIT.VALUE=4
iOptron CEM40.ACTIVE_DEVICES.ACTIVE_GPS=GPS Simulator
iOptron CEM40.ACTIVE_DEVICES.ACTIVE_DOME=Dome Simulator
iOptron CEM40.DOME_POLICY.DOME_IGNORED=On
iOptron CEM40.DOME_POLICY.DOME_LOCKS=Off
iOptron CEM40.TELESCOPE_INFO.TELESCOPE_APERTURE=0
iOptron CEM40.TELESCOPE_INFO.TELESCOPE_FOCAL_LENGTH=0
iOptron CEM40.TELESCOPE_INFO.GUIDER_APERTURE=0
iOptron CEM40.TELESCOPE_INFO.GUIDER_FOCAL_LENGTH=0
iOptron CEM40.SCOPE_CONFIG_NAME.SCOPE_CONFIG_NAME=
iOptron CEM40.USEJOYSTICK.ENABLE=Off
iOptron CEM40.USEJOYSTICK.DISABLE=On
iOptron CEM40.SNOOP_JOYSTICK.SNOOP_JOYSTICK_DEVICE=Joystick


Read More...

Sorry to say I discovered it only works in parked mode.
I need to find some other parameter that changes during tracking.

Read More...

I think I got it to work by checking if the RA coordinates changes.
I did like this:

while true
do
  result=$(indi_getprop "iOptron CEM40.EQUATORIAL_EOD_COORD.RA")
  sleep 2;
  previous_result=$result
  result=$(indi_getprop "iOptron CEM40.EQUATORIAL_EOD_COORD.RA")

  if [ "$result" = "$previous_result" ]; then
      echo "Lost connection - reconnect..."
	  indi_setprop 'iOptron CEM40.CONNECTION.DISCONNECT=On'
	  indi_setprop 'iOptron CEM40.CONNECTION.CONNECT=On'
  else
      echo "All OK"
  fi
done
Here's the output when I run it:
stellarmate@stellarmate:~ $ ./test.sh
All OK
All OK
All OK
All OK
Lost connection - reconnect...
All OK
All OK
All OK
^C


Read More...

Thanks for your response.
I tried this:

#!/bin/bash
HOME_DIR=/home/stellarmate
MOUNT_NAME="iOptron CEM40"
LOG_DIR=$HOME_DIR/.local/share/kstars/logs

tail -F -n 1 $LOG_DIR/*/* |
grep --line-buffered 'Input/output error' |
while read ; do echo 'connection error, disconnecting in 5';
sleep 5; indi_setprop "$MOUNT_NAME.CONNECTION.DISCONNECT=On" ;
echo 'disconnected, reconnecting again in 5' ;
###rm -Rf $LOG_DIR/*
sleep 5; indi_setprop "$MOUNT_NAME.CONNECTION.CONNECT=On" ;
echo 'connected again, monitoring for more errors'; done

And it works fine detecting the error and re-connect :-)
But then it seems it still finds the same error in infinity (see log below).
I also tried to delete the log in the script but that doesn't help either.
Is there maybe a way to poll the mount's status with some indi_getprop command instead?
stellarmate@stellarmate:~ $ ./test.sh
connection error, disconnecting in 5
disconnected, reconnecting again in 5
connected again, monitoring for more errors
connection error, disconnecting in 5
disconnected, reconnecting again in 5
connected again, monitoring for more errors
connection error, disconnecting in 5
disconnected, reconnecting again in 5
^C


Read More...

Thanks a lot Hnastro for sharing this script, I will definitely try it out.
One question; If there in an error statement in the log, will it not continue to call "indi_setprop" for infinity since the text is still in the log after the disconnect(reconnect?

Cheers,
// Åke

Read More...

Hi,

Thanks for all the great work!

It would be major robustness improvement if the USB connection with the mount would automatically try to reconnect istead of continously log this error:

"[ERROR] Write Command Error: Write Error: Input/output error "

I own an iOptron CEM40 that almost every night loses the USB connection.
For some reason it usually happens after a "big" slew, e.g. a meridian flip or when parking the mount.
I've for 3 years asked iOptron support for help but they continously push it back to me, asking me to replace cables, hubs, power supplies etc with no luck.

The mount is not dead when this happens, because I can move it with the hand controller, so it seems USB interface related.
I can also manually diconnect/connect from the INDI Control Panel and then it works again.

What normally happens is that when I wake up in the morning there are no photos after a meridian flip.
Instead of received a lot of images, the UI is really sluggy, probably due to filling up the memory with thousands of log statements?

So an automatic diconnect/connect would really, really help! :-)

Cheers,
// Åke

Read More...

Hi,

No good experience with the CEM40 for me, sorry to say.

I replaced my Skywatcher HEQ5 Pro with a CEM40 (not CE) in May 2021.
It's a great mechanical construction but I've had a lot of USB connection error problems with it.
Since purchase I probably have had no more than 2 nights without trouble.

I've changed internal USB cable, as adviced by iOptron (had to buy it from iOptron!) but no luck.
They also asked me to replace the power supply, so I replaced with a more powerful supply (10 amps instead of the supplied 1.5 amps one).
Again, I had to purchase it. No luck.

I've tried different USB hubs, powered and non-powered. Replaced the external USB cable multiple times.

At one point iOptron suggested me to try the StarFi Wifi module that connects to the HBX port instead of the USB port.
So I purchased one (again...). It worked for controlling the slew, but it turned out you can't use it for guiding correction, which basically makes it useless for astrophotography.
Today I see they have updated their web pages with the text "NOT for CEM40 or GEM45 series mount", which was not there before.

iOptron continously push the problem back to me, also suggesting to use a PC instead of rPI/Stellarmate.
If they were serious I would expect them to send me a replacement mount but it hasn't happened yet.

I had no problem whatsoever with the HEQ5 so I actually kind of regret selling it. I really thought the CEM40 would be an upgrade, but no, not for me at least.
Maybe I've just had bad luck with my mount, but the many wasted photo nights and long mail conversations with iOptron and wasted purchases with no resolution almost have made me lose my interest for the hobby :-(

Would I buy another iOptron? No, sorry to say.

// Åke

Read More...

Åke Liljenberg replied to the topic 'turn on meridian flip?' in the forum. 2 years ago

I faced the same issue today. Is the bug still there? Does it mean there will be no meridian flip or is the status message just nonsense?
Cheers, Åke

Read More...

I posted a request to StellarMate support and suggested to reconnect if the connection is lost. They will consider implementing it.
Meanwhile I will try the iStarFi Wi-Fi Adapter and see if that resolves the issue.

Read More...

Hi,
I have severe problems with driver disconnects and I suspect it's due to the USB-B connector in the mount.
I saw this: iStarFi Wi-Fi Adapter for CEM40/GEM45
Is it reliable? Does it work for controlling the mount with the INDI drivers?
If so, it would make my life a bit easier!
Cheers.
// Åke

Read More...

Thanks for your info and thoughts. Yes, I suspect it can be the connector. I actually had to replace the cable once before due to this.
I tried to provoke it yesterday manually but didn't succeed to disconnect it (unless I almost plugged it out).
It's not fun when it happens during an unattended photo session...

Could it maybe be possible to make the driver more robust and less sensitive to short disconnects?
Because if I manage to disconnect it, it will not reconnect again, but rather get stuck in the endless "Write Error" loop.

Not sure who developed this driver, does anyone know? Could be worth a try to discuss with him/her/them.
Or is it open source? Maybe I could look into it myself.

Read More...

Hi,
Not after every night but often enough I wake up to find that I lost half of the night's lights due to lost connection with the iOptron mount right after the meridian flip.
Unfortunately I don't have a verbose log, but perhaps the below can help?
It started to behave like this after the latest software update. I'm currently on Stellarmate SM-110 Version 1.7.2.

[2022-09-05T02:44:36.601 CEST INFO ][ org.kde.kstars.indi] - ZWO CCD ASI2600MC Pro : "[INFO] Taking a 300 seconds frame... "
[2022-09-05T02:45:33.340 CEST INFO ][ org.kde.kstars.ekos.mount] - "Meridian flip waiting."
[2022-09-05T02:49:37.707 CEST INFO ][ org.kde.kstars.indi] - ZWO CCD ASI2600MC Pro : "[INFO] Exposure done, downloading image... "
[2022-09-05T02:49:37.766 CEST INFO ][ org.kde.kstars.indi] - ZWO CCD ASI2600MC Pro : "[INFO] Download complete. "
[2022-09-05T02:49:38.190 CEST INFO ][ org.kde.kstars.indi] - "FITS" file saved to "/home/stellarmate/Pictures/Light/Light_058.fits"
[2022-09-05T02:49:38.712 CEST INFO ][ org.kde.kstars.ekos.capture] - "Download Time: 0.71 s, New Download Time Estimate: 0.68 s."
[2022-09-05T02:49:39.480 CEST INFO ][ org.kde.kstars.ekos.capture] - "Received image 29 out of 65."
[2022-09-05T02:49:39.488 CEST INFO ][ org.kde.kstars.ekos.capture] - "Captured /home/stellarmate/Pictures/Light/Light_058.fits"
[2022-09-05T02:49:39.669 CEST INFO ][ org.kde.kstars.ekos.mount] - Meridian flip: slewing to RA= "00h 22m 58s" DEC= " 61° 48' 56\"" Hour Angle "00h 00m 41s"
[2022-09-05T02:49:39.669 CEST INFO ][ org.kde.kstars.ekos.mount] - "Meridian flip started."
[2022-09-05T02:49:39.700 CEST INFO ][ org.kde.kstars.ekos.guide] - "Autoguiding aborted."
[2022-09-05T02:49:39.728 CEST INFO ][ org.kde.kstars.ekos.align] - Target updated to JNow RA: "00h 22m 58s" DE: " 61° 48' 56\""
[2022-09-05T02:49:39.733 CEST INFO ][ org.kde.kstars.ekos.mount] - "Meridian flip slew started..."
[2022-09-05T02:49:39.842 CEST INFO ][ org.kde.kstars.indi] - iOptron CEM40 : "[INFO] Slewing to RA: 0:22:58 - DEC: 61:48:56 "
[2022-09-05T02:49:40.572 CEST INFO ][ org.kde.kstars.ekos.guide] - "Mount is moving. Resetting calibration..."
[2022-09-05T02:49:40.588 CEST INFO ][ org.kde.kstars.ekos.guide] - "Calibration is cleared."
[2022-09-05T02:50:13.810 CEST INFO ][ org.kde.kstars.indi] - iOptron CEM40 : "[ERROR] bool IOPv3::Driver::getCoords(double*, double*, IOPv3::IOP_PIER_STATE*, IOPv3::IOP_CW_STATE*): Expected 20 bytes but received 0. "
[2022-09-05T02:50:14.814 CEST INFO ][ org.kde.kstars.indi] - iOptron CEM40 : "[ERROR] Write Command Error: Write Error: Input/output error "
[2022-09-05T02:50:14.819 CEST INFO ][ org.kde.kstars.indi] - iOptron CEM40 : "[ERROR] Write Command Error: Write Error: Input/output error "
...
And the "Write Error" continues forever.

Any ideas? Since I ran out of ideas I'm planning on trying to control the mount through the HBX connector instead of through USB, what do you think, could that be more stable?

Cheers,
// Åke

Read More...