Editing dietpi-globals Topic is solved

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
Thanapat
Posts: 5
Joined: Tue Feb 16, 2021 1:55 pm

Editing dietpi-globals

Post by Thanapat »

Hi, everyone.
I just install dietpi on my Roseapple Pi.
The roseapple pi is a SBC like raspberry pi and I received long time ago, and now the developer of roseapple pi is discontinued. So I install dietpi on it using PREP_SYSTEM_FOR_DIETPI.sh script. And found that CPU temp on SSH banner shows 0*C all the time.
After I search for many hours, I found that roseapple CPU temp is on /sys/class/thermal/thermal_zone1/temp but dietpi read /sys/class/thermal/thermal_zone0/temp. So I edit dietpi-globals to read cpu temp from /sys/class/thermal/thermal_zone1/temp instead and that's work!
I have a question that in future if dietpi has update. Will dietpi-globals overwritten and my script will gone ?
User avatar
Joulinar
Posts: 4502
Joined: Sat Nov 16, 2019 12:49 am

Re: Editing dietpi-globals

Post by Joulinar »

Hi,

yes usually all DietPi scripts will be overwritten running dietpi-update
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Thanapat
Posts: 5
Joined: Tue Feb 16, 2021 1:55 pm

Re: Editing dietpi-globals

Post by Thanapat »

Thank you for the answer. Do you have any suggestion to keep SSH banner shows actual cpu temp?

Thank you.
User avatar
Joulinar
Posts: 4502
Joined: Sat Nov 16, 2019 12:49 am

Re: Editing dietpi-globals

Post by Joulinar »

not really, except it will be added to the script directly.

@MichaIng
something to add to our script?
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
MichaIng
Site Admin
Posts: 2914
Joined: Sat Nov 18, 2017 6:21 pm

Re: Editing dietpi-globals

Post by MichaIng »

@Thanapat
Does /sys/class/thermal/thermal_zone0/temp even exist and in case does it contain 0 or something else? If it does contain an integer, it's difficult to get that fixed for Roseapple Pi without breaking it for other SBCs, since we have no dedicated hardware ID for Roseapple Pi. But if the other kernel tunables do not contain valid integers, we could add /sys/class/thermal/thermal_zone1/temp to the end of the list, so that it is only parsed if previous tunables are not present or contain garbage.
Thanapat
Posts: 5
Joined: Tue Feb 16, 2021 1:55 pm

Re: Editing dietpi-globals

Post by Thanapat »

Yes, /sys/class/thermal/thermal_zone0/temp contain 0.
Are there any method to change thermal_zone1/ into thermal_zone0?
User avatar
MichaIng
Site Admin
Posts: 2914
Joined: Sat Nov 18, 2017 6:21 pm

Re: Editing dietpi-globals

Post by MichaIng »

There is at least no generic way to rename kernel tunables. Probably we could treat all non-positive values as invalid. I mean theoretically it's possible to use liquid nitrogen cooling and such to run a CPU at negative degree Celsius, but I doubt that any of our users practically does this. This also solves an issue for some OrangePi's where currently temperatures like "-25435" are shown, whatever the meaning/purpose of this is kernel-wise.
Thanapat
Posts: 5
Joined: Tue Feb 16, 2021 1:55 pm

Re: Editing dietpi-globals

Post by Thanapat »

That’s a great solution. I think this could solve the same problem on many SBCs. Will you implement this solution in the further update?
Thanapat
Posts: 5
Joined: Tue Feb 16, 2021 1:55 pm

Re: Editing dietpi-globals

Post by Thanapat »

Thank you very much.
Post Reply