Benutzer-Werkzeuge

Webseiten-Werkzeuge


wiki:raspberrypi

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.

Link zu der Vergleichsansicht

Beide Seiten, vorherige ÜberarbeitungVorherige Überarbeitung
Nächste Überarbeitung
Vorherige Überarbeitung
wiki:raspberrypi [2024/12/25 18:27] – [Das Image kommt auf die SD-Karte oder USB-Speicher] pulsarwiki:raspberrypi [2026/01/03 18:03] (aktuell) – [WLAN SSH on first Boot] pulsar
Zeile 30: Zeile 30:
  
   vcgencmd measure_volts   vcgencmd measure_volts
 +  
 +Wer einen Raspi 5 besitzt, kann die Speisespannung ganz einfach selbst messen, und zwar ohne Messgerät. Denn sie lässt sich mit dem Konsolenbefehl ''vcgencmd pmic_read_adc EXT5V_V'' aus dem Spannungswandlerchip auslesen, dem sogenannten Power Management IC (PMIC).
 +
 +  vcgencmd pmic_read_adc EXT5V_V
  
 Bzw. Bzw.
Zeile 208: Zeile 212:
 ==== WLAN SSH on first Boot ==== ==== WLAN SSH on first Boot ====
  
-Möchte man WLAN beim ersten starten der neuen SD-Karte haben dann muss die Datei ''wpa_supplicant.conf''+=== Nutzer anlegen === 
 + 
 +Um sich per SSH zu verbinden wird ein Nutzer benötigt, die Einstellungen dazu können ab Debian 13 (trixie) 
 +in der Datei ''user-data'' auf der Boot-Partition vorgenommen werden. 
 + 
 +Bisher habe ich in der Datei ''user-data'' die folgenden Zeilen getestet: 
 + 
 +<code> 
 +  hostname: iglu 
 +  ssh_pwauth: ture 
 +  users: 
 +- default 
 +- name: pi 
 +  gecos: Pi-Nutzer 
 +  primary_group: users 
 +  groups: users 
 +  ssh_import_id: foobar 
 +  lock_passwd: false 
 +  passwd: $6$w2zvs/KyKRRl1ZgLfK324dB3H2Ywld8URx1wFH7kZusyVcbd45oYw70AhOay8OIEc1/ 
 +</code> 
 + 
 +Alternativ nur für die Benutzer Erstellung. 
 +Eine Datei erstellen mit dem Namen ''userconf'' mit dem Inhalt: <username>:<password> 
 + 
 + 
 +== PW erstellen == 
 + 
 +Für passwd/password wird hier das verschlüsselt Passwort eingetragen, dieses holt man sich mit dem Komando ''openssl passwd -6'' 
 + 
 + 
 + 
 +(alt) Möchte man WLAN beim ersten starten der neuen SD-Karte haben dann muss die Datei ''wpa_supplicant.conf''
 direkt in die Boot-Partition abgelegt werden. direkt in die Boot-Partition abgelegt werden.
  
Zeile 230: Zeile 265:
 </code> </code>
  
 +
 +=== SSH aktiviren ===
  
 Möchte man SSH beim ersten starten der neuen SD-Karte haben, dann muss die Datei ''ssh'' Möchte man SSH beim ersten starten der neuen SD-Karte haben, dann muss die Datei ''ssh''
-direkt in die Boot-Partition abgelegt werden. Die Datei kann einfach leer sein, das war es auch schon.+direkt in die Boot-Partition abgelegt werden. Die Datei kann einfach leer sein. 
 + 
 + 
 +=== weiteres zu firstboot === 
 + 
 +Interessant könnte für die Konfiguration von firstboot noch dieses Verzeichnis auf der WurzelPartition sein. 
 + 
 +<code> 
 +root@raspberrypi:~# ls -la /usr/lib/raspberrypi-sys-mods/ 
 +total 44 
 +drwxr-xr-x  2 root root 4096 Mar 15 15:01 . 
 +drwxr-xr-x 63 root root 4096 Mar 15 15:02 .. 
 +-rwxr-xr-x  1 root root 3227 Nov  6 15:03 firstboot 
 +-rwxr-xr-x  1 root root  445 Dec 18 10:51 get_fw_loc 
 +-rwxr-xr-x  1 root root  419 Jan  6  2022 i2cprobe 
 +-rwxr-xr-x  1 root root 5486 Nov  7 09:30 imager_custom 
 +-rwxr-xr-x  1 root root 7319 Jul 25  2023 init_config 
 +-rwxr-xr-x  1 root root  117 Aug 31  2023 regenerate_ssh_host_keys 
 +-rwxr-xr-x  1 root root  339 Jul 25  2023 sshswitch 
 +</code> 
 ===== Firmware ===== ===== Firmware =====
  
