From 2a1c8113be6d0b7b6ef552067f7317bb7b107dde Mon Sep 17 00:00:00 2001 From: gnthibault Date: Fri, 28 Jul 2023 22:16:14 +0200 Subject: [PATCH 1/7] WIP --- conf_files/config.yaml | 140 ++++++++++++++--------------------------- 1 file changed, 46 insertions(+), 94 deletions(-) diff --git a/conf_files/config.yaml b/conf_files/config.yaml index dd54c10..d20aed1 100644 --- a/conf_files/config.yaml +++ b/conf_files/config.yaml @@ -22,16 +22,12 @@ observatory: # webcam: # rtsp_url: rtsp://user:password@192.168.0.16 scope_controller: - module: DummyScopeController #IndiArduiScopeController - port: /dev/ttyACM0 - controller_name: Arduino - indi_driver_connect_delay_s: 5 - indi_camera_driver_name: Canon DSLR - indi_mount_driver_name: Losmandy Gemini - indi_webserver_host: 192.168.0.33 + module: AggregatedCustomScopeController #DummyScopeController + port: /dev/serial/by-id/usb-Pegasus_Astro_UPBv2_revD_UPB25S4VWV-if00-port0 + indi_webserver_host: 192.168.0.176 indi_webserver_port: 8624 indi_client : - indi_host : localhost + indi_host : 192.168.0.176 indi_port : 7624 dome_controller: module : IndiDomeController @@ -81,39 +77,17 @@ calibration: #module: IndiSpectroController #controller_name: spox mount: - #module: IndiG11 - #mount_name: Losmandy Gemini - module: IndiAbstractMount - mount_name : Telescope Simulator + module: IndiG11 + mount_name: Losmandy Gemini equatorial_eod: J2000 # JNOW - is_simulator: true indi_client : - indi_host : localhost + indi_host : 192.168.0.176 indi_port : 7624 cameras: - - module: IndiAbstractCameraSimulator - camera_name : Guide Simulator + module: IndiASICamera + camera_name : ZWO CCD ASI290MM Mini do_acquisition: false - SIMULATOR_SETTINGS: # 290MM - SIM_XRES: 1936 # - SIM_YRES: 1096 # - SIM_XSIZE: 2.9 #2.9 - SIM_YSIZE: 2.9 #2.9 - SIM_MAXVAL: 65000 - SIM_SATURATION: 1 - SIM_LIMITINGMAG: 17 - SIM_NOISE: 0 - SIM_SKYGLOW: 19.5 - SIM_OAGOFFSET: 0 - SIM_POLAR: 0 - SIM_POLARDRIFT: 0 - SIM_ROTATION: 0 - SIM_KING_GAMMA: 0 - SIM_KING_THETA: 0 - # SIM_PEPERIOD: 0 - # SIM_PEMAX: 0 - SIM_TIME_FACTOR: 1 SCOPE_INFO: # 200/800 newtonian FOCAL_LENGTH: 800 APERTURE: 200 @@ -128,7 +102,7 @@ cameras: do_autofocus: false autofocus_seconds: 4 autofocus_roi_size : 750 - autofocus_merit_function: half_flux_radius #vollath_F4 + autofocus_merit_function: half_flux_radius # focuser: # module: IndiFocuser # focuser_name: Focuser Simulator @@ -146,16 +120,13 @@ cameras: # indi_host: localhost # indi_port: 7624 indi_client : - indi_host : localhost + indi_host : 192.168.0.176 indi_port : 7624 #use_unique_client: True - module: IndiAbstractCameraSimulator - camera_name : CCD Simulator + camera_name : TODO TN URGENT do_acquisition: true - #module: IndiEos6DCamera - #camera_name: Canon DSLR EOS 6D - #camera_name: GPhoto CCD # CCD_INFO : # CCD_MAX_X : 5496 # CCD_MAX_Y : 3672 @@ -163,25 +134,6 @@ cameras: # CCD_PIXEL_SIZE_X : 2.4 # CCD_PIXEL_SIZE_Y : 2.4 # CCD_BITSPERPIXEL : 12 - SIMULATOR_SETTINGS: # 180mm - SIM_XRES: 1500 #5496 - SIM_YRES: 1500 #3672 - SIM_XSIZE: 4.8 #2.4 - SIM_YSIZE: 4.8 #2.4 - SIM_MAXVAL: 65000 - SIM_SATURATION: 1 - SIM_LIMITINGMAG: 17 - SIM_NOISE: 0 - SIM_SKYGLOW: 19.5 - SIM_OAGOFFSET: 0 - SIM_POLAR: 0 - SIM_POLARDRIFT: 0 - SIM_ROTATION: 0 - # SIM_KING_GAMMA: 0 - # SIM_KING_THETA: 0 - SIM_PEPERIOD: 0 - SIM_PEMAX: 0 - SIM_TIME_FACTOR: 1 SCOPE_INFO: # 200/800 newtonian FOCAL_LENGTH: 800 APERTURE: 200 @@ -197,40 +149,40 @@ cameras: autofocus_seconds: 5 autofocus_roi_size : 750 autofocus_merit_function : half_flux_radius #vollath_F4 - focuser: - module: IndiFocuser - focuser_name: Focuser Simulator - port: /dev/ttyUSB0 - focus_range: - min: 32500 - max: 40000 - autofocus_step: - fine: 750 - coarse: 2500 - autofocus_range: - fine: 10000 - coarse: 30000 - indi_client: - indi_host: localhost - indi_port: 7624 - do_filter_wheel: false - filter_wheel: - module: IndiFilterWheel - filterwheel_name: Filter Simulator - filter_list: - Luminance: 1 - Red: 2 - Green: 3 - Blue: 4 - H_Alpha: 5 - OIII: 6 - SII: 7 - LPR: 8 - indi_client: - indi_host: localhost - indi_port: 7624 + #focuser: + # module: IndiFocuser + # focuser_name: Focuser Simulator + # port: /dev/ttyUSB0 + # focus_range: + # min: 32500 + # max: 40000 + # autofocus_step: + # fine: 750 + # coarse: 2500 + # autofocus_range: + # fine: 10000 + # coarse: 30000 + # indi_client: + # indi_host: localhost + # indi_port: 7624 + #do_filter_wheel: false + #filter_wheel: + # module: IndiFilterWheel + # filterwheel_name: Filter Simulator + # filter_list: + # Luminance: 1 + # Red: 2 + # Green: 3 + # Blue: 4 + # H_Alpha: 5 + # OIII: 6 + # SII: 7 + # LPR: 8 + # indi_client: + # indi_host: localhost + # indi_port: 7624 indi_client : - indi_host : localhost + indi_host : 192.168.0.176 indi_port : 7624 pointer: module: DifferentialPointer #DifferentialPointer #IterativeSync @@ -250,7 +202,7 @@ guider: host : localhost port : 4400 do_calibration : False - profile_name : Simulator + profile_name : TODO TN URGENT exposure_time_sec : 4 settle : pixels : 1.5 From da469cdaa69231370d43abe49126d72271d3c089 Mon Sep 17 00:00:00 2001 From: gnthibault Date: Sat, 29 Jul 2023 00:47:59 +0200 Subject: [PATCH 2/7] WIP --- Mount/IndiG11.py | 148 +++++++++++++++++++++++++++++++++-- apps/launch_backyard_conf.sh | 5 ++ conf_files/config.yaml | 38 ++++----- 3 files changed, 167 insertions(+), 24 deletions(-) diff --git a/Mount/IndiG11.py b/Mount/IndiG11.py index 96dbd1e..e65b045 100644 --- a/Mount/IndiG11.py +++ b/Mount/IndiG11.py @@ -75,21 +75,158 @@ class IndiG11(IndiAbstractMount): Related to meridian flip: https://indilib.org/forum/mounts/3550-losmandy-gemini-2-auto-meridian-flip-in-ekos.html https://www.indilib.org/forum/mounts/7946-losmandy-g-11-and-gemini-ii-and-merdian-flips.html + + Losmandy Gemini.CONNECTION.CONNECT=On + Losmandy Gemini.CONNECTION.DISCONNECT=Off + Losmandy Gemini.DRIVER_INFO.DRIVER_NAME=Losmandy Gemini + Losmandy Gemini.DRIVER_INFO.DRIVER_EXEC=indi_lx200gemini + Losmandy Gemini.DRIVER_INFO.DRIVER_VERSION=1.6 + Losmandy Gemini.DRIVER_INFO.DRIVER_INTERFACE=5 + Losmandy Gemini.POLLING_PERIOD.PERIOD_MS=1000 + Losmandy Gemini.DEBUG.ENABLE=Off + Losmandy Gemini.DEBUG.DISABLE=On + Losmandy Gemini.SIMULATION.ENABLE=Off + Losmandy Gemini.SIMULATION.DISABLE=On + Losmandy Gemini.CONFIG_PROCESS.CONFIG_LOAD=Off + Losmandy Gemini.CONFIG_PROCESS.CONFIG_SAVE=Off + Losmandy Gemini.CONFIG_PROCESS.CONFIG_DEFAULT=Off + Losmandy Gemini.CONFIG_PROCESS.CONFIG_PURGE=Off + Losmandy Gemini.CONNECTION_MODE.CONNECTION_SERIAL=Off + Losmandy Gemini.CONNECTION_MODE.CONNECTION_TCP=On + Losmandy Gemini.DEVICE_ADDRESS.ADDRESS=192.168.8.63 + Losmandy Gemini.DEVICE_ADDRESS.PORT=11110 + Losmandy Gemini.CONNECTION_TYPE.TCP=Off + Losmandy Gemini.CONNECTION_TYPE.UDP=On + Losmandy Gemini.DEVICE_LAN_SEARCH.INDI_ENABLED=Off + Losmandy Gemini.DEVICE_LAN_SEARCH.INDI_DISABLED=On + Losmandy Gemini.ACTIVE_DEVICES.ACTIVE_GPS=GPS Simulator + Losmandy Gemini.ACTIVE_DEVICES.ACTIVE_DOME=Dome Simulator + Losmandy Gemini.DOME_POLICY.DOME_IGNORED=On + Losmandy Gemini.DOME_POLICY.DOME_LOCKS=Off + Losmandy Gemini.TELESCOPE_INFO.TELESCOPE_APERTURE=200 + Losmandy Gemini.TELESCOPE_INFO.TELESCOPE_FOCAL_LENGTH=800 + Losmandy Gemini.TELESCOPE_INFO.GUIDER_APERTURE=200 + Losmandy Gemini.TELESCOPE_INFO.GUIDER_FOCAL_LENGTH=800 + Losmandy Gemini.SCOPE_CONFIG_NAME.SCOPE_CONFIG_NAME= + Losmandy Gemini.STARTUP_MODE.COLD_START=On + Losmandy Gemini.STARTUP_MODE.WARM_START=Off + Losmandy Gemini.STARTUP_MODE.WARM_RESTART=Off + Losmandy Gemini.ON_COORD_SET.TRACK=On + Losmandy Gemini.ON_COORD_SET.SLEW=Off + Losmandy Gemini.ON_COORD_SET.SYNC=Off + Losmandy Gemini.ON_COORD_SET.FLIP=Off + Losmandy Gemini.EQUATORIAL_EOD_COORD.RA=8.0608333333333348492 + Losmandy Gemini.EQUATORIAL_EOD_COORD.DEC=85.342777777777769188 + Losmandy Gemini.TELESCOPE_ABORT_MOTION.ABORT=Off + Losmandy Gemini.TELESCOPE_TRACK_MODE.TRACK_SIDEREAL=On + Losmandy Gemini.TELESCOPE_TRACK_MODE.TRACK_CUSTOM=Off + Losmandy Gemini.TELESCOPE_TRACK_MODE.TRACK_LUNAR=Off + Losmandy Gemini.TELESCOPE_TRACK_MODE.TRACK_SOLAR=Off + Losmandy Gemini.TELESCOPE_TRACK_STATE.TRACK_ON=On + Losmandy Gemini.TELESCOPE_TRACK_STATE.TRACK_OFF=Off + Losmandy Gemini.TELESCOPE_MOTION_NS.MOTION_NORTH=Off + Losmandy Gemini.TELESCOPE_MOTION_NS.MOTION_SOUTH=Off + Losmandy Gemini.TELESCOPE_MOTION_WE.MOTION_WEST=Off + Losmandy Gemini.TELESCOPE_MOTION_WE.MOTION_EAST=Off + Losmandy Gemini.TELESCOPE_REVERSE_MOTION.REVERSE_NS=Off + Losmandy Gemini.TELESCOPE_REVERSE_MOTION.REVERSE_WE=Off + Losmandy Gemini.TELESCOPE_SLEW_RATE.1x=Off + Losmandy Gemini.TELESCOPE_SLEW_RATE.2x=Off + Losmandy Gemini.TELESCOPE_SLEW_RATE.3x=On + Losmandy Gemini.TELESCOPE_SLEW_RATE.4x=Off + Losmandy Gemini.TARGET_EOD_COORD.RA=8.0608333333333348492 + Losmandy Gemini.TARGET_EOD_COORD.DEC=87.213611111111120522 + Losmandy Gemini.TIME_UTC.UTC=2023-07-28T22:17:12 + Losmandy Gemini.TIME_UTC.OFFSET=2 + Losmandy Gemini.GEOGRAPHIC_COORD.LAT=46.233055555555559124 + Losmandy Gemini.GEOGRAPHIC_COORD.LONG=6.0666666666666664298 + Losmandy Gemini.GEOGRAPHIC_COORD.ELEV=418.04998799999998482 + Losmandy Gemini.TELESCOPE_PARK.PARK=Off + Losmandy Gemini.TELESCOPE_PARK.UNPARK=On + Losmandy Gemini.TELESCOPE_PIER_SIDE.PIER_WEST=Off + Losmandy Gemini.TELESCOPE_PIER_SIDE.PIER_EAST=On + Losmandy Gemini.PEC.PEC OFF=On + Losmandy Gemini.PEC.PEC ON=Off + Losmandy Gemini.APPLY_SCOPE_CONFIG.SCOPE_CONFIG1=On + Losmandy Gemini.APPLY_SCOPE_CONFIG.SCOPE_CONFIG2=Off + Losmandy Gemini.APPLY_SCOPE_CONFIG.SCOPE_CONFIG3=Off + Losmandy Gemini.APPLY_SCOPE_CONFIG.SCOPE_CONFIG4=Off + Losmandy Gemini.APPLY_SCOPE_CONFIG.SCOPE_CONFIG5=Off + Losmandy Gemini.APPLY_SCOPE_CONFIG.SCOPE_CONFIG6=Off + Losmandy Gemini.USEJOYSTICK.ENABLE=Off + Losmandy Gemini.USEJOYSTICK.DISABLE=On + Losmandy Gemini.SNOOP_JOYSTICK.SNOOP_JOYSTICK_DEVICE=Joystick + Losmandy Gemini.Use Pulse Cmd.Off=Off + Losmandy Gemini.Use Pulse Cmd.On=On + Losmandy Gemini.Sites.Site 1=On + Losmandy Gemini.Sites.Site 2=Off + Losmandy Gemini.Sites.Site 3=Off + Losmandy Gemini.Sites.Site 4=Off + Losmandy Gemini.Site Name.Name=Hollywood + Losmandy Gemini.TELESCOPE_TIMED_GUIDE_NS.TIMED_GUIDE_N=0 + Losmandy Gemini.TELESCOPE_TIMED_GUIDE_NS.TIMED_GUIDE_S=0 + Losmandy Gemini.TELESCOPE_TIMED_GUIDE_WE.TIMED_GUIDE_W=0 + Losmandy Gemini.TELESCOPE_TIMED_GUIDE_WE.TIMED_GUIDE_E=0 + Losmandy Gemini.Firmware Info.Build Date=Mar 12 2017 + Losmandy Gemini.Firmware Info.Build Time=08:22:00 + Losmandy Gemini.Firmware Info.Software Level=5.21 + Losmandy Gemini.Firmware Info.Product Name=Losmandy Gemini + Losmandy Gemini.Firmware Info.= + Losmandy Gemini.PARK_SETTINGS.HOME=On + Losmandy Gemini.PARK_SETTINGS.STARTUP=Off + Losmandy Gemini.PARK_SETTINGS.ZENITH=Off + Losmandy Gemini.ENABLE_PEC_AT_BOOT.ENABLE_PEC_AT_BOOT=On + Losmandy Gemini.PEC_GUIDING_SPEED.PEC_GUIDING_SPEED=0.5 + Losmandy Gemini.PEC_COMMANDS.PEC_START_TRAINING=Off + Losmandy Gemini.PEC_COMMANDS.PEC_ABORT_TRAINING=Off + Losmandy Gemini.PEC_COUNTER.PEC_COUNTER=318 + Losmandy Gemini.PEC_MAX_STEPS.PEC_MAX_STEPS=6400 + Losmandy Gemini.PEC_STATE.PEC_STATUS_ACTIVE=No + Losmandy Gemini.PEC_STATE.PEC_STATUS_FRESH_TRAINED=No + Losmandy Gemini.PEC_STATE.PEC_STATUS_TRAINING_IN_PROGRESS=No + Losmandy Gemini.PEC_STATE.PEC_STATUS_TRAINING_COMPLETED=No + Losmandy Gemini.PEC_STATE.PEC_STATUS_WILL_TRAIN=No + Losmandy Gemini.PEC_STATE.PEC_STATUS_DATA_AVAILABLE=No + Losmandy Gemini.SET_CURR_SAFETY.SET_SAFETY=Off + Losmandy Gemini.SAFETY_LIMITS.EAST_SAFTEY=114 + Losmandy Gemini.SAFETY_LIMITS.WEST_SAFTEY=123 + Losmandy Gemini.SAFETY_LIMITS.WEST_GOTO=2.5 + Losmandy Gemini.MANUAL_SLEWING_SPEED.MANUAL_SLEWING_SPEED=800 + Losmandy Gemini.GOTO_SLEWING_SPEED.GOTO_SLEWING_SPEED=800 + Losmandy Gemini.MOVE_SLEWING_SPEED.MOVE_SPEED=500 + Losmandy Gemini.GUIDING_SLEWING_SPEED_BOTH.GUIDING_SPEED=0.5 + Losmandy Gemini.GUIDE_RATE.GUIDE_RATE_WE=0.5 + Losmandy Gemini.GUIDE_RATE.GUIDE_RATE_NS=0.5 + Losmandy Gemini.CENTERING_SLEWING_SPEED.CENTERING_SPEED=20 + Losmandy Gemini.ACTIVE_DEVICES.ACTIVE_GPS=GPS Simulator + Losmandy Gemini.ACTIVE_DEVICES.ACTIVE_DOME=Dome Simulator + Losmandy Gemini.DOME_POLICY.DOME_IGNORED=On + Losmandy Gemini.DOME_POLICY.DOME_LOCKS=Off + Losmandy Gemini.TELESCOPE_INFO.TELESCOPE_APERTURE=200 + Losmandy Gemini.TELESCOPE_INFO.TELESCOPE_FOCAL_LENGTH=800 + Losmandy Gemini.TELESCOPE_INFO.GUIDER_APERTURE=200 + Losmandy Gemini.TELESCOPE_INFO.GUIDER_FOCAL_LENGTH=800 + Losmandy Gemini.SCOPE_CONFIG_NAME.SCOPE_CONFIG_NAME= + Losmandy Gemini.USEJOYSTICK.ENABLE=Off + Losmandy Gemini.USEJOYSTICK.DISABLE=On + Losmandy Gemini.SNOOP_JOYSTICK.SNOOP_JOYSTICK_DEVICE=Joystick + Losmandy Gemini.STARTUP_MODE.COLD_START=On + Losmandy Gemini.STARTUP_MODE.WARM_START=Off + Losmandy Gemini.STARTUP_MODE.WARM_RESTART=Off """ - def __init__(self, indi_client, location, serv_time, config): + def __init__(self, location, serv_time, config): if config is None: config = dict(mount_name="Losmandy Gemini") - super().__init__(indi_client=indi_client, - location=location, + super().__init__(location=location, serv_time=serv_time, config=config, connect_on_create=False) - self.set_startup_mode(mode='WARM_RESTART') self.connect() + self.set_startup_mode(mode='WARM_RESTART') self.set_park_settings(mode='HOME') #TODO TN URGENT as a temporary fix. we decided to park at startup but # the proper behaviour for the mount should be parked status by default @@ -103,7 +240,8 @@ def set_startup_mode(self, mode='WARM_RESTART'): WARM_START WARM_RESTART """ - self.set_switch('STARTUP_MODE', [mode]) + self.set_switch('STARTUP_MODE', [mode], sync=True, timeout=self.defaultTimeout) + def set_park_settings(self, mode='HOME'): """ diff --git a/apps/launch_backyard_conf.sh b/apps/launch_backyard_conf.sh index 1137be3..bbeffc7 100755 --- a/apps/launch_backyard_conf.sh +++ b/apps/launch_backyard_conf.sh @@ -8,3 +8,8 @@ indiserver indi_lx200gemini indi_canon_ccd indi_asi_ccd # To tunnel connections to remote host # ssh -L 8624:192.168.8.247:8624 192.168.0.176 # ssh -L 7624:192.168.8.247:7624 192.168.0.176 + +# Another config also with ssh tunnel +# ssh -L 7625:192.168.8.247:7624 192.168.8.247 +# ssh -L 8624:192.168.8.247:8624 192.168.8.247 +# ssh -L 4400:192.168.8.247:4400 192.168.8.247 diff --git a/conf_files/config.yaml b/conf_files/config.yaml index d20aed1..de7dd6b 100644 --- a/conf_files/config.yaml +++ b/conf_files/config.yaml @@ -22,20 +22,20 @@ observatory: # webcam: # rtsp_url: rtsp://user:password@192.168.0.16 scope_controller: - module: AggregatedCustomScopeController #DummyScopeController + module: DummyScopeController #AggregatedCustomScopeController #DummyScopeController port: /dev/serial/by-id/usb-Pegasus_Astro_UPBv2_revD_UPB25S4VWV-if00-port0 - indi_webserver_host: 192.168.0.176 + indi_webserver_host: localhost indi_webserver_port: 8624 indi_client : - indi_host : 192.168.0.176 - indi_port : 7624 + indi_host : localhost + indi_port : 7625 dome_controller: module : IndiDomeController dome_movement_timeout_s: 300 dome_name: Dome Simulator indi_client : indi_host : localhost - indi_port : 7624 + indi_port : 7625 directories: base: /var/RemoteObservatory images: images @@ -81,8 +81,8 @@ mount: mount_name: Losmandy Gemini equatorial_eod: J2000 # JNOW indi_client : - indi_host : 192.168.0.176 - indi_port : 7624 + indi_host : localhost + indi_port : 7625 cameras: - module: IndiASICamera @@ -118,14 +118,14 @@ cameras: # coarse: 30000 # indi_client: # indi_host: localhost -# indi_port: 7624 +# indi_port: 7625 indi_client : - indi_host : 192.168.0.176 - indi_port : 7624 + indi_host : localhost + indi_port : 7625 #use_unique_client: True - - module: IndiAbstractCameraSimulator - camera_name : TODO TN URGENT + module: IndiAbstractCamera + camera_name : PlayerOne CCD Ares-M PRO do_acquisition: true # CCD_INFO : # CCD_MAX_X : 5496 @@ -164,7 +164,7 @@ cameras: # coarse: 30000 # indi_client: # indi_host: localhost - # indi_port: 7624 + # indi_port: 7625 #do_filter_wheel: false #filter_wheel: # module: IndiFilterWheel @@ -180,10 +180,10 @@ cameras: # LPR: 8 # indi_client: # indi_host: localhost - # indi_port: 7624 + # indi_port: 7625 indi_client : - indi_host : 192.168.0.176 - indi_port : 7624 + indi_host : localhost + indi_port : 7625 pointer: module: DifferentialPointer #DifferentialPointer #IterativeSync gen_hips: False @@ -199,10 +199,10 @@ offset_pointer: on_star_identification_failure: trust_astrometry # get_brightest or trust_astrometry guider: module : GuiderPHD2 - host : localhost + host : 127.0.0.1 port : 4400 do_calibration : False - profile_name : TODO TN URGENT + profile_name : backyard exposure_time_sec : 4 settle : pixels : 1.5 @@ -228,7 +228,7 @@ weather_service : MAX_WEATHER_CLOUD_COVER : 5 indi_client : indi_host : localhost - indi_port : 7624 + indi_port : 7625 vizualization_service: module: SceneVizualization delay_sky_update_s: 1 From fcf289c42bdad0dfa34913facf749ad5f77aa908 Mon Sep 17 00:00:00 2001 From: gnthibault Date: Sat, 29 Jul 2023 01:18:27 +0200 Subject: [PATCH 3/7] going forward with backyard setup --- infrastructure/phd2.service | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/infrastructure/phd2.service b/infrastructure/phd2.service index 255f712..eef8531 100644 --- a/infrastructure/phd2.service +++ b/infrastructure/phd2.service @@ -2,6 +2,7 @@ # Should be put in /etc/systemd/system/ # Then run # sudo systemctl daemon-reload +# sudo systemctl enable phd2.service # sudo systemctl restart phd2.service # sudo systemctl status phd2.service @@ -15,7 +16,7 @@ After=multi-user.target Type=idle User=gnthibault Environment=LD_LIBRARY_PATH=/usr/local/lib:/usr/lib -Environment="DISPLAY=:0" +Environment="DISPLAY=:10" # "XAUTHORITY=/home/gnthibault/.Xauthority" ExecStartPre=rm -f /home/gnthibault/phd2.1 ExecStart=/usr/bin/phd2 From a45ba3526ef938decc77e7bfcb4427207ee6aa93 Mon Sep 17 00:00:00 2001 From: gnthibault Date: Tue, 1 Aug 2023 18:24:08 +0200 Subject: [PATCH 4/7] WIP --- .../AggregatedCustomScopeController.py | 100 +++++++++++------- apps/launch_backyard_conf.sh | 6 +- .../AggregatedCustomScopeController.py | 63 +++++------ conf_files/config.yaml | 68 ++++++++++-- conf_files/targets.yaml | 60 ----------- 5 files changed, 160 insertions(+), 137 deletions(-) diff --git a/Observatory/AggregatedCustomScopeController.py b/Observatory/AggregatedCustomScopeController.py index 066efee..c96755d 100644 --- a/Observatory/AggregatedCustomScopeController.py +++ b/Observatory/AggregatedCustomScopeController.py @@ -2,6 +2,7 @@ import logging import requests import time +import urllib.parse # Local from Base.Base import Base @@ -60,11 +61,9 @@ class UPBV2(IndiDevice, Base): """ def __init__(self, config=None, - connect_on_create=True, - logger=None): + connect_on_create=True): self._is_initialized = False - logger = logger or logging.getLogger(__name__) if config is None: config = dict( @@ -132,9 +131,6 @@ def __init__(self, self.auto_dew_identifiers = config["auto_dew_identifiers"] self.auto_dew_aggressivity = str(config["auto_dew_aggressivity"]) - # Indi stuff - logger.debug(f"UPBV2, controller board port is on port: {self.device_port}") - # device related intialization IndiDevice.__init__(self, device_name=config["device_name"], @@ -176,7 +172,7 @@ def deinitialize(self): self.switch_off_scope_fan() self.switch_off_dew_heater() self.power_off_all_telescope_equipments() - self.switch_off_mount() + self.power_off_mount() self.disconnect() @@ -231,8 +227,8 @@ def initialize_all_usb(self): self.set_switch("USB_PORT_CONTROL", on_switches=on_switches, off_switches=off_switches) def initialize_usb_hub(self): - logging.warning("initialize_usb_hub doesn't seems to be currently supported by indi driver") - #self.set_switch("USB_HUB_CONTROL", on_switches=["INDI_ENABLED"]) + #self.logger.warning("initialize_usb_hub doesn't seems to be currently supported by indi driver") + self.set_switch("USB_HUB_CONTROL", on_switches=["INDI_ENABLED"]) def power_on_all_telescope_equipments(self): # Power telescope level equipments @@ -359,13 +355,13 @@ def switch_off_dew_heater(self): self.set_auto_dew_eligibility_off() self.logger.debug("Switching off automatic dew heater") - def switch_on_mount(self): + def power_on_mount(self): """ blocking call: switch on main mount """ on_switches = [f"POWER_CONTROL_{i}" for i in range(1, 5) if (self.power_labels[f"POWER_LABEL_{i}"] == "MOUNT_POWER")] self.set_switch("POWER_CONTROL", on_switches=on_switches) - def switch_off_mount(self): + def power_off_mount(self): """ blocking call: switch off main mount """ off_switches = [f"POWER_CONTROL_{i}" for i in range(1, 5) if (self.power_labels[f"POWER_LABEL_{i}"] == "MOUNT_POWER")] @@ -405,11 +401,9 @@ class ArduinoServoController(IndiDevice, Base): """ def __init__(self, config=None, - connect_on_create=True, - logger=None): + connect_on_create=True): self._is_initialized = False - logger = logger or logging.getLogger(__name__) if config is None: config = dict( @@ -427,9 +421,6 @@ def __init__(self, self.baud_rate = str(config["baud_rate"]) self.polling_ms = float(config["polling_ms"]) - # Indi stuff - logger.debug(f"Arduino, controller board port is on port: {self.device_port}") - # device related intialization IndiDevice.__init__(self, device_name=config["device_name"], @@ -500,12 +491,10 @@ class AggregatedCustomScopeController(Base): /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_AD0JE0ID-if00-port0 -> Shelyak arduino SPOX (ttyUSB1 at the time of the test) /dev/serial/by-id/usb-Pegasus_Astro_UPBv2_revD_UPB25S4VWV-if00-port0 -> PEGASUS (ttyUSB2 at the time of the test) """ - def __init__(self, config=None, connect_on_create=True, - logger=None): + def __init__(self, config=None, connect_on_create=True): Base.__init__(self) self._is_initialized = False - logger = logger or logging.getLogger(__name__) if config is None: config = dict( @@ -513,10 +502,12 @@ def __init__(self, config=None, connect_on_create=True, config_arduino=None, indi_driver_connect_delay_s=10, indi_resetable_instruments_driver_name_list=dict( - driver_1="ZWO CCD", - driver_2="Altair", + driver_1="ZWO CCD ASI290MM Mini", + driver_2="Altair AA183MPRO", driver_3="Shelyak SPOX", - driver_4="ASI EAF" + driver_4="PlayerOne CCD Ares-M PRO", + driver_5="Arduino", + driver_6="Losmandy Gemini" ), indi_mount_driver_name="Losmandy Gemini", indi_webserver_host="localhost", @@ -558,6 +549,9 @@ def __init__(self, config=None, connect_on_create=True, self.logger.debug('configured successfully') def initialize(self): + # Restart all driver related to the aggregated devices + self.restart_all_drivers() + # initialize upbv2 self.upbv2.initialize() @@ -574,15 +568,15 @@ def deinitialize(self): """ self.logger.debug("Deinitializing AggregatedCustomScopeController") - # stop all drivers that relies on device being on - self.stop_all_drivers() - # Deinitialize arduino servo first (as it relies on upb power) self.arduino_servo_controller.deinitialize() # Deinitialize upbv2 self.upbv2.deinitialize() + # stop all drivers that relies on device being on + self.stop_all_drivers() + self._is_initialized = False def open(self): @@ -601,35 +595,62 @@ def close(self): self.close_finder_dustcap() self.close_scope_dustcap() + def restart_driver(self, driver_name): + """ + See documentation for the API here: https://github.com/knro/indiwebmanager + :param driver_name: + :return: + """ + try: + base_url = f"http://{self._indi_webserver_host}:"\ + f"{self._indi_webserver_port}" + req = f"{base_url}/api/drivers/restart/"\ + f"{urllib.parse.quote(driver_name)}" + response = requests.post(req) + self.logger.debug(f"start_driver {driver_name} - url {req} - response: {response}") + assert response.status_code == 200 + except Exception as e: + self.logger.warning(f"Cannot restart indi driver : {e}") + def start_driver(self, driver_name): + """ + See documentation for the API here: https://github.com/knro/indiwebmanager + :param driver_name: + :return: + """ try: base_url = f"http://{self._indi_webserver_host}:"\ f"{self._indi_webserver_port}" req = f"{base_url}/api/drivers/start/"\ - f"{driver_name.replace(' ', '%20')}" + f"{urllib.parse.quote(driver_name)}" response = requests.post(req) self.logger.debug(f"start_driver {driver_name} - url {req} - response: {response}") assert response.status_code == 200 except Exception as e: - self.logger.warning(f"Cannot load indi driver : {e}") + self.logger.warning(f"Cannot start indi driver : {e}") def stop_driver(self, driver_name): + """ + See documentation for the API here: https://github.com/knro/indiwebmanager + :param driver_name: + :return: + """ try: #if driver_name not in ["ZWO CCD"]: #"Shelyak SPOX", "Arduino telescope controller", "ASI EAF", "Altair", "ZWO CCD" # return base_url = f"http://{self._indi_webserver_host}:"\ f"{self._indi_webserver_port}" req = f"{base_url}/api/drivers/stop/"\ - f"{driver_name.replace(' ', '%20')}" + f"{urllib.parse.quote(driver_name)}" #self.logger.setLevel("DEBUG") - self.logger.warning(f"stop_driver {driver_name} DISABLED for now as it was randomly breaking indiserver") - ###self.logger.debug(f"stop_driver {driver_name} - post on url {req}") - ###response = requests.post(req) - ###self.logger.debug(f"stop_driver {driver_name} - response: {response}") - ###assert response.status_code == 200 + #self.logger.warning(f"stop_driver {driver_name} DISABLED for now as it was randomly breaking indiserver") + self.logger.debug(f"stop_driver {driver_name} - post on url {req}") + response = requests.post(req) + self.logger.debug(f"stop_driver {driver_name} - response: {response}") + assert response.status_code == 200 except Exception as e: - self.logger.warning(f"Cannot load indi driver : {e}") + self.logger.warning(f"Cannot stop indi driver : {e}") def switch_on_instruments(self): """ blocking call: switch on cameras, calibration tools, finderscopes, etc... @@ -652,6 +673,11 @@ def switch_off_instruments(self): for driver_name in self._indi_resetable_instruments_driver_name_list.values(): self.stop_driver(driver_name) + def restart_all_drivers(self): + for driver_name in self._indi_resetable_instruments_driver_name_list.values(): + self.restart_driver(driver_name) + self.restart_driver(self._indi_mount_driver_name) + def stop_all_drivers(self): for driver_name in self._indi_resetable_instruments_driver_name_list.values(): self.stop_driver(driver_name) @@ -693,15 +719,15 @@ def switch_on_mount(self): self.upbv2.power_on_mount() # Now we need to wait a bit before trying to connect driver time.sleep(self._indi_driver_connect_delay_s) - self.start_driver(self._indi_mount_driver_name) + self.restart_driver(self._indi_mount_driver_name) self.statuses["mount_relay"] = True def switch_off_mount(self): """ blocking call: switch off main mount """ self.logger.debug("Switching off main mount") - self.upbv2.power_off_mount() self.stop_driver(self._indi_mount_driver_name) + self.upbv2.power_off_mount() self.statuses["mount_relay"] = False def open_scope_dustcap(self): diff --git a/apps/launch_backyard_conf.sh b/apps/launch_backyard_conf.sh index bbeffc7..d8f792b 100755 --- a/apps/launch_backyard_conf.sh +++ b/apps/launch_backyard_conf.sh @@ -10,6 +10,6 @@ indiserver indi_lx200gemini indi_canon_ccd indi_asi_ccd # ssh -L 7624:192.168.8.247:7624 192.168.0.176 # Another config also with ssh tunnel -# ssh -L 7625:192.168.8.247:7624 192.168.8.247 -# ssh -L 8624:192.168.8.247:8624 192.168.8.247 -# ssh -L 4400:192.168.8.247:4400 192.168.8.247 +# ssh -L 7625:127.0.0.1:7624 192.168.8.247 +# ssh -L 8624:127.0.0.1:8624 192.168.8.247 +# ssh -L 4400:127.0.0.1:4400 192.168.8.247 diff --git a/apps/prototyping/Observatory/AggregatedCustomScopeController.py b/apps/prototyping/Observatory/AggregatedCustomScopeController.py index f03d372..804880a 100644 --- a/apps/prototyping/Observatory/AggregatedCustomScopeController.py +++ b/apps/prototyping/Observatory/AggregatedCustomScopeController.py @@ -28,28 +28,28 @@ adjustable_voltage_value=5, power_labels=dict( POWER_LABEL_1="MAIN_TELESCOPE_DUSTCAP_CONTROL", - POWER_LABEL_2="TELESCOPE_LEVEL_POWER", #SPOX_AND_DUSTCAP_POWER - POWER_LABEL_3="FOCUSER_LEVEL_POWER", #PRIMARY_FOCUSER_POWER + POWER_LABEL_2="SPOX_AND_DUSTCAP_POWER", + POWER_LABEL_3="MAIN_CAMERA_POWER", POWER_LABEL_4="MOUNT_POWER"), always_on_power_identifiers=dict( - MAIN_TELESCOPE_DUSTCAP_CONTROL=False, - TELESCOPE_LEVEL_POWER=False, #SPOX_AND_DUSTCAP_POWER - FOCUSER_LEVEL_POWER=False, #PRIMARY_FOCUSER_POWER + MAIN_TELESCOPE_DUSTCAP_CONTROL=True, + SPOX_AND_DUSTCAP_POWER=True, + MAIN_CAMERA_POWER=False, MOUNT_POWER=False), usb_labels=dict( - USB_LABEL_1="PRIMARY_CAMERA", - USB_LABEL_2="ARDUINO_CONTROL_BOX", - USB_LABEL_3="GUIDE_CAMERA", - USB_LABEL_4="FIELD_CAMERA", + USB_LABEL_1="FIELD_CAMERA", + USB_LABEL_2="PRIMARY_CAMERA", + USB_LABEL_3="SPECTRO_CONTROL_BOX", + USB_LABEL_4="ARDUINO_CONTROL_BOX", USB_LABEL_5="WIFI_ROUTER", - USB_LABEL_6="SPECTRO_CONTROL_BOX"), + USB_LABEL_6="GUIDE_CAMERA"), always_on_usb_identifiers=dict( - PRIMARY_CAMERA=False, - ARDUINO_CONTROL_BOX=True, - GUIDE_CAMERA=False, FIELD_CAMERA=False, + PRIMARY_CAMERA=False, + SPECTRO_CONTROL_BOX=False, + ARDUINO_CONTROL_BOX=False, WIFI_ROUTER=True, - SPECTRO_CONTROL_BOX=False), + GUIDE_CAMERA=False), dew_labels=dict( DEW_LABEL_1="PRIMARY_FAN", DEW_LABEL_2="SECONDARY_DEW_HEATER", @@ -58,45 +58,46 @@ PRIMARY_FAN=False, SECONDARY_DEW_HEATER=True, FINDER_DEW_HEATER=True), - auto_dew_aggressivity=200, # Number between 50 and 250 + auto_dew_aggressivity=150, # Number between 50 and 250 indi_client=dict(indi_host="localhost", - indi_port=7624)) + indi_port=7625)) # Now test UPBV2 - #upbv2 = UPBV2( - # config=config_upbv2, - # connect_on_create=True) - #print(upbv2.get_power_info()) - #print(upbv2.get_weather_info()) + upbv2 = UPBV2( + config=config_upbv2, + connect_on_create=True) + print(upbv2.get_power_info()) + print(upbv2.get_weather_info()) # Now test Arduino controller - #upbv2.open_scope_dustcap() + upbv2.open_scope_dustcap() # config for simple arduino config_arduino = dict( device_name="Arduino telescope controller", - device_port="/dev/serial/by-id/usb-1a86_USB2.0-Serial-if00-port0", + device_port="/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_AB0L9VL1-if00-port0", connection_type="CONNECTION_SERIAL", baud_rate=57600, polling_ms=1000, indi_client=dict(indi_host="localhost", indi_port=7624)) - #arduino = ArduinoServoController( - # config=config_arduino, - # connect_on_create=True) + arduino = ArduinoServoController( + config=config_arduino, + connect_on_create=True) - #arduino.open_finder_dustcap() - #arduino.close_finder_dustcap() + arduino.open_finder_dustcap() + arduino.close_finder_dustcap() config_aggregated = dict( config_upbv2=config_upbv2, config_arduino=config_arduino, indi_driver_connect_delay_s=10, indi_resetable_instruments_driver_name_list=dict( - driver_1="ZWO CCD", - driver_2="Altair", + driver_1="ZWO CCD ASI290MM Mini", + driver_2="Altair AA183MPRO", driver_3="Shelyak SPOX", - driver_4="ASI EAF" + driver_4="PlayerOne CCD Ares-M PRO", + driver_5="Arduino", ), indi_mount_driver_name="Losmandy Gemini", indi_webserver_host="localhost", diff --git a/conf_files/config.yaml b/conf_files/config.yaml index de7dd6b..8d77ed2 100644 --- a/conf_files/config.yaml +++ b/conf_files/config.yaml @@ -22,13 +22,69 @@ observatory: # webcam: # rtsp_url: rtsp://user:password@192.168.0.16 scope_controller: - module: DummyScopeController #AggregatedCustomScopeController #DummyScopeController - port: /dev/serial/by-id/usb-Pegasus_Astro_UPBv2_revD_UPB25S4VWV-if00-port0 + config_arduino: + device_name: Arduino telescope controller + device_port: /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_AB0L9VL1-if00-port0 + connection_type: CONNECTION_SERIAL + baud_rate: 57600 + polling_ms: 1000 + indi_client: + indi_host: localhost + indi_port: 7624 + config_upbv2: + device_name: Pegasus UPB + device_port: /dev/serial/by-id/usb-Pegasus_Astro_UPBv2_revD_UPB25S4VWV-if00-port0 + connection_type: CONNECTION_SERIAL + baud_rate: 9600 + polling_ms: 1000 + dustcap_travel_delay_s: 10 + adjustable_voltage_value: 5 + power_labels: + POWER_LABEL_1: MAIN_TELESCOPE_DUSTCAP_CONTROL + POWER_LABEL_2: SPOX_AND_DUSTCAP_POWER + POWER_LABEL_3: MAIN_CAMERA_POWER + POWER_LABEL_4: MOUNT_POWER + always_on_power_identifiers: + MAIN_TELESCOPE_DUSTCAP_CONTROL: True + SPOX_AND_DUSTCAP_POWER: True + MAIN_CAMERA_POWER: False + MOUNT_POWER: False + usb_labels: + USB_LABEL_1: FIELD_CAMERA + USB_LABEL_2: PRIMARY_CAMERA + USB_LABEL_3: SPECTRO_CONTROL_BOX + USB_LABEL_4: ARDUINO_CONTROL_BOX + USB_LABEL_5: WIFI_ROUTER + USB_LABEL_6: GUIDE_CAMERA + always_on_usb_identifiers: + FIELD_CAMERA: False + PRIMARY_CAMERA: False + SPECTRO_CONTROL_BOX: False + ARDUINO_CONTROL_BOX: False + WIFI_ROUTER: True, + GUIDE_CAMERA: False + dew_labels: + DEW_LABEL_1: PRIMARY_FAN + DEW_LABEL_2: SECONDARY_DEW_HEATER + DEW_LABEL_3: FINDER_DEW_HEATER + auto_dew_identifiers: + PRIMARY_FAN: False + SECONDARY_DEW_HEATER: True + FINDER_DEW_HEATER: True + auto_dew_aggressivity: 150 # Number between 50 and 250 + indi_client: + indi_host: localhost + indi_port: 7625 + indi_driver_connect_delay_s: 10 + indi_resetable_instruments_driver_name_list: + driver_1: ZWO CCD ASI290MM Mini + driver_2: Altair AA183MPRO + driver_3: Shelyak SPOX + driver_4: PlayerOne CCD Ares-M PRO + driver_5: Arduino + indi_mount_driver_name: Losmandy Gemini indi_webserver_host: localhost indi_webserver_port: 8624 - indi_client : - indi_host : localhost - indi_port : 7625 dome_controller: module : IndiDomeController dome_movement_timeout_s: 300 @@ -185,7 +241,7 @@ cameras: indi_host : localhost indi_port : 7625 pointer: - module: DifferentialPointer #DifferentialPointer #IterativeSync + module: IterativeSync #DifferentialPointer #IterativeSync gen_hips: False timeout_seconds: 450 max_iterations: 5 diff --git a/conf_files/targets.yaml b/conf_files/targets.yaml index 3143866..806411e 100644 --- a/conf_files/targets.yaml +++ b/conf_files/targets.yaml @@ -34,66 +34,6 @@ targets : temperature: gain: 10 exp_time_sec: 10 - Polaris: - Luminance: - count: 3 - temperature: - gain: 10 - exp_time_sec: 10 - Alioth: - Luminance: - count: 3 - temperature: - gain: 10 - exp_time_sec: 10 - Alkaid: - Luminance: - count: 3 - temperature: - gain: 10 - exp_time_sec: 10 - Dubhe: - Luminance: - count: 3 - temperature: - gain: 10 - exp_time_sec: 10 - Vega: - Luminance: - count: 3 - temperature: - gain: 10 - exp_time_sec: 10 - Sheliak: - Luminance: - count: 3 - temperature: - gain: 10 - exp_time_sec: 10 - Altair: - Luminance: - count: 3 - temperature: - gain: 10 - exp_time_sec: 10 - Sarin: - Luminance: - count: 3 - temperature: - gain: 10 - exp_time_sec: 10 - Kornephoros: - Luminance: - count: 3 - temperature: - gain: 10 - exp_time_sec: 10 - Alphecca: - Luminance: - count: 3 - temperature: - gain: 10 - exp_time_sec: 10 # M51 : # Luminance : # count : 10 From e3b0746fac2c0fe4cb2fa2c3e6b781dfa11aa26e Mon Sep 17 00:00:00 2001 From: gnthibault Date: Tue, 1 Aug 2023 23:44:52 +0200 Subject: [PATCH 5/7] Continue working on backyard conf --- .../AggregatedCustomScopeController.py | 57 +++++++++++-------- .../AggregatedCustomScopeController.py | 17 ++++-- conf_files/config.yaml | 10 ++-- 3 files changed, 49 insertions(+), 35 deletions(-) diff --git a/Observatory/AggregatedCustomScopeController.py b/Observatory/AggregatedCustomScopeController.py index c96755d..22f16d3 100644 --- a/Observatory/AggregatedCustomScopeController.py +++ b/Observatory/AggregatedCustomScopeController.py @@ -108,7 +108,7 @@ def __init__(self, FINDER_DEW_HEATER=True), auto_dew_aggressivity=200, # Number between 50 and 250 indi_client=dict(indi_host="localhost", - indi_port=7624)) + indi_port=7625)) # Communication config self.device_port = config["device_port"] @@ -227,12 +227,13 @@ def initialize_all_usb(self): self.set_switch("USB_PORT_CONTROL", on_switches=on_switches, off_switches=off_switches) def initialize_usb_hub(self): - #self.logger.warning("initialize_usb_hub doesn't seems to be currently supported by indi driver") - self.set_switch("USB_HUB_CONTROL", on_switches=["INDI_ENABLED"]) + self.logger.warning("initialize_usb_hub doesn't seems to be currently supported by indi driver") + #self.set_switch("USB_HUB_CONTROL", on_switches=["INDI_ENABLED"]) def power_on_all_telescope_equipments(self): # Power telescope level equipments - on_switches = [f"POWER_CONTROL_{i}" for i in range(1, 5) if self.power_labels[f"POWER_LABEL_{i}"] in ['TELESCOPE_LEVEL_POWER', 'FOCUSER_LEVEL_POWER']] + on_switches = [f"POWER_CONTROL_{i}" for i in range(1, 5) if self.power_labels[f"POWER_LABEL_{i}"] in + ['SPOX_AND_DUSTCAP_POWER', 'MAIN_CAMERA_POWER']] self.set_switch("POWER_CONTROL", on_switches=on_switches) # 5V adjustable power source @@ -240,17 +241,18 @@ def power_on_all_telescope_equipments(self): # USB on_switches = [f"PORT_{i}" for i in range(1, 7) if self.usb_labels[f"USB_LABEL_{i}"] in - ["PRIMARY_CAMERA", "GUIDE_CAMERA", "FIELD_CAMERA", "SPECTRO_CONTROL_BOX"]] + ["FIELD_CAMERA", "PRIMARY_CAMERA", "SPECTRO_CONTROL_BOX", "ARDUINO_CONTROL_BOX", "GUIDE_CAMERA"]] self.set_switch("USB_PORT_CONTROL", on_switches=on_switches) def power_off_all_telescope_equipments(self): # Power off telescope level equipments - off_switches = [f"POWER_CONTROL_{i}" for i in range(1, 5) if self.power_labels[f"POWER_LABEL_{i}"] in ['TELESCOPE_LEVEL_POWER', 'FOCUSER_LEVEL_POWER']] + off_switches = [f"POWER_CONTROL_{i}" for i in range(1, 5) if self.power_labels[f"POWER_LABEL_{i}"] in + ['SPOX_AND_DUSTCAP_POWER', 'MAIN_CAMERA_POWER']] self.set_switch("POWER_CONTROL", off_switches=off_switches) # USB off_switches = [f"PORT_{i}" for i in range(1, 7) if self.usb_labels[f"USB_LABEL_{i}"] in - ["PRIMARY_CAMERA", "GUIDE_CAMERA", "FIELD_CAMERA", "SPECTRO_CONTROL_BOX"]] + ["FIELD_CAMERA", "PRIMARY_CAMERA", "SPECTRO_CONTROL_BOX", "ARDUINO_CONTROL_BOX", "GUIDE_CAMERA"]] self.set_switch("USB_PORT_CONTROL", off_switches=off_switches) def power_on_mount(self): @@ -371,16 +373,19 @@ def open_scope_dustcap(self): """ blocking call: open up main scope dustcap """ on_switches = [f"POWER_CONTROL_{i}" for i in range(1, 5) if (self.power_labels[f"POWER_LABEL_{i}"] in - ["MAIN_TELESCOPE_DUSTCAP_CONTROL", "TELESCOPE_LEVEL_POWER"])] - self.set_switch("POWER_CONTROL", on_switches=on_switches) + ["SPOX_AND_DUSTCAP_POWER"])] + off_switches = [f"POWER_CONTROL_{i}" for i in range(1, 5) if (self.power_labels[f"POWER_LABEL_{i}"] in + ["MAIN_TELESCOPE_DUSTCAP_CONTROL"])] + self.set_switch("POWER_CONTROL", on_switches=on_switches, off_switches=off_switches) self.wait_dustcap_delay() def close_scope_dustcap(self): """ blocking call: close main scope dustcap """ - on_switches = [f"POWER_CONTROL_{i}" for i in range(1, 5) if (self.power_labels[f"POWER_LABEL_{i}"] == "TELESCOPE_LEVEL_POWER")] - off_switches = [f"POWER_CONTROL_{i}" for i in range(1, 5) if (self.power_labels[f"POWER_LABEL_{i}"] == "MAIN_TELESCOPE_DUSTCAP_CONTROL")] - self.set_switch("POWER_CONTROL", on_switches=on_switches, off_switches=off_switches) + on_switches = [f"POWER_CONTROL_{i}" for i in range(1, 5) if (self.power_labels[f"POWER_LABEL_{i}"] in + ["SPOX_AND_DUSTCAP_POWER", + "MAIN_TELESCOPE_DUSTCAP_CONTROL"])] + self.set_switch("POWER_CONTROL", on_switches=on_switches) self.wait_dustcap_delay() class ArduinoServoController(IndiDevice, Base): @@ -439,13 +444,12 @@ def initialize(self): * connect server to actual physical device :return: """ - self.connect(connect_device=False) + self.connect(connect_device=False) #TODO TN Urgent check if this is ok self.set_device_communication_options() self.connect_device() # We set the polling period only after the connection #('setNumberVector', {'device': 'Arduino', 'name': 'POLLING_PERIOD', 'state': 'Alert', 'timeout': '0', 'timestamp': '2021-12-28T17:47:21', #'message': 'Cannot change property while device is disconnected.'}) - self.set_polling_ms(polling_ms=self.polling_ms) self.initialize_servo() self._is_initialized = True @@ -470,16 +474,18 @@ def initialize_servo(self, auto_dew_aggressivity=None): def open_finder_dustcap(self): """ blocking call: open up finder dustcap """ - self.logger.debug("Opening up finder dustcap") + self.logger.debug("Opening up finder dustcap -- For some reason we had to remove the greenlight synchronization on indi_duino driver") self.set_switch("FINDER_SERVO_DUSTCAP_SWITCH", - on_switches=['SERVO_SWITCH']) + on_switches=['SERVO_SWITCH'], + sync=False) def close_finder_dustcap(self): """ blocking call: close finder dustcap """ - self.logger.debug("close finder dustcap") + self.logger.debug("close finder dustcap -- For some reason we had to remove the greenlight synchronization on indi_duino driver") self.set_switch("FINDER_SERVO_DUSTCAP_SWITCH", - off_switches=['SERVO_SWITCH']) + off_switches=['SERVO_SWITCH'], + sync=False) @@ -555,6 +561,7 @@ def initialize(self): # initialize upbv2 self.upbv2.initialize() + self.upbv2.power_on_arduino_control_box() # Wait for the arduino os serial port to be created time.sleep(self._indi_driver_connect_delay_s) self.arduino_servo_controller.initialize() @@ -607,7 +614,7 @@ def restart_driver(self, driver_name): req = f"{base_url}/api/drivers/restart/"\ f"{urllib.parse.quote(driver_name)}" response = requests.post(req) - self.logger.debug(f"start_driver {driver_name} - url {req} - response: {response}") + self.logger.debug(f"restart_driver {driver_name} - url {req} - response: {response.text}") assert response.status_code == 200 except Exception as e: self.logger.warning(f"Cannot restart indi driver : {e}") @@ -624,7 +631,7 @@ def start_driver(self, driver_name): req = f"{base_url}/api/drivers/start/"\ f"{urllib.parse.quote(driver_name)}" response = requests.post(req) - self.logger.debug(f"start_driver {driver_name} - url {req} - response: {response}") + self.logger.debug(f"start_driver {driver_name} - url {req} - response: {response.text}") assert response.status_code == 200 except Exception as e: self.logger.warning(f"Cannot start indi driver : {e}") @@ -645,10 +652,12 @@ def stop_driver(self, driver_name): #self.logger.setLevel("DEBUG") #self.logger.warning(f"stop_driver {driver_name} DISABLED for now as it was randomly breaking indiserver") - self.logger.debug(f"stop_driver {driver_name} - post on url {req}") response = requests.post(req) - self.logger.debug(f"stop_driver {driver_name} - response: {response}") - assert response.status_code == 200 + self.logger.debug(f"stop_driver {driver_name} - url {req} - response: {response.text}") + assert response.status_code in [200, 500] + if response.status_code == 500: + self.logger.debug(f"stop_driver {driver_name} - url {req} - response: {response.text}, " + f"might be expected in case the driver was not started or already stopped") except Exception as e: self.logger.warning(f"Cannot stop indi driver : {e}") @@ -662,7 +671,7 @@ def switch_on_instruments(self): # Now we need to wait a bit before trying to connect driver # but _indi_driver_connect_delay_s was already waited for at previous step for driver_name in self._indi_resetable_instruments_driver_name_list.values(): - self.start_driver(driver_name) + self.restart_driver(driver_name) def switch_off_instruments(self): """ blocking call: switch off camera diff --git a/apps/prototyping/Observatory/AggregatedCustomScopeController.py b/apps/prototyping/Observatory/AggregatedCustomScopeController.py index 804880a..c34adf1 100644 --- a/apps/prototyping/Observatory/AggregatedCustomScopeController.py +++ b/apps/prototyping/Observatory/AggregatedCustomScopeController.py @@ -14,6 +14,7 @@ #Astropy stuff from astropy import units as u from astropy.coordinates import SkyCoord +logging.getLogger().setLevel(logging.DEBUG) if __name__ == '__main__': @@ -74,13 +75,17 @@ # config for simple arduino config_arduino = dict( - device_name="Arduino telescope controller", + device_name="Arduino", device_port="/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_AB0L9VL1-if00-port0", connection_type="CONNECTION_SERIAL", baud_rate=57600, polling_ms=1000, indi_client=dict(indi_host="localhost", - indi_port=7624)) + indi_port=7625)) + # One need to enable usb power for arduino controller beforehand + upbv2.power_on_arduino_control_box() + indi_driver_connect_delay_s = 10 + time.sleep(indi_driver_connect_delay_s) arduino = ArduinoServoController( config=config_arduino, connect_on_create=True) @@ -93,11 +98,11 @@ config_arduino=config_arduino, indi_driver_connect_delay_s=10, indi_resetable_instruments_driver_name_list=dict( - driver_1="ZWO CCD ASI290MM Mini", - driver_2="Altair AA183MPRO", + driver_1="ZWO CCD", + driver_2="Altair", driver_3="Shelyak SPOX", - driver_4="PlayerOne CCD Ares-M PRO", - driver_5="Arduino", + driver_4="PlayerOne CCD", + driver_5="Arduino telescope controller" ), indi_mount_driver_name="Losmandy Gemini", indi_webserver_host="localhost", diff --git a/conf_files/config.yaml b/conf_files/config.yaml index 8d77ed2..33af243 100644 --- a/conf_files/config.yaml +++ b/conf_files/config.yaml @@ -23,7 +23,7 @@ observatory: # rtsp_url: rtsp://user:password@192.168.0.16 scope_controller: config_arduino: - device_name: Arduino telescope controller + device_name: Arduino device_port: /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_AB0L9VL1-if00-port0 connection_type: CONNECTION_SERIAL baud_rate: 57600 @@ -77,11 +77,11 @@ observatory: indi_port: 7625 indi_driver_connect_delay_s: 10 indi_resetable_instruments_driver_name_list: - driver_1: ZWO CCD ASI290MM Mini - driver_2: Altair AA183MPRO + driver_1: ZWO CCD + driver_2: Altair driver_3: Shelyak SPOX - driver_4: PlayerOne CCD Ares-M PRO - driver_5: Arduino + driver_4: PlayerOne CCD + driver_5: Arduino telescope controller indi_mount_driver_name: Losmandy Gemini indi_webserver_host: localhost indi_webserver_port: 8624 From 2533094b35db35e60134c4a535571a2e1f99f80b Mon Sep 17 00:00:00 2001 From: gnthibault Date: Wed, 2 Aug 2023 17:26:41 +0200 Subject: [PATCH 6/7] Fixing config setup --- apps/launch_backyard_conf.sh | 1 + conf_files/config.yaml | 210 ++++++++++---------- conf_files/config_backyard.yaml | 342 ++++++++++++++++++++++++++++++++ utils/config.py | 2 +- 4 files changed, 445 insertions(+), 110 deletions(-) create mode 100644 conf_files/config_backyard.yaml diff --git a/apps/launch_backyard_conf.sh b/apps/launch_backyard_conf.sh index d8f792b..e94e3c9 100755 --- a/apps/launch_backyard_conf.sh +++ b/apps/launch_backyard_conf.sh @@ -13,3 +13,4 @@ indiserver indi_lx200gemini indi_canon_ccd indi_asi_ccd # ssh -L 7625:127.0.0.1:7624 192.168.8.247 # ssh -L 8624:127.0.0.1:8624 192.168.8.247 # ssh -L 4400:127.0.0.1:4400 192.168.8.247 +# export REMOTE_OBSERVATORY_CONFIG=config_backyard diff --git a/conf_files/config.yaml b/conf_files/config.yaml index 33af243..dd54c10 100644 --- a/conf_files/config.yaml +++ b/conf_files/config.yaml @@ -22,76 +22,24 @@ observatory: # webcam: # rtsp_url: rtsp://user:password@192.168.0.16 scope_controller: - config_arduino: - device_name: Arduino - device_port: /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_AB0L9VL1-if00-port0 - connection_type: CONNECTION_SERIAL - baud_rate: 57600 - polling_ms: 1000 - indi_client: - indi_host: localhost - indi_port: 7624 - config_upbv2: - device_name: Pegasus UPB - device_port: /dev/serial/by-id/usb-Pegasus_Astro_UPBv2_revD_UPB25S4VWV-if00-port0 - connection_type: CONNECTION_SERIAL - baud_rate: 9600 - polling_ms: 1000 - dustcap_travel_delay_s: 10 - adjustable_voltage_value: 5 - power_labels: - POWER_LABEL_1: MAIN_TELESCOPE_DUSTCAP_CONTROL - POWER_LABEL_2: SPOX_AND_DUSTCAP_POWER - POWER_LABEL_3: MAIN_CAMERA_POWER - POWER_LABEL_4: MOUNT_POWER - always_on_power_identifiers: - MAIN_TELESCOPE_DUSTCAP_CONTROL: True - SPOX_AND_DUSTCAP_POWER: True - MAIN_CAMERA_POWER: False - MOUNT_POWER: False - usb_labels: - USB_LABEL_1: FIELD_CAMERA - USB_LABEL_2: PRIMARY_CAMERA - USB_LABEL_3: SPECTRO_CONTROL_BOX - USB_LABEL_4: ARDUINO_CONTROL_BOX - USB_LABEL_5: WIFI_ROUTER - USB_LABEL_6: GUIDE_CAMERA - always_on_usb_identifiers: - FIELD_CAMERA: False - PRIMARY_CAMERA: False - SPECTRO_CONTROL_BOX: False - ARDUINO_CONTROL_BOX: False - WIFI_ROUTER: True, - GUIDE_CAMERA: False - dew_labels: - DEW_LABEL_1: PRIMARY_FAN - DEW_LABEL_2: SECONDARY_DEW_HEATER - DEW_LABEL_3: FINDER_DEW_HEATER - auto_dew_identifiers: - PRIMARY_FAN: False - SECONDARY_DEW_HEATER: True - FINDER_DEW_HEATER: True - auto_dew_aggressivity: 150 # Number between 50 and 250 - indi_client: - indi_host: localhost - indi_port: 7625 - indi_driver_connect_delay_s: 10 - indi_resetable_instruments_driver_name_list: - driver_1: ZWO CCD - driver_2: Altair - driver_3: Shelyak SPOX - driver_4: PlayerOne CCD - driver_5: Arduino telescope controller + module: DummyScopeController #IndiArduiScopeController + port: /dev/ttyACM0 + controller_name: Arduino + indi_driver_connect_delay_s: 5 + indi_camera_driver_name: Canon DSLR indi_mount_driver_name: Losmandy Gemini - indi_webserver_host: localhost + indi_webserver_host: 192.168.0.33 indi_webserver_port: 8624 + indi_client : + indi_host : localhost + indi_port : 7624 dome_controller: module : IndiDomeController dome_movement_timeout_s: 300 dome_name: Dome Simulator indi_client : indi_host : localhost - indi_port : 7625 + indi_port : 7624 directories: base: /var/RemoteObservatory images: images @@ -133,17 +81,39 @@ calibration: #module: IndiSpectroController #controller_name: spox mount: - module: IndiG11 - mount_name: Losmandy Gemini + #module: IndiG11 + #mount_name: Losmandy Gemini + module: IndiAbstractMount + mount_name : Telescope Simulator equatorial_eod: J2000 # JNOW + is_simulator: true indi_client : indi_host : localhost - indi_port : 7625 + indi_port : 7624 cameras: - - module: IndiASICamera - camera_name : ZWO CCD ASI290MM Mini + module: IndiAbstractCameraSimulator + camera_name : Guide Simulator do_acquisition: false + SIMULATOR_SETTINGS: # 290MM + SIM_XRES: 1936 # + SIM_YRES: 1096 # + SIM_XSIZE: 2.9 #2.9 + SIM_YSIZE: 2.9 #2.9 + SIM_MAXVAL: 65000 + SIM_SATURATION: 1 + SIM_LIMITINGMAG: 17 + SIM_NOISE: 0 + SIM_SKYGLOW: 19.5 + SIM_OAGOFFSET: 0 + SIM_POLAR: 0 + SIM_POLARDRIFT: 0 + SIM_ROTATION: 0 + SIM_KING_GAMMA: 0 + SIM_KING_THETA: 0 + # SIM_PEPERIOD: 0 + # SIM_PEMAX: 0 + SIM_TIME_FACTOR: 1 SCOPE_INFO: # 200/800 newtonian FOCAL_LENGTH: 800 APERTURE: 200 @@ -158,7 +128,7 @@ cameras: do_autofocus: false autofocus_seconds: 4 autofocus_roi_size : 750 - autofocus_merit_function: half_flux_radius + autofocus_merit_function: half_flux_radius #vollath_F4 # focuser: # module: IndiFocuser # focuser_name: Focuser Simulator @@ -174,15 +144,18 @@ cameras: # coarse: 30000 # indi_client: # indi_host: localhost -# indi_port: 7625 +# indi_port: 7624 indi_client : indi_host : localhost - indi_port : 7625 + indi_port : 7624 #use_unique_client: True - - module: IndiAbstractCamera - camera_name : PlayerOne CCD Ares-M PRO + module: IndiAbstractCameraSimulator + camera_name : CCD Simulator do_acquisition: true + #module: IndiEos6DCamera + #camera_name: Canon DSLR EOS 6D + #camera_name: GPhoto CCD # CCD_INFO : # CCD_MAX_X : 5496 # CCD_MAX_Y : 3672 @@ -190,6 +163,25 @@ cameras: # CCD_PIXEL_SIZE_X : 2.4 # CCD_PIXEL_SIZE_Y : 2.4 # CCD_BITSPERPIXEL : 12 + SIMULATOR_SETTINGS: # 180mm + SIM_XRES: 1500 #5496 + SIM_YRES: 1500 #3672 + SIM_XSIZE: 4.8 #2.4 + SIM_YSIZE: 4.8 #2.4 + SIM_MAXVAL: 65000 + SIM_SATURATION: 1 + SIM_LIMITINGMAG: 17 + SIM_NOISE: 0 + SIM_SKYGLOW: 19.5 + SIM_OAGOFFSET: 0 + SIM_POLAR: 0 + SIM_POLARDRIFT: 0 + SIM_ROTATION: 0 + # SIM_KING_GAMMA: 0 + # SIM_KING_THETA: 0 + SIM_PEPERIOD: 0 + SIM_PEMAX: 0 + SIM_TIME_FACTOR: 1 SCOPE_INFO: # 200/800 newtonian FOCAL_LENGTH: 800 APERTURE: 200 @@ -205,43 +197,43 @@ cameras: autofocus_seconds: 5 autofocus_roi_size : 750 autofocus_merit_function : half_flux_radius #vollath_F4 - #focuser: - # module: IndiFocuser - # focuser_name: Focuser Simulator - # port: /dev/ttyUSB0 - # focus_range: - # min: 32500 - # max: 40000 - # autofocus_step: - # fine: 750 - # coarse: 2500 - # autofocus_range: - # fine: 10000 - # coarse: 30000 - # indi_client: - # indi_host: localhost - # indi_port: 7625 - #do_filter_wheel: false - #filter_wheel: - # module: IndiFilterWheel - # filterwheel_name: Filter Simulator - # filter_list: - # Luminance: 1 - # Red: 2 - # Green: 3 - # Blue: 4 - # H_Alpha: 5 - # OIII: 6 - # SII: 7 - # LPR: 8 - # indi_client: - # indi_host: localhost - # indi_port: 7625 + focuser: + module: IndiFocuser + focuser_name: Focuser Simulator + port: /dev/ttyUSB0 + focus_range: + min: 32500 + max: 40000 + autofocus_step: + fine: 750 + coarse: 2500 + autofocus_range: + fine: 10000 + coarse: 30000 + indi_client: + indi_host: localhost + indi_port: 7624 + do_filter_wheel: false + filter_wheel: + module: IndiFilterWheel + filterwheel_name: Filter Simulator + filter_list: + Luminance: 1 + Red: 2 + Green: 3 + Blue: 4 + H_Alpha: 5 + OIII: 6 + SII: 7 + LPR: 8 + indi_client: + indi_host: localhost + indi_port: 7624 indi_client : indi_host : localhost - indi_port : 7625 + indi_port : 7624 pointer: - module: IterativeSync #DifferentialPointer #IterativeSync + module: DifferentialPointer #DifferentialPointer #IterativeSync gen_hips: False timeout_seconds: 450 max_iterations: 5 @@ -255,10 +247,10 @@ offset_pointer: on_star_identification_failure: trust_astrometry # get_brightest or trust_astrometry guider: module : GuiderPHD2 - host : 127.0.0.1 + host : localhost port : 4400 do_calibration : False - profile_name : backyard + profile_name : Simulator exposure_time_sec : 4 settle : pixels : 1.5 @@ -284,7 +276,7 @@ weather_service : MAX_WEATHER_CLOUD_COVER : 5 indi_client : indi_host : localhost - indi_port : 7625 + indi_port : 7624 vizualization_service: module: SceneVizualization delay_sky_update_s: 1 diff --git a/conf_files/config_backyard.yaml b/conf_files/config_backyard.yaml new file mode 100644 index 0000000..33af243 --- /dev/null +++ b/conf_files/config_backyard.yaml @@ -0,0 +1,342 @@ +name: Remote observatory +observatory: + module: Observatory + investigator: gnthibault + latitude: 45.67 # Degrees + longitude: 5.67 # Degrees + elevation: 150.0 # Meters + timezone: Europe/Paris #This is not mandatory, just speeds up startup + # UTC+1 CET Central European Time, + # UTC +2 CEST Central European Summer Time + utc_offset: 1 # Hours + horizon: # Degrees + 0 : 0 + 90 : 0 + 180 : 0 + 270 : 0 + twilight_horizon: -18 # Degrees + timezone: Europe/Paris + # Paris is in the Central European Time Zone ( CET ) is 1 hours ahead of + # Greenwich Mean Time ( GMT+1 ). + gmt_offset: 60 # Minutes +# webcam: +# rtsp_url: rtsp://user:password@192.168.0.16 + scope_controller: + config_arduino: + device_name: Arduino + device_port: /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_AB0L9VL1-if00-port0 + connection_type: CONNECTION_SERIAL + baud_rate: 57600 + polling_ms: 1000 + indi_client: + indi_host: localhost + indi_port: 7624 + config_upbv2: + device_name: Pegasus UPB + device_port: /dev/serial/by-id/usb-Pegasus_Astro_UPBv2_revD_UPB25S4VWV-if00-port0 + connection_type: CONNECTION_SERIAL + baud_rate: 9600 + polling_ms: 1000 + dustcap_travel_delay_s: 10 + adjustable_voltage_value: 5 + power_labels: + POWER_LABEL_1: MAIN_TELESCOPE_DUSTCAP_CONTROL + POWER_LABEL_2: SPOX_AND_DUSTCAP_POWER + POWER_LABEL_3: MAIN_CAMERA_POWER + POWER_LABEL_4: MOUNT_POWER + always_on_power_identifiers: + MAIN_TELESCOPE_DUSTCAP_CONTROL: True + SPOX_AND_DUSTCAP_POWER: True + MAIN_CAMERA_POWER: False + MOUNT_POWER: False + usb_labels: + USB_LABEL_1: FIELD_CAMERA + USB_LABEL_2: PRIMARY_CAMERA + USB_LABEL_3: SPECTRO_CONTROL_BOX + USB_LABEL_4: ARDUINO_CONTROL_BOX + USB_LABEL_5: WIFI_ROUTER + USB_LABEL_6: GUIDE_CAMERA + always_on_usb_identifiers: + FIELD_CAMERA: False + PRIMARY_CAMERA: False + SPECTRO_CONTROL_BOX: False + ARDUINO_CONTROL_BOX: False + WIFI_ROUTER: True, + GUIDE_CAMERA: False + dew_labels: + DEW_LABEL_1: PRIMARY_FAN + DEW_LABEL_2: SECONDARY_DEW_HEATER + DEW_LABEL_3: FINDER_DEW_HEATER + auto_dew_identifiers: + PRIMARY_FAN: False + SECONDARY_DEW_HEATER: True + FINDER_DEW_HEATER: True + auto_dew_aggressivity: 150 # Number between 50 and 250 + indi_client: + indi_host: localhost + indi_port: 7625 + indi_driver_connect_delay_s: 10 + indi_resetable_instruments_driver_name_list: + driver_1: ZWO CCD + driver_2: Altair + driver_3: Shelyak SPOX + driver_4: PlayerOne CCD + driver_5: Arduino telescope controller + indi_mount_driver_name: Losmandy Gemini + indi_webserver_host: localhost + indi_webserver_port: 8624 + dome_controller: + module : IndiDomeController + dome_movement_timeout_s: 300 + dome_name: Dome Simulator + indi_client : + indi_host : localhost + indi_port : 7625 +directories: + base: /var/RemoteObservatory + images: images + webcam: webcams + data: data + resources: resources/ + targets: resources/targets + mounts: resources/mounts +db: + name: /var/RemoteObservatory/DB + type: file +ntp: + ntpserver: time.google.com +scheduler: + module: DefaultScheduler + # module: SpectroScheduler + target_file: targets.yaml + #target_file: spectral_targets.yaml +spectroscope_controller: + module: IndiSpectroController +calibration: + module: ImagingCalibration + #module: SpectralCalibration + spectral_calib: + nb: 11 + sec: 30 + gain: 1 + temperature: + flat: + nb: 1 + sec: 5 + gain: 1 + temperature: + dark: + dark_nb: 1 + controller: + module: DummySpectroController + controller_name: dummy + #module: IndiSpectroController + #controller_name: spox +mount: + module: IndiG11 + mount_name: Losmandy Gemini + equatorial_eod: J2000 # JNOW + indi_client : + indi_host : localhost + indi_port : 7625 +cameras: + - + module: IndiASICamera + camera_name : ZWO CCD ASI290MM Mini + do_acquisition: false + SCOPE_INFO: # 200/800 newtonian + FOCAL_LENGTH: 800 + APERTURE: 200 + do_guiding: true + do_pointing: true + pointing_seconds: 5 + do_adjust_pointing: true + adjust_center_x: 580 + adjust_center_y: 400 + adjust_roi_search_size: 50 + adjust_pointing_seconds: 5 + do_autofocus: false + autofocus_seconds: 4 + autofocus_roi_size : 750 + autofocus_merit_function: half_flux_radius +# focuser: +# module: IndiFocuser +# focuser_name: Focuser Simulator +# port: /dev/ttyUSB0 +# focus_range: +# min: 32500 +# max: 40000 +# autofocus_step: +# fine: 750 +# coarse: 2500 +# autofocus_range: +# fine: 10000 +# coarse: 30000 +# indi_client: +# indi_host: localhost +# indi_port: 7625 + indi_client : + indi_host : localhost + indi_port : 7625 + #use_unique_client: True + - + module: IndiAbstractCamera + camera_name : PlayerOne CCD Ares-M PRO + do_acquisition: true + # CCD_INFO : + # CCD_MAX_X : 5496 + # CCD_MAX_Y : 3672 + # CCD_PIXEL_SIZE : 2.4 + # CCD_PIXEL_SIZE_X : 2.4 + # CCD_PIXEL_SIZE_Y : 2.4 + # CCD_BITSPERPIXEL : 12 + SCOPE_INFO: # 200/800 newtonian + FOCAL_LENGTH: 800 + APERTURE: 200 + do_guiding: false + do_pointing: false + pointing_seconds: 5 + do_adjust_pointing: true + adjust_center_x: 400 + adjust_center_y: 400 + adjust_roi_search_size: 50 + adjust_pointing_seconds: 5 + do_autofocus: true + autofocus_seconds: 5 + autofocus_roi_size : 750 + autofocus_merit_function : half_flux_radius #vollath_F4 + #focuser: + # module: IndiFocuser + # focuser_name: Focuser Simulator + # port: /dev/ttyUSB0 + # focus_range: + # min: 32500 + # max: 40000 + # autofocus_step: + # fine: 750 + # coarse: 2500 + # autofocus_range: + # fine: 10000 + # coarse: 30000 + # indi_client: + # indi_host: localhost + # indi_port: 7625 + #do_filter_wheel: false + #filter_wheel: + # module: IndiFilterWheel + # filterwheel_name: Filter Simulator + # filter_list: + # Luminance: 1 + # Red: 2 + # Green: 3 + # Blue: 4 + # H_Alpha: 5 + # OIII: 6 + # SII: 7 + # LPR: 8 + # indi_client: + # indi_host: localhost + # indi_port: 7625 + indi_client : + indi_host : localhost + indi_port : 7625 +pointer: + module: IterativeSync #DifferentialPointer #IterativeSync + gen_hips: False + timeout_seconds: 450 + max_iterations: 5 + max_pointing_error_seconds: 3 +offset_pointer: + module: StarOffsetPointer #StarOffsetPointer #NoOffsetPointer + timeout_seconds: 300 + max_identification_error_seconds: 1 + sync_mount_upon_solve: False + use_guider_adjust: False + on_star_identification_failure: trust_astrometry # get_brightest or trust_astrometry +guider: + module : GuiderPHD2 + host : 127.0.0.1 + port : 4400 + do_calibration : False + profile_name : backyard + exposure_time_sec : 4 + settle : + pixels : 1.5 + time : 10 + timeout : 60 + dither : + pixels : 0.0 + ra_only : False +weather_service : + #module : IndiOpenWeatherMap + #service_name: OpenWeatherMap + module : IndiWeather + service_name : Weather Simulator + key_path : /var/RemoteObservatory/keys.json + delay_sec : 60 + observatory: + latitude: 43.56 # Degrees + longitude: 5.43 # Degrees + elevation: 150.0 # Meters + limits : + MAX_WEATHER_WIND_SPEED_KPH : 25 + MAX_WEATHER_WIND_GUST_KPH : 30 + MAX_WEATHER_CLOUD_COVER : 5 + indi_client : + indi_host : localhost + indi_port : 7625 +vizualization_service: + module: SceneVizualization + delay_sky_update_s: 1 + delay_moving_objects_s: 0.05 + gps_coord: + latitude: 45.67 + longitude: 5.67 +time_service : + module : HostTimeService +messaging_publisher: + module: PanMessagingMQTT #PanMessagingZMQ, PanMessagingMQTT + mqtt_host: localhost + mqtt_port: 1883 + com_mode: publisher + msg_port: 6510 +messaging_subscriber: + module: PanMessagingMQTT #PanMessagingZMQ, PanMessagingMQTT + mqtt_host: localhost + mqtt_port: 1883 + com_mode: subscriber + cmd_port: 6500 +paws_subscriber: + module: PanMessagingMQTT #PanMessagingZMQ, PanMessagingMQTT + mqtt_host: localhost + mqtt_port: 1883 + com_mode: subscriber + cmd_port: 6511 +paws_publisher: + module: PanMessagingMQTT #PanMessagingZMQ, PanMessagingMQTT + mqtt_host: localhost + mqtt_port: 1883 + com_mode: publisher + msg_port: 6500 +#independant_services: +# - +# module: NasaGCNService +# delay_sec: 60 +## If not provided, sourced from env NASA_GCN_CLIENT_ID and NASA_GCN_CLIENT_SECRET +## client_info: +## client_id: +## client_secret: +# messaging_publisher: +# module: PanMessagingMQTT +# mqtt_host: localhost +# mqtt_port: 1883 +# com_mode: publisher + +#Enable to output POCS messages to social accounts +# social_accounts: +# twitter: +# consumer_key: [your_consumer_key] +# consumer_secret: [your_consumer_secret] +# access_token: [your_access_token] +# access_token_secret: [your_access_token_secret] +state_machine: simple_state_table.yaml diff --git a/utils/config.py b/utils/config.py index 597decc..d1f2dbd 100644 --- a/utils/config.py +++ b/utils/config.py @@ -52,7 +52,7 @@ def load_config(config_files=None, parse=True, ignore_local=False): # Default to the pocs.yaml file if config_files is None: - config_files = ['config'] + config_files = [os.environ.get("REMOTE_OBSERVATORY_CONFIG", 'config')] config_files = listify(config_files) config = dict() From 6c7c2a9b90993b9ca3fc70a2a24954160757a3f5 Mon Sep 17 00:00:00 2001 From: gnthibault Date: Thu, 3 Aug 2023 21:49:51 +0200 Subject: [PATCH 7/7] Enable env variable config file toggle --- Camera/IndiCamera.py | 5 ++-- README.md | 10 +++++++ conf_files/config.yaml | 8 +++--- conf_files/targets.yaml | 60 +++++++++++++++++++++++++++++++++++++++++ utils/config.py | 2 +- 5 files changed, 78 insertions(+), 7 deletions(-) diff --git a/Camera/IndiCamera.py b/Camera/IndiCamera.py index 5e9252a..10c9b2a 100644 --- a/Camera/IndiCamera.py +++ b/Camera/IndiCamera.py @@ -310,9 +310,10 @@ def get_frame_type(self): def set_frame_type(self, frame_type): """ - FRAME_LIGHT Take a light frame exposure + FRAME_LIGHT Take a light fram mmmmmmmmmmmmmmmm bbb bnbn nb n b nb nb kllklke exposure FRAME_BIAS Take a bias frame exposure - FRAME_DARK Take a dark frame exposure + m, . ,m. ,mm m,,,,,,,,,,,, m,mmmmmmmmmmmmmmmmmmmmm mmm mm m mmmm mmmmmmmmmmFRAME_DARK Take a dark frame + exposure FRAME_FLAT Take a flat field frame exposure """ self.set_switch('CCD_FRAME_TYPE', [frame_type], sync=True, timeout=self.defaultTimeout) diff --git a/README.md b/README.md index d0c52c4..ef22abf 100644 --- a/README.md +++ b/README.md @@ -145,11 +145,13 @@ If you are interested in compiling/using the arduino stuff here, please download ## Setup indiweb on the machine that will host drivers check installation information on: https://github.com/knro/indiwebmanager +```console pip install indiweb sudo cp indiwebmanager.service /etc/systemd/system/ sudo chmod 644 /etc/systemd/system/indiwebmanager.service sudo systemctl daemon-reload sudo systemctl enable indiwebmanager.service +``` content of indiwebmanager.service ```bash @@ -198,13 +200,21 @@ Then edit CMakeFiles/3.7.2/CMakeSystem.cmake replace aarch64 by armv8 # How to launch the full stuff +First, if you have a custom configuration for your own setup, set the proper variable in you console: +```console +export REMOTE_OBSERVATORY_CONFIG=backyard_config +``` ## If you want to try the software with simulators: +```console ./apps/launch_indi_simu.sh PYTHONPATH=. python ./apps/launch_remote_observatory.py +``` ## If, in addition you want the nice dashboard (might require additional dependencies, scripts are untested) +```console ./apps/launch_PAWS.sh +``` ## Legacy or optional features ### Support for DBus scripting () diff --git a/conf_files/config.yaml b/conf_files/config.yaml index dd54c10..e2e3313 100644 --- a/conf_files/config.yaml +++ b/conf_files/config.yaml @@ -164,10 +164,10 @@ cameras: # CCD_PIXEL_SIZE_Y : 2.4 # CCD_BITSPERPIXEL : 12 SIMULATOR_SETTINGS: # 180mm - SIM_XRES: 1500 #5496 - SIM_YRES: 1500 #3672 - SIM_XSIZE: 4.8 #2.4 - SIM_YSIZE: 4.8 #2.4 + SIM_XRES: 3006 #5496 + SIM_YRES: 3006 #3672 + SIM_XSIZE: 3.76 #2.4 + SIM_YSIZE: 3.76 #2.4 SIM_MAXVAL: 65000 SIM_SATURATION: 1 SIM_LIMITINGMAG: 17 diff --git a/conf_files/targets.yaml b/conf_files/targets.yaml index 806411e..3143866 100644 --- a/conf_files/targets.yaml +++ b/conf_files/targets.yaml @@ -34,6 +34,66 @@ targets : temperature: gain: 10 exp_time_sec: 10 + Polaris: + Luminance: + count: 3 + temperature: + gain: 10 + exp_time_sec: 10 + Alioth: + Luminance: + count: 3 + temperature: + gain: 10 + exp_time_sec: 10 + Alkaid: + Luminance: + count: 3 + temperature: + gain: 10 + exp_time_sec: 10 + Dubhe: + Luminance: + count: 3 + temperature: + gain: 10 + exp_time_sec: 10 + Vega: + Luminance: + count: 3 + temperature: + gain: 10 + exp_time_sec: 10 + Sheliak: + Luminance: + count: 3 + temperature: + gain: 10 + exp_time_sec: 10 + Altair: + Luminance: + count: 3 + temperature: + gain: 10 + exp_time_sec: 10 + Sarin: + Luminance: + count: 3 + temperature: + gain: 10 + exp_time_sec: 10 + Kornephoros: + Luminance: + count: 3 + temperature: + gain: 10 + exp_time_sec: 10 + Alphecca: + Luminance: + count: 3 + temperature: + gain: 10 + exp_time_sec: 10 # M51 : # Luminance : # count : 10 diff --git a/utils/config.py b/utils/config.py index d1f2dbd..8d6e6f3 100644 --- a/utils/config.py +++ b/utils/config.py @@ -52,7 +52,7 @@ def load_config(config_files=None, parse=True, ignore_local=False): # Default to the pocs.yaml file if config_files is None: - config_files = [os.environ.get("REMOTE_OBSERVATORY_CONFIG", 'config')] + config_files = [os.environ.get("REMOTE_OBSERVATORY_CONFIG", "config")] config_files = listify(config_files) config = dict()