Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tools:raspbian [2023/07/22 13:48]
darron [Upgrade]
tools:raspbian [2023/10/05 13:16] (current)
darron [WiFi problems]
Line 148: Line 148:
 <code> <code>
 apt-get update apt-get update
-apt-get dist-upgrade+apt-get full-upgrade
 </code> </code>
  
Line 269: Line 269:
  
  
 +===WiFi problems===
 +
 +==Hotplug==
 +
 +At least on one setup the WiFi fails to start during boot. It seems that the interface
 +has no name as yet or is renamed to something else then renamed back to wlan0 but after
 +wpa_supplicant runs which results in network failure.
 +
 +Error looks like this in syslog:
 +<code>
 +wpa_supplicant[434]: Successfully initialized wpa_supplicant
 +wpa_supplicant[434]: Could not read interface wlan0 flags: No such device
 +wpa_supplicant[434]: nl80211: Driver does not support authentication/association or connect commands
 +wpa_supplicant[434]: nl80211: deinit ifname=wlan0 disabled_11b_rates=0
 +wpa_supplicant[434]: Could not read interface wlan0 flags: No such device
 +wpa_supplicant[434]: rfkill: Cannot get wiphy information
 +wpa_supplicant[434]: Could not read interface wlan0 flags: No such device
 +wpa_supplicant[434]: WEXT: Could not set interface 'wlan0' UP
 +wpa_supplicant[434]: wlan0: Failed to initialize driver interface
 +</code>
 +
 +To solve this configure /etc/network/interfaces using "allow-hotplug wlan0", but
 +if this also fails, replace rc.local with the following:
 +
 +<code>
 +#!/bin/sh
 +#
 +# rc.local
 +#
 +# This script is executed at the end of each multiuser runlevel.
 +# Make sure that the script will "exit 0" on success or any other
 +# value on error.
 +#
 +# In order to enable or disable this script just change the execution
 +# bits.
 +#
 +
 +check() {
 +        /sbin/ifconfig wlan0 1>/dev/null 2>/dev/null
 +}
 +check
 +while test $? -eq 1; do
 +        sleep 1
 +        check
 +done
 +ifup wlan0
 +
 +# Print the IP address
 +_IP=$(hostname -I) || true
 +if [ "$_IP" ]; then
 +  printf "My IP address is %s\n" "$_IP"
 +fi
 +
 +exit 0
 +</code>
 +
 +==Keep alive==
 +
 +Pi4 WiFi can both disconnect with wpa_supplicant still running or crash.
 +
 +In the former case we can reconnect but in the latter a reboot is required.
 +
 +<code>
 +#! /bin/bash
 +
 +check() {
 +        LOSS=`ping -c 3 -i 1 192.168.0.1 | awk 'match($0, /[0-9]+%/) { print substr($0, RSTART, RLENGTH) }'`
 +}
 +while test 1; do
 +        sleep 30
 +        check
 +        if test "$LOSS" = "100%"; then
 +                ifdown wlan0 1>/dev/mull 2>/dev/null
 +                ifup   wlan0 1>/dev/null 2>/dev/null
 +                sleep 5
 +                check
 +                if test "$LOSS" = "100%"; then
 +                        reboot
 +                fi
 +        fi
 +done
 +</code>
 +
 +Change the IP address to that of your access point or modem.
 === Upgrade === === Upgrade ===
  
Line 327: Line 411:
 wget https://archive.raspberrypi.org/debian/pool/main/r/raspberrypi-firmware/raspberrypi-bootloader_1.20230405-1_armhf.deb wget https://archive.raspberrypi.org/debian/pool/main/r/raspberrypi-firmware/raspberrypi-bootloader_1.20230405-1_armhf.deb
 wget https://archive.raspberrypi.org/debian/pool/main/r/raspberrypi-firmware/raspberrypi-kernel_1.20230405-1_armhf.deb wget https://archive.raspberrypi.org/debian/pool/main/r/raspberrypi-firmware/raspberrypi-kernel_1.20230405-1_armhf.deb
 +wget https://archive.raspberrypi.org/debian/pool/main/r/raspberrypi-firmware/raspberrypi-kernel-headers_1.20230405-1_armhf.deb
 dpkg -i ./raspberrypi-bootloader_1.20230405-1_armhf.deb dpkg -i ./raspberrypi-bootloader_1.20230405-1_armhf.deb
 dpkg -i ./raspberrypi-kernel_1.20230405-1_armhf.deb dpkg -i ./raspberrypi-kernel_1.20230405-1_armhf.deb
 +dpkg -i ./raspberrypi-kernel-headers_1.20230405-1_armhf.deb
 </code> </code>
  
Line 335: Line 421:
  
  
-===Problems===+===MicroSD problems===
  
 MicroSD cards can be unreliable and often times installed binaries become corrupt. MicroSD cards can be unreliable and often times installed binaries become corrupt.
Line 372: Line 458:
 Continue from the start until debums reports no errors in binary files. If there are lots of problem it may be sensible to reinstall the OS or use a different sdcard completely. Continue from the start until debums reports no errors in binary files. If there are lots of problem it may be sensible to reinstall the OS or use a different sdcard completely.
  
 +A script
 +<code>
 +#! /bin/bash
 +PACKAGES=`debsums -s 2>&1 | awk '/^debsums:\ changed\ file/ { print $6 }' | sort -u`
 +for PACKAGE in $PACKAGES; do
 +        sudo apt-get install --reinstall "$PACKAGE"
 +done
 +exit 0
 +</code>
  
 ===Kernel=== ===Kernel===
Line 649: Line 744:
  
 ===Miscellaneous=== ===Miscellaneous===
 +
 +Install shell
 +
 +<code>
 +apt install tcsh
 +</code>
  
 Install locales Install locales