Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/fans.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ void TpFanDriver::ping_watchdog_and_depulse(const Level &level)
}
else if (last_watchdog_ping_ + watchdog_ - sleeptime <= std::chrono::system_clock::now()) {
log(TF_DBG) << "Watchdog ping" << flush;
set_speed(level);
std::fstream f(path_);
if (!(f.is_open() && f.good()))
throw IOerror(MSG_FAN_INIT(path_), errno);
if (!(f << "watchdog " << watchdog_.count() << std::flush))
throw IOerror(MSG_FAN_INIT(path_), errno);

@ile371 ile371 May 18, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Old open PR but can confirm this fix works! However, one side effect is that the Watchdog ping starts happening every cycle after the first one because the last_watch_dog_ping_ isn't set. Should set it at row 147 every time the else if runs similarly to what the set_speed function does:

Suggested change
throw IOerror(MSG_FAN_INIT(path_), errno);
throw IOerror(MSG_FAN_INIT(path_), errno);
last_watchdog_ping_ = std::chrono::system_clock::now();

}
}

Expand Down