Last active 1 month ago

Erreur32's Avatar Erreur32 revised this gist 4 months ago. Go to revision

1 file changed, 13 insertions, 20 deletions

Tips_s-tui_couleur_filtre_auxtin.md

@@ -2,7 +2,8 @@
2 2
3 3 Objectif : éviter que **s-tui passe en rouge** à cause de capteurs “fantômes” (`AUXTIN*`, `SYSTIN`) exposés par certaines cartes mères (Nuvoton `nct6798` / driver `nct6775`).
4 4
5 - # Hacks fix APT source
5 + # 1) Hacks fix APT source (quick fix)
6 +
6 7 ```bash
7 8 cp /usr/lib/python3/dist-packages/s_tui/sources/temp_source.py{,.bak}
8 9 nano /usr/lib/python3/dist-packages/s_tui/sources/temp_source.p
@@ -10,7 +11,7 @@ nano /usr/lib/python3/dist-packages/s_tui/sources/temp_source.p
10 11
11 12 ## 2) Patch (2 endroits)
12 13
13 - -1) Dans __init__, après sensor_label = sensor.label
14 + - Dans __init__, après sensor_label = sensor.label
14 15
15 16 Ajoute :
16 17 ```python
@@ -18,7 +19,7 @@ nano /usr/lib/python3/dist-packages/s_tui/sources/temp_source.p
18 19 if sensor_label and any(x in sensor_label.lower() for x in ("auxtin", "systin")):
19 20 continue
20 21 ```
21 - B) Dans update(), juste avant self.last_measurement.append(...)
22 + - Dans update(), juste avant self.last_measurement.append(...)
22 23
23 24 Ajoute :
24 25 ```python
@@ -26,31 +27,23 @@ Ajoute :
26 27 if minor_sensor.label and any(x in minor_sensor.label.lower() for x in ("auxtin", "systin")):
27 28 continue
28 29 ```
29 - 3) Test
30 - ```
31 - s-tui -t
32 - ```
33 30
34 - ✅ Systin / Auxtin*, et le rouge “alerte” va disparaître.
31 + - Test
32 + `s-tui -t`
35 33
36 -
34 + ## Exemple : alerte au-dessus de 80°C
37 35
38 - ---
36 + `s-tui --t_thresh 80`
39 37
40 - # Permanent
41 - ✅ Solution : installer **s-tui via pip --user** et patcher **temp_source.py** (sans toucher le paquet apt).
42 -
43 - ---
38 + ✅ Systin / Auxtin*, et le rouge “alerte” va disparaître.
44 39
45 - ## 0) Symptôme typique
40 +
46 41
47 - `sensors` ou s-tui affiche des valeurs comme :
42 + ---
48 43
49 - - `SYSTIN: 119°C`
50 - - `AUXTIN0..2: 111–115°C`
51 - - parfois `AUXTIN3: -41°C`
44 + # 2) Solution Permanent
52 45
53 - Ces sondes sont souvent **non câblées** (entrées flottantes) → valeurs fausses.
46 + ✅ Solution : installer **s-tui via pip --user** et patcher **temp_source.py** (sans toucher le paquet apt).
54 47
55 48 ---
56 49

Erreur32's Avatar Erreur32 revised this gist 4 months ago. Go to revision

1 file changed, 36 insertions

Tips_s-tui_couleur_filtre_auxtin.md

@@ -2,6 +2,42 @@
2 2
3 3 Objectif : éviter que **s-tui passe en rouge** à cause de capteurs “fantômes” (`AUXTIN*`, `SYSTIN`) exposés par certaines cartes mères (Nuvoton `nct6798` / driver `nct6775`).
4 4
5 + # Hacks fix APT source
6 + ```bash
7 + cp /usr/lib/python3/dist-packages/s_tui/sources/temp_source.py{,.bak}
8 + nano /usr/lib/python3/dist-packages/s_tui/sources/temp_source.p
9 + ```
10 +
11 + ## 2) Patch (2 endroits)
12 +
13 + -1) Dans __init__, après sensor_label = sensor.label
14 +
15 + Ajoute :
16 + ```python
17 + # Ignore fake / floating motherboard sensors (often 110-120°C)
18 + if sensor_label and any(x in sensor_label.lower() for x in ("auxtin", "systin")):
19 + continue
20 + ```
21 + B) Dans update(), juste avant self.last_measurement.append(...)
22 +
23 + Ajoute :
24 + ```python
25 + # Ignore fake / floating motherboard sensors (often 110-120°C)
26 + if minor_sensor.label and any(x in minor_sensor.label.lower() for x in ("auxtin", "systin")):
27 + continue
28 + ```
29 + 3) Test
30 + ```
31 + s-tui -t
32 + ```
33 +
34 + ✅ Systin / Auxtin*, et le rouge “alerte” va disparaître.
35 +
36 +
37 +
38 + ---
39 +
40 + # Permanent
5 41 ✅ Solution : installer **s-tui via pip --user** et patcher **temp_source.py** (sans toucher le paquet apt).
6 42
7 43 ---

Erreur32's Avatar Erreur32 revised this gist 4 months ago. Go to revision

1 file changed, 171 insertions

Tips_s-tui_couleur_filtre_auxtin.md(file created)

@@ -0,0 +1,171 @@
1 + # Hack propre de s-tui (Debian) : ignorer AUXTIN/SYSTIN (fausses températures ~115°C)
2 +
3 + Objectif : éviter que **s-tui passe en rouge** à cause de capteurs “fantômes” (`AUXTIN*`, `SYSTIN`) exposés par certaines cartes mères (Nuvoton `nct6798` / driver `nct6775`).
4 +
5 + ✅ Solution : installer **s-tui via pip --user** et patcher **temp_source.py** (sans toucher le paquet apt).
6 +
7 + ---
8 +
9 + ## 0) Symptôme typique
10 +
11 + `sensors` ou s-tui affiche des valeurs comme :
12 +
13 + - `SYSTIN: 119°C`
14 + - `AUXTIN0..2: 111–115°C`
15 + - parfois `AUXTIN3: -41°C`
16 +
17 + Ces sondes sont souvent **non câblées** (entrées flottantes) → valeurs fausses.
18 +
19 + ---
20 +
21 + ## 1) Installer s-tui en version user (pip)
22 +
23 + ### Installer pip (si besoin)
24 + ```bash
25 + sudo apt update
26 + sudo apt install python3-pip
27 + ```
28 +
29 + ### Installer s-tui côté utilisateur
30 + ```bash
31 + python3 -m pip install --user --upgrade s-tui
32 + ```
33 +
34 + Vérifier la version :
35 + ```bash
36 + ~/.local/bin/s-tui --version
37 + ```
38 +
39 + ---
40 +
41 + ## 2) S'assurer que le s-tui “pip” est prioritaire
42 +
43 + Afficher le chemin exécuté :
44 + ```bash
45 + which s-tui
46 + ```
47 +
48 + ✅ Attendu :
49 + ```
50 + /home/<user>/.local/bin/s-tui
51 + ```
52 +
53 + Si ce n’est pas le cas, ajoute `~/.local/bin` au PATH :
54 +
55 + ```bash
56 + echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
57 + source ~/.bashrc
58 + ```
59 +
60 + Re-teste :
61 + ```bash
62 + which s-tui
63 + ```
64 +
65 + ---
66 +
67 + ## 3) Trouver le fichier à patcher (temp_source.py)
68 +
69 + Commande qui affiche le chemin exact :
70 +
71 + ```bash
72 + python3 -c 'import os; import s_tui.sources.temp_source as t; print(os.path.abspath(t.__file__))'
73 + ```
74 +
75 + Exemple de chemin :
76 + ```
77 + /home/<user>/.local/lib/python3.11/site-packages/s_tui/sources/temp_source.py
78 + ```
79 +
80 + ---
81 +
82 + ## 4) Patch : ignorer AUXTIN et SYSTIN
83 +
84 + Édite le fichier trouvé à l’étape précédente :
85 +
86 + ```bash
87 + nano /home/<user>/.local/lib/python3.11/site-packages/s_tui/sources/temp_source.py
88 + ```
89 +
90 + ### 4.1 Ajouter un filtre dans `__init__`
91 +
92 + Trouve ce bloc :
93 +
94 + ```python
95 + sensor_label = sensor.label
96 + ```
97 +
98 + Juste après, ajoute :
99 +
100 + ```python
101 + # Ignore fake / floating motherboard sensors (often 110-120°C)
102 + if sensor_label and any(x in sensor_label.lower() for x in ("auxtin", "systin")):
103 + continue
104 + ```
105 +
106 + ### 4.2 Ajouter le même filtre dans `update()`
107 +
108 + Trouve ce bloc dans `update()` :
109 +
110 + ```python
111 + if (minor_sensor.current <= 1.0 or
112 + minor_sensor.current >= 127.0):
113 + continue
114 + ```
115 +
116 + Juste après, ajoute :
117 +
118 + ```python
119 + # Ignore fake / floating motherboard sensors (often 110-120°C)
120 + if minor_sensor.label and any(x in minor_sensor.label.lower() for x in ("auxtin", "systin")):
121 + continue
122 + ```
123 +
124 + ---
125 +
126 + ## 5) Tester
127 +
128 + ### Vérifier que les capteurs ont disparu
129 + ```bash
130 + s-tui -t | tr ',' '\n' | grep -iE 'auxtin|systin' || echo "OK: plus de AUXTIN/SYSTIN"
131 + ```
132 +
133 + ### Lancer le TUI normal
134 + ```bash
135 + s-tui
136 + ```
137 +
138 + ---
139 +
140 + ## 6) Bonus : régler le seuil d’alerte température
141 +
142 + Exemple : alerte au-dessus de 80°C
143 + ```bash
144 + s-tui --t_thresh 80
145 + ```
146 +
147 + ---
148 +
149 + ## 7) Revenir en arrière (si besoin)
150 +
151 + ### 7.1 Réinstaller s-tui pip (reset patch)
152 + ```bash
153 + python3 -m pip install --user --force-reinstall --no-cache-dir s-tui
154 + ```
155 +
156 + ### 7.2 Utiliser la version apt
157 + ```bash
158 + sudo apt install --reinstall s-tui
159 + ```
160 +
161 + Puis vérifie :
162 + ```bash
163 + which s-tui
164 + ```
165 +
166 + ---
167 +
168 + ## Notes
169 +
170 + - Cette méthode est **propre** : ton patch ne sera pas écrasé par `apt upgrade`.
171 + - Si tu refais un `pip install --upgrade s-tui`, ton patch peut être écrasé → il faudra le remettre.
Newer Older