NX-FanControl

Hi, this is my first switch project. With this sysmodule you can control the fan speed based on SoC temperature (the switch uses tskin temperature). Actually the sysmodule causes the switch to reboot if other software that check fan speed is opened (e.g. Status Monitor), so I created a library to easily add the fan control logic in other software (Status Monitor fork is WIP). With the overlay you can change the fan curve and set it without rebooting the console
NX-FanControl:
aHR0cHM6Ly9naXRodWIuY29tL1phdGhhd28vTlgtRmFuQ29udHJvbA==
libfancontrol:
aHR0cHM6Ly9naXRodWIuY29tL1phdGhhd28vbGliZmFuY29udHJvbA==

the links are b64 encoded because I'm new to the forum and i can't post links
 

mathew77

Lovin' life.
Member
Joined
Jan 19, 2019
Messages
1,287
Trophies
1
Age
47
XP
3,977
Country
Kazakhstan
@Zathawo
Cool!.. BTW, for now when I'm trying to open hbmenu with NX-FanControl sysmodule is ON, console just completely hang up into black screen, even without a proper Atmosphere BSOD.

AMS 1.7.1, FW 18.1.0, nx-hbloader v2.4.4.
 

masagrator

The patches guy
Developer
Joined
Oct 14, 2018
Messages
6,524
Trophies
3
XP
12,576
Country
Poland
I can always try to move reading fan level to something else. I know it's possible to do that via IO, but maybe I will find a better way...
Post automatically merged:

Reimplemented access to "pwm" service and switched reading fan rotation level from pwm duty cycle.

So now it doesn't conflict with your sysmodule.
https://github.com/masagrator/Status-Monitor-Overlay/releases/tag/1.1.3
Post automatically merged:

And also reporting issues with accessing hbmenu when your sysmodule is running.

Beside that your overlay is getting slow as f when sysmodule is enabled.
 
Last edited by masagrator,

Zathawo

New Member
OP
Newbie
Joined
Sep 1, 2024
Messages
4
Trophies
0
Age
21
XP
32
Country
Italy
I can always try to move reading fan level to something else. I know it's possible to do that via IO, but maybe I will find a better way...
Post automatically merged:

Reimplemented access to "pwm" service and switched reading fan rotation level from pwm duty cycle.

So now it doesn't conflict with your sysmodule.
Post automatically merged:

And also reporting issues with accessing hbmenu when your sysmodule is running.

Beside that your overlay is getting slow as f when sysmodule is enabled.
Thanks for the update, I want to study your code. Yes, the overlay is slow as f and I think is because in the update function I continuously fetch the config file and I wanna solve asap. As regards hbmenu crashing when the sysmodule is running, as soon as I have free time I’ll try to reproduce the issue
Post automatically merged:

@Zathawo
Cool!.. BTW, for now when I'm trying to open hbmenu with NX-FanControl sysmodule is ON, console just completely hang up into black screen, even without a proper Atmosphere BSOD.

AMS 1.7.1, FW 18.1.0, nx-hbloader v2.4.4.
Do you have any other sysmodule or hombrew that can access the fan controller?
 

Spark800

New Member
Newbie
Joined
Mar 29, 2024
Messages
2
Trophies
0
Age
20
XP
20
Country
Romania
I have the same issue as @mathew77, when I'm trying to open hbmenu with NX-FanControl sysmodule is ON, console just completely hang up into black screen, even without a proper Atmosphere BSOD.


Feature request: Can you make more presets? like 8-10 to finetune the curve.
 
  • Like
Reactions: mathew77

Zathawo

New Member
OP
Newbie
Joined
Sep 1, 2024
Messages
4
Trophies
0
Age
21
XP
32
Country
Italy
I have the same issue as @mathew77, when I'm trying to open hbmenu with NX-FanControl sysmodule is ON, console just completely hang up into black screen, even without a proper Atmosphere BSOD.


Feature request: Can you make more presets? like 8-10 to finetune the curve.
Can you post a zip file with your atmosphere, config and switch folders and hbmenu.nro file so I can do some test?

For the feature request: yes, I can. More point on fan table was the initial idea. I’ll also work on switching presets from handled and docked
 
  • Like
Reactions: Spark800

AlM2023

Member
Newcomer
Joined
Dec 17, 2023
Messages
23
Trophies
1
Age
37
XP
260
Country
Oman
It might be because Info NX & Observer-Tool overlays conflict with NX-FanControl. Deleted both Info NX & Observer-Tool overlays.
I have the same issue as @mathew77, when I'm trying to open hbmenu with NX-FanControl sysmodule is ON, console just completely hang up into black screen, even without a proper Atmosphere BSOD.


