Cgminer does have provisions for temp monitoring, fan control, shut down, etc. but -- there needs to be a temp monitor of some sort to feed that info into cgminer and none of the Compacs have that. You could always look for RasPi projects that deal with temp control, mount a temp sensor to the heatsink and use it to simply switch off power to the sticks.
Stavroski, NotFuzzyWarm's solution is without a doubt the simplest way to garner temp monitoring.
In theory, if one could breakout pins 21-24 on the BM1397 hash chip one could garner a finer measurement of what one might call T
Junc.
Please reference attached image:
https://www.zeusbtc.com/Upload/image/202108/16280626681136747.JPGHaving said that I have no clue whether that is an analog or digital signals.
But it appears that Bitmain included temperature sensing into the chip/die.
Further, Bitmain uses the Ti TMP451AIDQFR temperature sensor on their 17 series hash boards to measure board temperature. Which are currently unavailable from any supplier anywhere in the USA (But may be found on eBay or Aliexpress). The data sheet may be found here:
https://www.ti.com/lit/ds/symlink/tmp451.pdf?ts=1641066272554&ref_url=https%253A%252F%252Fwww.google.com%252FThis uses a simple 2 wire serial interface which on the Pi is easy to interface with. Soooo, if one epoxy'ed one to the heatsink . . . .
Hope this helps & provides some possibilities.
Pup