He also shows an example of how he put it all on the workbench title bar.
So I modified it a bit:
1). updated it a bit so it will check if rexxsupport.library was loaded or not, and if not addlib it (as can cause issues with some ARexx commands if not).
2). put "forever loop" with delay(50) so it will run every few seconds without CPU loading. So you can put it to prefs:wbstartup
3). made it set necessary env variables, so you can use them for the title bar of a workbench in the prefs:workbench/screen_title_format settings.
4). translate german comments to English so you know what it does :)
Now, there is a modified script:
/* Read and output temperature sensors of the X5000 */
IF ~show('L','rexxsupport.library') THEN CALL addlib('rexxsupport.library', 0, -30)
/* Open the port handler with parameters according to TRM */
IF OPEN('Ser1', 'SER:38400/UNIT=1/FLOW=NONE/8N1') ~= 1 THEN DO
SAY 'Could not open port handler'
EXIT 10
END
ELSE DO FOREVER
/* a bit of wait to avoid cpu loading */
CALL delay(50)
/* Send temperature command to MCU */
/* No line feed! WRITELN () does that itself */
WRITELN('Ser1', '#t')
/* And read what the MCU returned to us, max. 11 bytes of data + 1 ln */
temps = READCH('Ser1', 12)
/* SAY 'Raw data read: ' temps */
/* A couple of checks according to TRM */
IF LENGTH(temps) ~= 12 THEN DO
SAY 'Implausible length of the answer!'
EXIT 10
END
ELSE DO
IF INDEX(temps, "$t") ~= 1 THEN DO
SAY 'Format of the answer incorrect!'
EXIT 10
END
END
/* Split apart according to TRM and convert from hex to decimal */
pcbSign = SUBSTR(temps, 3, 1)
pcbTemp = X2D(SUBSTR(temps, 4, 2))
cpuSign = SUBSTR(temps, 6, 1)
cpuTemp = X2D(SUBSTR(temps, 7, 2))
pciSign = SUBSTR(temps, 9, 1)
pciTemp = X2D(SUBSTR(temps, 10, 2))
/*
SAY 'Temperatures:'
SAY ' Motherboard: 'pcbSign''pcbTemp '°C'
SAY ' CPU........: 'cpuSign''cpuTemp '°C'
SAY ' PCIe-Switch: 'pciSign''pciTemp '°C'
*/
END
WARNING ! Be sure you run prefs:serial and click "Save" at least , or script will not works! (dunno details, probabaly create something somewhere which isn't by default).
WARNING 2: it will make your system slug when script will query temp, so fixed C version (see at end) will be surely better
All the changes which need to do for the script itself, for the prefs:workbench, for the prefs:wbstartup, and how it all looks like after in title bar of workbench shown on the screenshot below (click open in new tab for full size). See at the title bar
BTW, see with Noctua cooler which is 3000 RPM giving 19.3dBA only (very silent) CPU temp is about 65-66C. Not that much and IMHO OK, but with the one I got with a motherboard (DC BRUSHLESS model AFB0612EHD) which got 6600 RPM, but also 45 (!) dBA (very noise), I got just about 56C
Anyway, if any of you need it, and doesn't want to bother with tinkering, there a ready script + icon to download:
Also, in the same thread on os4welt (page8), Zerohero tried to make a C analog so it will be not a script, but simply and small tiny good binary which we can easily use in WBStartup as well without messing with ARexx, but... I can't make it to works, there probably some little bug in. Maybe anyone can spot it? There is a code:
This one from ZeroG for sure will be of better use, and it will waste much less cpu than this "forever" loop with delays.
Edited by kas1e on 2020/12/25 9:13:16 Edited by kas1e on 2020/12/25 12:16:15 Edited by kas1e on 2020/12/25 12:17:16 Edited by kas1e on 2020/12/25 13:43:47 Edited by kas1e on 2021/3/9 7:25:14
I noted the details fully now, and tested with system power on and waiting 10-15 minutes doing nothing with RadeonHD in (but with Radeon RX values the same btw). Also different tests with all fans from tower disabled/enabled (i have 3, one back 2 at the top), so:
With the default "DC BRUSHLESS model AFB0612EHD" (60x60, 6600 RPM and 45 dBA noise).
All fans from the tower disabled:
MainBoard: 39 CPU: 56 PCIe: 74
With all fans from the tower enabled:
MainBoard: 37 CPU: 54 PCIe: 74
With Noctua-nf-a6x25-flx (60x60, 3000 RPM, 19.3 dBA):
Btw, I made a small video showing how to replace CPU Fan on X5K. Not that it something about learns you how to do so, just tried to make a nice vid with comments and stuff (turn the volume up)
@Skateman Probably at some point and for a full system they put Silent6, but as I was the first one who got just the first motherboards for beta-testing, I got one with such a crappy noisy cooler. imagine 45dBA! Maybe they put 6600 RPM ones for beta-test just to be sure it did not die because of overhot issues or something :)
I think something like a "modern graphics card" make such a noise, but no, it was this crappy CPU fan! Now I have that Noctua 3000 RPM / 19.3 dBA, and sometimes I even think is my x5000 up and running at all? And yeah, it is, just very silent now.
ps. Checked now while x5000 was up and running for 5 hours:
And that just with Silent6 and nothing else? 51C for CPU quite better than 65 :) Can you make a photo of your heatsink under the cooler as well (maybe they change it too for the full system releases)
Ok, I find out what wrong with the C version. There is a long story if one interested (and who not, can scroll down to download ready binary + fixed source).
For first I checked TRM (technical reference manual) for Cyrus. It says that you can send 4 commands to the MCU :
1). #s for power-off (yeah, just power off the machine) 2). #t for temperature (motherboard, CPU, and PCIe-switch) 3). #v for voltages (lots of them for CPLD, Xena, Ethernet, etc, etc). 4). #f for CPU Fan (to get values when Fan connected on the CPU Fan connector).
Firstly I start playing with ARexx by sending this kind of data to the serial port and read the answer-back, to see if all ok.
A shutdown was ok. The temperature was ok. FAN info was ok. But volts wasn't ok!
For volts there seems to be a bug: If you read more than 51 bytes - then it just stuck. Like buffer ends.
Seeing TRM there written that VOLT data is 13 pairs per 4, so 13*4 = 52 + 2 for $v (returns at beginning of buffer so you sure its correct data) + 1 for termination, so it should read fine at least 54 or 55 with a carriage return. But I only can read 51 bytes without being "stuck", and have such an output:
So it seems that instead, they have 12 pairs per 4 bytes, not 13. so 48, +2 for $t return, +1 for "null termination" and then it explains while for 52 it stuck, as it can maximum 51.
In other words, I have a wild idea that for VOLT "Serdes" (this is the last field in returned structure) can't be read. Buggy, or not implemented, dunno. That can explain why Zerohero's version didn't work and stuck the same as it stuck when I tried to read in ARexx more than 51 bytes.
So fixed C version of ZeroG code which read temperatures, volts and fan data (RPM, PWM, etc), source, binary, 2 ARexx scripts are there:
Probably from this C code can be done pretty good nice dockie! Or at minimum, it can be used to set return values of temperatures to the environment, and the same used in the screen title bar (which is better than ARexx scripts, IMHO).
And there is a version which only read the temperatures and set the same necessary environment values as previous ARexx scripts in the first post (so you can use it in WBStartup instead of ARexx scripts):
@Kas1e - maybe the missing bits are from the other end than what you originally thought?
*edit*
Actually I believe it may just be a simple case of the TRM being wrong.
After looking through the rest of the document for details on the xorro slot I have found references to it being 3.3V and not 1.0V, so it could be a simple case of copy and paste gone mad and the order is actually
1. CPLD, 3.3V
2. Xena/Xorro 3.3V
3. PCIe switch, 1.0V
4. Xena 1.0V
5. 3.3V
6. 2.5V
7. Ethernet 1.2V
8. Platform, 1.0V
9. Core A, 1.0V for P3041 1.1V for P5020, 1.1V-1.2V for P5040
10. Core B, 1.0V for P3041 1.1V for P5020, 1.1V-1.2V for P5040
11. DDR3 IO, 1.5V
12. Serdes, 1.8V