Outils pour utilisateurs

Outils du site


man:campus:raspberry:start

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
man:campus:raspberry:start [2022/12/20 14:30] teknophilman:campus:raspberry:start [2024/08/27 16:43] (Version actuelle) – [Imeon] teknophil
Ligne 27: Ligne 27:
 Éditez /etc/xdg/lxsession/LXDE/autostart : Éditez /etc/xdg/lxsession/LXDE/autostart :
  
-<code> +<code>sudo nano /etc/xdg/lxsession/LXDE/autostart</code>
-sudo nano /etc/xdg/lxsession/LXDE/autostart +
-</code>+
  
 Supprimez ou commentez avec un # la ligne suivante : Supprimez ou commentez avec un # la ligne suivante :
  
-<code> +<code>@xscreensaver -no-splash</code>
-@xscreensaver -no-splash +
-</code>+
  
 Ajoutez cette ligne en fin de fichier : Ajoutez cette ligne en fin de fichier :
  
-<code> +<code>@xset s noblank @xset s off @xset -dpms</code>
-@xset s noblank @xset s off @xset -dpms +
-</code>+
  
 Editez le fichier /etc/lightdm/lightdm.conf : Editez le fichier /etc/lightdm/lightdm.conf :
  
-<code> +<code>sudo nano /etc/lightdm/lightdm.conf</code>
-sudo nano /etc/lightdm/lightdm.conf +
-</code>+
  
 Ajoutez la ligne suivante dans la section [Seat:*] : Ajoutez la ligne suivante dans la section [Seat:*] :
  
-<code> +<code>xserver-command=X -s 0 -dpms</code>
-xserver-command=X -s 0 -dpms +
-</code>+
  
 Après un redémarrage, le Raspberry Pi ne passera plus en veille. Après un redémarrage, le Raspberry Pi ne passera plus en veille.
Ligne 59: Ligne 49:
 ==== Lancer Firefox en mode kiosk ==== ==== Lancer Firefox en mode kiosk ====
  
-Créer un fichier sur le bureau "start_firefox.sh"+__Installer Firefox__ 
 + 
 +<code>sudo apt install firefox-esr</code> 
 + 
 +__Créer un fichier sur le bureau "start_firefox.sh"__
  
 <file bash start_firefox.sh> <file bash start_firefox.sh>
Ligne 67: Ligne 61:
 </file> </file>
  
-<code> +__Rendre le script éxécutable__ 
-firefox -kiosk -private-window + 
-</code>+<code>sudo chmod +x /home/esli/Desktop/start_firefox.sh</code> 
 + 
 +==== Masquer la souris ==== 
 + 
 +<code>sudo apt install unclutter</code> 
 + 
 +<code>sudo nano /etc/xdg/lxsession/LXDE/autostart</code> 
 + 
 +<code>@unclutter</code>
  
 ==== Autostart ==== ==== Autostart ====
  
-<code> +<code>sudo nano /etc/xdg/lxsession/LXDE-pi/autostart</code>
-sudo nano /etc/xdg/lxsession/LXDE-pi/autostart +
-</code>+
  
-<code> +<code>@/home/esli/Desktop/start_firefox.sh</code>
-@/home/esli/Desktop/start_firefox.sh +
-</code>+
  
 ===== Accès à distance (pour Windows) ===== ===== Accès à distance (pour Windows) =====
Ligne 85: Ligne 83:
 ==== Installation de Tightvnc ==== ==== Installation de Tightvnc ====
  