Feature request: Can you make more presets? like 8-10 to finetune the curve.
 

Spark800

New Member
Newbie
Joined
Mar 29, 2024
Messages
2
Trophies
0
Age
20
XP
20
Country
Romania
Can you post a zip file with your atmosphere, config and switch folders and hbmenu.nro file so I can do some test?

For the feature request: yes, I can. More point on fan table was the initial idea. I’ll also work on switching presets from handled and docked
Sure I can provide that. Add me on discord: Dominatorul
 

ppkantorski

Well-Known Member
Newcomer
Joined
May 1, 2023
Messages
96
Trophies
0
XP
699
Country
United States
@mathew77 @Spark800 the problem is due to ultrahand. I'm trying to understand and fix
I read your note. I know what the issue is. But for how to address it for your exact usage case, not 100% sure. However what I can do is move my `thermalstatusInit()` and `thermalstatusExit()` functions directly into where it reads the temperatures (or only keep them on when temperature widget is active). The confliction happens for some reason because of the services I've initialized in libTesla.

C++:
inline bool thermalstatusInit(void) {
    tcCheck = tcInitialize();
    tsCheck = tsInitialize();
    if (R_SUCCEEDED(tsCheck)) {
        g_tsSrv = tsGetServiceSession();
    } else
        return false;
 
    return true;
}

The work around I've made (but not uploaded yet) will only initialize these services when the temperature widget is turned on. This will make combining your script with ultrahand + hbmenu no longer crash (as long as the temperature widgets are disabled). If we can figure out a way to address this better (on my or your end), would be cool, but this should at least highlight the problem area for usage with your module.

sidenote: Status Monitor Overlay will also cause a crash for the same exact reason.
Post automatically merged:

I've updated Ultrahand v1.7.3 right now to account for this. Now users should no longer crash on hbmenu + Ultrahand + your module as long as the temperature widgets in Ultrahand are disabled. Over time a more elegant solution should be possible, but this should at least prevent those "always crash" type scenarios.
 
Last edited by ppkantorski,

masagrator

The patches guy
Developer
Joined
Oct 14, 2018
Messages
6,524
Trophies
3
XP
12,576
Country
Poland
SoC and PCB temps can be read via i2c.
https://github.com/CTCaer/hekate/blob/master/bdk/thermal/tmp451.h
https://github.com/CTCaer/hekate/bl...c23ac82c171b4fbf1c92/bdk/thermal/tmp451.c#L24

bool integer set to false returns value in iirc millicelsius.

I recommend to use i2c reg function from Status Monitor Overlay source code as it's designed for HOS and waits when value is updated (you need to tweak max17050 read function to read from TMP451)

https://github.com/masagrator/Status-Monitor-Overlay/blob/master/include/i2c.h

I won't be updating status monitor for that. I moved fan to pwm because fan is the service that has highest priority over adjusting fan speed, and I am only reading value, so it would go in the way of this sysmodule no matter what. Now you can do the same by not going in the way of your predecessors. :)
 
Last edited by masagrator,

ppkantorski

Well-Known Member
Newcomer
Joined
May 1, 2023
Messages
96
Trophies
0
XP
699
Country
United States
SoC and PCB temps can be read via i2c.
https://github.com/CTCaer/hekate/blob/master/bdk/thermal/tmp451.h
https://github.com/CTCaer/hekate/bl...c23ac82c171b4fbf1c92/bdk/thermal/tmp451.c#L24

bool integer set to false returns value in iirc millicelsius.

I recommend to use i2c reg function from Status Monitor Overlay source code as it's designed for HOS and waits when value is updated (you need to tweak max17050 read function to read from TMP451)

https://github.com/masagrator/Status-Monitor-Overlay/blob/master/include/i2c.h

I won't be updating status monitor for that. I moved fan to pwm because fan is the service that has highest priority over adjusting fan speed, and I am only reading value, so it would go in the way of this sysmodule no matter what. Now you can do the same by not going in the way of your predecessors. :)
Thanks for the advice. I am now reading SoC and PCB temps directly from i2c. This should prevent any issues with my temperature calls and nx-fancontrol while hbmenu is open. I'll be releasing this fix in the next update to Ultrahand (v1.7.4).
Post automatically merged:

ok ive updated Ultrahand to v1.7.4 (which pulls its temperature readings from `i2c` as discussed). this version also comes with some more features in addition to this. (see changelog)

Users should no longer have any problems with nx-fancontrol + Ultrahand. However as mentioned Status Monitor confliction may need to still be considered for your project.
 
Last edited by ppkantorski,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    AncientBoi @ AncientBoi: Anhouser Bush Got drunk n trashed his place. That's all