Zeile 532: Zeile 589:
  
  
 +=== uhubctl ===
 +
 +Mit dem in C geschriebenen Programm uhubctl kann man einzelen Ports ein und ausschalten.
 +
 +<code>
 +pi@pintp:~ $ sudo /usr/sbin/uhubctl -l 1-1 -p 2-5 -a off
 +Current status for hub 1-1 [0424:9514, USB 2.00, 5 ports, ppps]
 +  Port 2: 0000 off
 +  Port 3: 0000 off
 +  Port 4: 0000 off
 +  Port 5: 0000 off
 +Sent power off request
 +New status for hub 1-1 [0424:9514, USB 2.00, 5 ports, ppps]
 +  Port 2: 0000 off
 +  Port 3: 0000 off
 +  Port 4: 0000 off
 +  Port 5: 0000 off
 +pi@pintp:~ $ sudo /usr/sbin/uhubctl --help
 +uhubctl: utility to control USB port power for smart hubs.
 +Usage: uhubctl [options]
 +Without options, show status for all smart hubs.
 +
 +Options [defaults in brackets]:
 +--action,   -a - action to off/on/cycle (0/1/2) for affected ports.
 +--ports,    -p - ports to operate on    [all hub ports].
 +--location, -l - limit hub by location  [all smart hubs].
 +--level     -L - limit hub by location level (e.g. a-b.c is level 3).
 +--vendor,   -n - limit hub by vendor id [any] (partial ok).
 +--search,   -s - limit hub by attached device description.
 +--delay,    -d - delay for cycle action [2 sec].
 +--repeat,   -r - repeat power off count [1] (some devices need it to turn off).
 +--exact,    -e - exact location (no USB3 duality handling).
 +--force,    -f - force operation even on unsupported hubs.
 +--reset,    -R - reset hub after each power-on action, causing all devices to reassociate.
 +--wait,     -w - wait before repeat power off [20 ms].
 +--version,  -v - print program version.
 +--help,     -h - print this text.
 +
 +Send bugs and requests to: https://github.com/mvp/uhubctl
 +version: 2.3.0-1
 +pi@pintp:~ $ sudo /usr/sbin/uhubctl -l 1-1
 +Current status for hub 1-1 [0424:9514, USB 2.00, 5 ports, ppps]
 +  Port 1: 0503 power highspeed enable connect [0424:ec00]
 +  Port 2: 0000 off
 +  Port 3: 0000 off
 +  Port 4: 0000 off
 +  Port 5: 0000 off
 +pi@pintp:~ $ sudo /usr/sbin/uhubctl -l 1
 +Current status for hub 1 [1d6b:0002 Linux 6.1.21-v7+ dwc_otg_hcd DWC OTG Controller 3f980000.usb, USB 2.00, 1 ports, ppps]
 +  Port 1: 0503 power highspeed enable connect [0424:9514, USB 2.00, 5 ports, ppps]
 +  
 +</code>
  
 ==== LAN Abschalten ==== ==== LAN Abschalten ====
Zeile 558: Zeile 667:
 Nach der Installation ist es sinnvoll ''raspi-config'' einmal aufzurufen. Dieses Programm findet sich auch in der grafischen Oberfläche oben links auf die Himbeere klicken, Einstellungen --> Raspberry-Pi-Konfiguration Nach der Installation ist es sinnvoll ''raspi-config'' einmal aufzurufen. Dieses Programm findet sich auch in der grafischen Oberfläche oben links auf die Himbeere klicken, Einstellungen --> Raspberry-Pi-Konfiguration
  
