Benutzer-Werkzeuge

Webseiten-Werkzeuge


raspberry

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
Letzte Überarbeitung Beide Seiten der Revision
raspberry [2018/07/20 16:01]
karl [Headless with UART]
raspberry [2021/03/12 22:46]
karl [Realtime Kernel]
Zeile 12: Zeile 12:
   sudo dd bs=10M if=RuneAudio_rpi2_rp3_0.4-beta_20160321_2GB.img | pv -s 2100M | sudo dd of=/dev/sdc   sudo dd bs=10M if=RuneAudio_rpi2_rp3_0.4-beta_20160321_2GB.img | pv -s 2100M | sudo dd of=/dev/sdc
 wobei pv die Imagegröße mitgegeben werden kann, und man somit eine Zeitschätzung erhält.  wobei pv die Imagegröße mitgegeben werden kann, und man somit eine Zeitschätzung erhält. 
 +
 +==== Auflisten der Installierten Pakete ====
 +Möchte man wissen, was alles installiert wurde nach der frischen Installation von Raspbian, kann man sich das ausgeben lassen: 
 +  cat /var/log/apt/history.log | egrep '^(Start-Date:|Commandline:)' | grep -v aptdaemon | egrep '^Commandline:' | egrep 'install'
 ===== Headless with UART ===== ===== Headless with UART =====
 add this line to **config.txt** add this line to **config.txt**
Zeile 27: Zeile 31:
 {{ ::raspberry-uart.png?direct&400 |}} {{ ::raspberry-uart.png?direct&400 |}}
 ===== Headless with WiFi ===== ===== Headless with WiFi =====
-https://www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md+Firstcreate a file in ''boot'' with this content: 
 + 
 +<code, wpa_supplicant.conf> 
 +country=AT 
 +update_config=1 
 +ctrl_interface=/var/run/wpa_supplicant 
 + 
 +network={ 
 +    ssid="Singervilla-iNet-2.4G" 
 +    psk="myStrongPassword" 
 +
 +</code> 
 + 
 +Second: create a file ''ssh'' in ''boot''.  
 + 
 +Then insert the SD card into the Raspi and start to scan for the Raspberry's IP-Address with 
 +  nmap -T5 -sP 10.0.1.0-255 
 +or with 
 +  arp -a 
 +Then connect to it with e.g. 
 +  ssh pi@10.0.1.169 
 + 
 +  
  
 ===== Headless with Ethernet ===== ===== Headless with Ethernet =====
Zeile 44: Zeile 70:
 https://raspberrypi.stackexchange.com/questions/40689/cannot-connect-to-raspbian-jessie-lite-but-to-raspbian-jessie#58455 https://raspberrypi.stackexchange.com/questions/40689/cannot-connect-to-raspbian-jessie-lite-but-to-raspbian-jessie#58455
  
 +EDIT: scheint seit Beginn 2018 nicht mehr so zu funktionieren. Alternativ kann man sich per UART verbinden und mit ''raspi-config'' ssh einschalten. 
 +
 +EDIT2: geht doch. mit kopieren der datei ''config.txt'' und umbenennen auf ''ssh'' ((vielleicht gabs oben ein Problem mit den Dateiberechtigungen...))
 ===== Add a Service Module ===== ===== Add a Service Module =====
 To execute a programm on each boot automatically, here is a good tutorial:   To execute a programm on each boot automatically, here is a good tutorial:  
Zeile 58: Zeile 87:
 [Service] [Service]
 Type=simple Type=simple
 +WorkingDirectory=/home/karl/hello-service
 ExecStart=/usr/bin/python /home/pi/hello_world.py ExecStart=/usr/bin/python /home/pi/hello_world.py
 Restart=on-abort Restart=on-abort
Zeile 72: Zeile 102:
   sudo systemctl start hello.service   sudo systemctl start hello.service
  
 +==== Inspect the Logs ====
 +  journalctl -u hello
 +
 +===== Image Erstellen =====
 +Ein Image wird ganz einfach per dd erstellt. Vorher sollte es aber z.B. mit **gparted** auf die notwendige Größe verkleinert werden. Dann Image erstellen und mit ''truncate'' wieder verkleinern:
 +
 +  truncate --size=2782920704 image.img 
 +
 +Dabei wird die Größe mittels 
 +  fdisk -l image.img
 +berechnet: 512 Bytes/Sector * (5435391+1) Sectors = 2782920704 Bytes
 +
 +==== Verkleinern ====
 +Wurde das Image bereits erstellt und hat z.B. 16GB, dann kann es recht einfach so verkleinert werden: 
 +<code>
 +sudo modprobe loop
 +sudo losetup -f
 +sudo losetup /dev/loop0 myimage.img
 +sudo partprobe /dev/loop0
 +sudo gparted /dev/loop0
 +sudo losetup -d /dev/loop0
 +</code>
 +Quelle: https://softwarebakery.com/shrinking-images-on-linux
 ===== PIGPIO ===== ===== PIGPIO =====
 A very great library for hardware access of the IO-pins: \\ A very great library for hardware access of the IO-pins: \\
Zeile 111: Zeile 164:
  rm myprogram  rm myprogram
 </code> </code>
 +
 +===== Realtime Kernel =====
 +  * https://www.get-edi.io/Real-Time-Linux-on-the-Raspberry-Pi/
 +  * https://github.com/lueschem/edi-pi#creating-a-cross-development-lxd-container
 +  * https://www.get-edi.io/
 +  * https://www.raspberrypi.org/documentation/linux/kernel/building.md
 +  * https://medium.com/@patdhlk/realtime-linux-e97628b51d5d
 +  * https://lemariva.com/blog/2019/09/raspberry-pi-4b-preempt-rt-kernel-419y-performance-test
 +
 +Auf dem Raspberry Pi, mit Raspberry OS vom 11. Jan. 2021 ((https://www.raspberrypi.org/documentation/linux/kernel/building.md)):
 +  sudo apt update
 +  sudo apt upgrade
 +  sudo apt install git bc bison flex libssl-dev make
 +  git clone --depth=1 --branch rpi-4.19.y-rt https://github.com/raspberrypi/linux
 +  
 +Configure Kernel ((https://www.raspberrypi.org/documentation/linux/kernel/configuring.md)):
 +  sudo apt install libncurses5-dev
 +  cd linux
 +  make menuconfig
 +  
 +Hierbei wurde jedoch weiters nichts konfiguriert. 
 +
 +  make bcm2711_defconfig
 +  make -j4 zImage 
 +  make -j4 modules 
 +  make -j4 dtbs 
 +
 +Dauert etwa 1h15min. 
 +
 +  sudo make -j4 modules_install 
 +  sudo make -j4 dtbs_install
 +  sudo cp arch/arm/boot/dts/*.dtb /boot/
 +  sudo cp arch/arm/boot/dts/overlays/*.dtb* /boot/overlays/
 +  sudo cp arch/arm/boot/dts/overlays/README /boot/overlays/
 +  sudo cp arch/arm/boot/zImage /boot/$KERNEL-rt.img
 +
 +
 +
 +
  
 {{tag>english software raspberry c++ linux technical}} {{tag>english software raspberry c++ linux technical}}
  
raspberry.txt · Zuletzt geändert: 2022/03/15 09:04 von karl