-Téléchargez et exécutez le logiciel d'installation de Tightvnc:+  - Téléchargez et exécutez le logiciel d'installation de Tightvnc: https://www.tightvnc.com/download.php prendre "Installer for Windows (64-bit)"{{ :man:campus:raspberry:tightvnc_install_1.png?600 |}} 
 +  - Cliquez sur Next{{ :man:campus:raspberry:tightvnc_install_2.png?600 |}} 
 +  - Cochez "I accept the terms..." et cliquez Next{{ :man:campus:raspberry:tightvnc_install_3.png?600 |}} 
 +  - Cliquez sur "Custom"{{ :man:campus:raspberry:tightvnc_install_4.png?600 |}} 
 +  - Cliquez à côté de "Tightvnc Server" sur la petite flèche (<color red>1</color>) et cliquez "Entire feature..." (<color red>2</color>
 +  - Puis cliquez Next{{ :man:campus:raspberry:tightvnc_install_5.png?600 |}} 
 +  - Laissez la case cocher et cliquer Next{{ :man:campus:raspberry:tightvnc_install_6.png?600 |}} 
 +  - Cliquez Install{{ :man:campus:raspberry:tightvnc_install_7.png?600 |}} 
 +  - Cliquez Finish
  
-  * https://www.tightvnc.com/download.php prendre "Installer for Windows (64-bit)"+==== Utilisation de Tightvnc ====
  
-{{:man:campus:raspberry:tightvnc_install_1.png?400|}}+  - Lancez Tight Viewer{{ :man:campus:raspberry:tightvnc_util_1.png?600 |}} 
 +  - Inscrivez dans "Remote Host" (<color red>1</color>): RPITV-ESLI.local:5900 Puis cliquez sur "Connect" 
 +  - MDP: le mot de passe adminlocal des PC{{ :man:campus:raspberry:tightvnc_util_2.png?600 |}} 
 +  - Vous pouvez cliquer sur la loupe auto (<color red>1</color>) et agrandir la fenêtre 
 +  - La mise en plein écran est possible (<color red>2</color>) <color red>ATTENTION</color> pour sortir faire <color red>Ctrl+Alt+Maj+F</color> (ne pas oublier)
  
-  * Cliquez sur Next+==== Fermer Firefox ====
  
-{{:man:campus:raspberry:tightvnc_install_2.png?400|}}+Firefox en démarré en mode Kiosk, toutes les actions souris ou clavier sont bloquéPour sortir faire ATL + F4
  
-  * Cochez "I accept the terms..." et cliquez Next+==== Relancer Firefox ====
  
-{{:man:campus:raspberry:tightvnc_install_3.png?400|}}+Double cliquer sur le fchier start_firefox.sh puis cliquer lancer
  
-  * Cliquez sur "Custom"+===== Imeon =====
  
-{{:man:campus:raspberry:tightvnc_install_4.png?400|}}+<file pyhton imeon.py> 
 +#!/usr/bin/python
  
-  * Cliquez à côté de "Tightvnc Server" sur la petite flèche (<color red>1</color>) et cliquez "Entire feature..." (<color red>2</color>) +import requests 
-  * Puis cliquez Next+import requests.exceptions 
 +import json 
 +import time
  
-{{:man:campus:raspberry:tightvnc_install_5.png?400|}}+LOGIN_URL       = "http://192.168.1.15/login" 
 +DATA_URL1       = "http://192.168.1.15/battery-status" 
 +DATA_URL2       = "http://192.168.1.15/imeon-status" 
 +DATA_URL3       = "http://192.168.1.15/data-lithium" 
 +EMAIL           = "installer@local" # default Imeon login 
 +PASSWORD        = "Installer_P4SS"  # default Imeon pass 
 +debug           = False # True will display the output on your tty 
 +payload         = {}
  
-  * Laissez la case cocher et cliquer Next+def poll_imeon_data(): 
 +  global payload 
 +  session = requests.Session()
  
-{{:man:campus:raspberry:tightvnc_install_6.png?400|}}+  try: 
 +      resp    = session.post(LOGIN_URL, data={"email" EMAIL , "passwd"PASSWORD}, timeout=2) 
 +      data1   = session.get(DATA_URL1, timeout=2) 
 +      data2   = session.get(DATA_URL2, timeout=2) 
 +      data3   = session.get(DATA_URL3, timeout=2)
  
-  * Cliquez Install+      resp.raise_for_status() 
 +      data1.raise_for_status() 
 +      data2.raise_for_status() 
 +      data3.raise_for_status()
  
-{{:man:campus:raspberry:tightvnc_install_7.png?400|}}+      values1 = data1.json() 
 +      values2 = data2.json() 
 +      values3 = data3.json() 
 +       
 +      payload["Timestamp"          = str(time.ctime()) 
 +      payload["Battery_status"     = str(values1['bat_status']) 
 +      #payload["Battery_state"     = str(values2['state_battery']['message']) 
 +      payload["Battery_activity"   = str(values2['state_battery']['class']) 
 +      payload["Battery_current"    = str(values3['battery-current']) 
 +      payload["Battery_tension"    = str(values3['battery-tension']) 
 +      payload["Battery_temperature"] = str(values3['tmp-bat']) 
 +      payload["Battery_charge"     = str(values3['bms-soc']) 
 +      payload["Battery_error"      = str(values3['error']) 
 +      payload["Battery_warning"    = str(values3['warning'])
  
-  * Cliquez Finish+      A = str(values2['state_grid']['message']) 
 +      B = str(values2['state_meter']['message']) 
 +      C = str(values2['state_pv']['message'])
  
-==== Utilisation de Tightvnc ====+      payload["Grid_state"         A.rstrip(A[-1]) 
 +      payload["Meter_state"        B.rstrip(A[-1]) 
 +      payload["PV_state"           C.rstrip(A[-1]) 
 +       
 +      payload["Meter_status"       str(values2['state_meter']['class']) 
 +      payload["Inverter_state"     str(values2['state_inverter']['message']) 
 +      payload["State_timeline"     str(values2['state_timeline']['detail']) 
 +      payload["Error_history"      str(values1['error_history'][0])
  
-  * Lancez Tight Viewer+      if debug: 
 +        for x in payload: 
 +          print(x, " : ", payload[x])
  
-{{:man:campus:raspberry:tightvnc_util_1.png?400|}}+  except Exception as err: 
 +      print("Imeon is eating glue again... (" + str(err)+")"
 +      #time.sleep(10) 
 +      #continue 
 +      raise SystemExit 
 +    #break
  
-  * Inscrivez dans "Remote Host" (<color red>1</color>): 10.199.10.12:5900 Puis cliquez sur "Connect" +def run(): 
-  * MDP: le mot de passe adminlocal des PC+    global payload
  
-{{:man:campus:raspberry:tightvnc_util_2.png?400|}}+    poll_imeon_data()
  
-  * Vous pouvez cliquer sur la loupe auto (<color red>1</color>et agrandir la fenêtre +if __name__ == '__main__': 
-  * La mise en plein écran est possible (<color red>2</color>) <color red>ATTENTION</color> pour sortir faire <color red>Ctrl+Alt+Maj+F</color> (ne pas oublier)+    run() 
 +</file>
  
 +<file html index.html>
 +<html>
 + <head>
 + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 + <meta http-equiv="Content-Type" content="Cache-Control: no-cache, no-store, must-revalidate">
 + </head>
 + <body>
 + <section style="display: table; width: 100%; height: 100%;">
 + <div style="display: table-cell; width: 33%; border-right: 1px solid #333; padding: 5px;">
 + <div style="display: table; width: 100%; height: 100%;">
 + <div style="display: table-row; text-align: center;">Instantané</div>
 + <div style="display: table-row;">
 + <div style="display: table-cell; height: 50%; vertical-align: middle;"><img style="width: 48px; vertical-align: middle;" src="solar-panel.png" />150W</div>
 + </div>
 + <div style="display: table-row;">
 + <div style="display: table-cell; height: 50%; vertical-align: middle;"><img style="width: 48px; vertical-align: middle;" src="grid.png" />700W</div>
 + </div>
 + </div>
 + </div>
 + <div style="display: table-cell; width: 33%; border-right: 1px solid #333; padding: 5px; text-align: center;">Production</div>
 + <div style="display: table-cell; width: 33%; padding: 5px; text-align: center;">Consomation</div>
 + </body>
 +</html>
  
 +
 +
 +</file>
man/campus/raspberry/start.1671546629.txt.gz · Dernière modification : 2022/12/20 14:30 de teknophil