- 
-==== 12 Bookworm ==== 
- 
-Ab dieser Version hat sich die Ersteinrichtung für den Headless Betrieb geändert. Hierfür nutze ich das Lite Image. Auf der SD-Karte müss auf der Boot-Partition einige Dateien angelegt werden diese wären: 
- 
-  - SSH Aktivierung, eine leere Datei mit dem namen ''ssh'' 
-  - Benutzer, eine Datei mit dem Namen ''userconf'' mit dem Inhalt: <username>:<password> Für password wird hier das verschlüsselt Passwort eingetragen, dieses holt man sich mit dem Komando ''openssl passwd -6'' 
-  - WLAN, eine Datei im Pfad ''/etc/NetworkManager/system-connections/WLAN-Name.nmconnection'' anlegen mit den folgenden Inhalt: 
- 
-<code> 
-[connection] 
-id=WLAN-Name 
-uuid=# random UUID in the format 11111111-1111-1111-1111-111111111111 
-type=wifi 
-autoconnect=true 
-interface-name=wlan0 
- 
-[wifi] 
-mode=infrastructure 
-ssid=WLAN-Name 
- 
-[wifi-security] 
-auth-alg=open 
-key-mgmt=wpa-psk 
-psk=WLAN-Passwort 
- 
-[ipv4] 
-method=auto 
- 
-[ipv6] 
-addr-gen-mode=default 
-method=auto 
-</code> 
- 
-  sudo chmod -R 600 <path-to-rootfs>/etc/NetworkManager/system-connections/SSID.nmconnection 
-  sudo chown -R root:root <path-to-rootfs>/etc/NetworkManager/system-connections/SSID.nmconnection 
- 
-Hier soll es eine einzige Datei geben, mit der man alle Punkte ab arbeiten kann: 
- 
-With Raspberry Pi OS bookworm you can configure WiFi via a ''custom.toml'' **that you place in the bootfs partition (first boot only).** 
- 
-Note that this feature is experimental and will be replaced by cloud-init in the future. 
- 
-An example gist and blog explains some of the options: 
- 
-I am copying the example from the aforementioned gist (not affiliated): 
- 
-<code> 
-# Required: 
-config_version = 1 
- 
-[system] 
-hostname = "raspberrypi" 
- 
-[user] 
-# If present, the default "rpi" user gets renamed to this "name" 
-name = "rpi" 
-# The password can be encrypted or plain. To encrypt, we can use "openssl passwd -5 raspberry" 
-password = "$5$pN7oRnie.WDOHoJY$aWEYmKUytN/S/bxMza5ksBiurbSJmcvcysBKHSmYa45" 
-password_encrypted = true 
- 
-[ssh] 
-# ssh_import_id = "gh:user" # import public keys from github 
-enabled = true 
-password_authentication = false 
-# We can also seed the ssh public keys configured for the default user: 
-# authorized_keys = [ "ssh-rsa ... user@host", ... ] 
- 
-[wlan] 
-ssid = "mywifi" 
-password = "$5$pN7oRnie.WDOHoJY$aWEYmKUytN/S/bxMza5ksBiurbSJmcvcysBKHSmYa45" 
-password_encrypted = true 
-hidden = false 
-# The country is written to /etc/default/crda 
-# Reference: https://wireless.wiki.kernel.org/en/developers/Regulatory 
-country = "IE" 
- 
-[locale] 
-keymap = "gb" 
-timezone = "Europe/London" 
-</code> 
- 
-You could dig more into the firstboot or init_config scripts (the latter is what loads the config). 
- 
- 
- 
- 
-Entscheident ist dieses Verzeichnis auf der Wurzel-Partition wo die Einstellungen konfiguriert werden. 
- 
-<code> 
-root@raspberrypi:~# ls -la /usr/lib/raspberrypi-sys-mods/ 
-total 44 
-drwxr-xr-x  2 root root 4096 Mar 15 15:01 . 
-drwxr-xr-x 63 root root 4096 Mar 15 15:02 .. 
--rwxr-xr-x  1 root root 3227 Nov  6 15:03 firstboot 
--rwxr-xr-x  1 root root  445 Dec 18 10:51 get_fw_loc 
--rwxr-xr-x  1 root root  419 Jan  6  2022 i2cprobe 
--rwxr-xr-x  1 root root 5486 Nov  7 09:30 imager_custom 
--rwxr-xr-x  1 root root 7319 Jul 25  2023 init_config 
--rwxr-xr-x  1 root root  117 Aug 31  2023 regenerate_ssh_host_keys 
--rwxr-xr-x  1 root root  339 Jul 25  2023 sshswitch 
-</code> 
  
  
wiki/raspberrypi.1735147659.txt.gz · Zuletzt geändert: 2024/12/25 18:27 von pulsar