From 1a3b90a793a01086e1fe68009401fadf99fdb550 Mon Sep 17 00:00:00 2001 From: Peter Englmaier Date: Sat, 27 Apr 2024 13:46:56 +0200 Subject: [PATCH 1/4] Inform clients when temperature changes --- drivers/focuser/alluna_tcs2.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/focuser/alluna_tcs2.cpp b/drivers/focuser/alluna_tcs2.cpp index 28d19c873a..bfccc2fb1d 100644 --- a/drivers/focuser/alluna_tcs2.cpp +++ b/drivers/focuser/alluna_tcs2.cpp @@ -780,6 +780,7 @@ bool AllunaTCS2::getTemperature() receiveDone(); isGetTemperature=false; TemperatureNP.setState(IPS_OK); + TemperatureNP.apply(); // update clients break; default: // unexpected output LOGF_ERROR("GetTemperatures: unexpected response (%s)", res); From e828d3f79b84e24f56f64163cfc295c775620555 Mon Sep 17 00:00:00 2001 From: Peter Englmaier Date: Sat, 27 Apr 2024 13:48:09 +0200 Subject: [PATCH 2/4] Optimize update interval for temperature and fan speed --- drivers/focuser/alluna_tcs2.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/focuser/alluna_tcs2.cpp b/drivers/focuser/alluna_tcs2.cpp index bfccc2fb1d..7184c9f3cb 100644 --- a/drivers/focuser/alluna_tcs2.cpp +++ b/drivers/focuser/alluna_tcs2.cpp @@ -739,7 +739,7 @@ bool AllunaTCS2::getTemperature() // d#{ambient-humidity} std::chrono::duration seconds = std::chrono::system_clock::now() - last_temp_update; - if ( !first_run && seconds.count() < 300 ) // update every 300 seconds + if ( !first_run && seconds.count() < 10 ) // update every 10 seconds { if (tcs.try_lock()) { tcs.unlock(); // we need to get lock, to make TimerHit behave the same when we block reading temperature @@ -978,7 +978,7 @@ bool AllunaTCS2::getFanPower() char res[DRIVER_LEN] = {0}; std::chrono::duration seconds = std::chrono::system_clock::now() - last_temp_update; - if ( !first_run && seconds.count() < 3 ) // update every 3 seconds + if ( !first_run && seconds.count() < 30 ) // update every 30 seconds { if (tcs.try_lock()) { tcs.unlock(); // we need to get lock, to make TimerHit behave the same when we block reading temperature From 467586c6157bbedfbbdb2761994606d7c2750cd5 Mon Sep 17 00:00:00 2001 From: Peter Englmaier Date: Sat, 27 Apr 2024 13:49:03 +0200 Subject: [PATCH 3/4] Update log message --- drivers/focuser/alluna_tcs2.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/focuser/alluna_tcs2.cpp b/drivers/focuser/alluna_tcs2.cpp index 7184c9f3cb..7233ed64a8 100644 --- a/drivers/focuser/alluna_tcs2.cpp +++ b/drivers/focuser/alluna_tcs2.cpp @@ -594,7 +594,7 @@ bool AllunaTCS2::AbortFocuser() void AllunaTCS2::TimerHit() { - //LOG_INFO("TimerHit"); + LOG_INFO("TimerHit"); if (!isConnected()) return; // No need to reset timer if we are not connected anymore @@ -866,7 +866,7 @@ bool AllunaTCS2::setStepping(SteppingMode mode) char cmd[DRIVER_LEN] = {0}; steppingMode=mode; value = (mode == SPEED) ? 0 : 1; - LOGF_INFO("Setting stepping mde to: %s", (mode==SPEED)?"SPEED":"micro"); + LOGF_INFO("Setting stepping mode to: %s", (mode==SPEED)?"SPEED":"micro"); LOGF_INFO("Setting stepping mode to: %d", value); snprintf(cmd, DRIVER_LEN, "SetFocuserMode %d\n", value); return sendCommand(cmd); From 91f873cb474c8fbe6b2edfaff1b920c6bce13df9 Mon Sep 17 00:00:00 2001 From: Peter Englmaier Date: Sat, 27 Apr 2024 13:54:04 +0200 Subject: [PATCH 4/4] Fix copyright message to reflect actual authorship --- drivers/focuser/alluna_tcs2.h | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/focuser/alluna_tcs2.h b/drivers/focuser/alluna_tcs2.h index c16859c0c5..8df3fff612 100644 --- a/drivers/focuser/alluna_tcs2.h +++ b/drivers/focuser/alluna_tcs2.h @@ -1,14 +1,8 @@ /* - Skeleton Focuser Driver + Alluna TCS2 Focus, Dust Cover, Climate, Rotator, and Settings + (Dust Cover and Rotator are not implemented) - Modify this driver when developing new absolute position - based focusers. This driver uses serial communication by default - but it can be changed to use networked TCP/UDP connection as well. - - Copyright(c) 2019 Jasem Mutlaq. All rights reserved. - - Thanks to Rigel Systems, especially Gene Nolan and Leon Palmer, - for their support in writing this driver. + Copyright(c) 2022 Peter Englmaier. All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public