Enable UART Serial Communication

Edit /boot/config.txt and append:

enable_uart=1

to the end of the file and reboot.

Disable Wifi Power Management

When receiving large amounts of output over SSH the Raspberry Pi might render the console inoperable and the connection will time out in a few seconds.

The following command adds some module options to the wifi kernel module to disable power management which is apparently responsible for the former issue.

echo "options 8192cu rtw_power_mgnt=0 rtw_enusbss=0" | sudo tee --append /etc/modprobe.d/8192cu.conf

Enable SSH on (First) Boot

Create a blank file named ssh with no extension at the root of the boot partition of the SD card in order to make Raspbian start the SSH daemon on boot. One use for this trick is combining the Raspberry Pi with an ethernet hat such that the Raspberry can be setup without needing to attach a monitor and keyboard.

Check if Hardware Decoders are Enabled

vcgencmd codec_enabled MPG2
vcgencmd codec_enabled WVC1

Note that the Raspberry Pi 4 does not have hardware decoders such that the commands will most likely state disabled.

Change Audio Output

Issuing:

amixer controls

will yield the controls available on the Raspberry Pi:

# amixer controls
numid=3,iface=MIXER,name='PCM Playback Route'
numid=2,iface=MIXER,name='PCM Playback Switch'
numid=1,iface=MIXER,name='PCM Playback Volume'

The Raspberry Pi 2,3 and 4 can commute between sending sound through the $3.5mm$ audio jack:

amixer cset numid=3 1

or the HDMI output:

amixer cset numid=3 2

respectively, or:

amixer cset numid=3

to set the sound selection to autodetect where the jack will be used only if the HDMI cable is not connected.

Fixing Various Network Issues

Any of the following symptoms are to be detected?

  • SSH connections drop,
  • issuing commands with large output over SSH makes the SSH session hang,
  • connection issues toward package repositories on Raspbian

They may all boil down to a non-uniform MTU setting across the network.

Logging-in via SSH over USB

The Raspberry Pi when connected to a PC can configure itself as an USB gadget and start a network over USB. A RNDIS network adapter is needed in most cases and can be downloaded from here:

In order to log into the Raspberry Pi over SSH via the USB port, edit config.txt and add:

dtoverlay=dwc2

Next, edit cmdline.txt and add the following to the kernel parameters between rootwait and quiet:

modules-load=dwc2,g_ether

Finally, add a blank file named ssh with no contents to the root of the boot partition.

The Raspberry can now be connected to a PC via its USB port (not the USB port marked PWR). The PC that the Raspberry Pi connects to will act as a router and should forward packets to the Raspberry Pi.

Assuming that the Raspberry has been freshly set up, to connect via SSH, issue: ssh pi@raspberry.local and enter raspberry at the password prompt.


fuss/raspberry_pi.txt · Last modified: 2020/02/24 05:14 by office

Access website using Tor Access website using i2p


For the copyright, license, warranty and privacy terms for the usage of this website please see the license, privacy and plagiarism pages.