Serial connection to a Raspberry Pi: more useful info

From my previous post I noticed that I couldn’t re-connect to the Pi using screen after I’d disconnected using Ctrl-A Ctrl-D. Reading additional suggestions here, Ctrl-D is just a disconnect, it doesn’t end the process that’s attached.

Instead, use Ctrl-A Ctrl-\ and it will ask if you want to terminate processes using screen.

If you do detach, from here you can use this command to list processes attached to the serial port:

fuser /dev/tty.usbserial-11240

This will show a pid that you can kill, and then you can reattach again.

Raspberry Pi “Temporary failure in name resolution” errors every couple of days

I have a Raspberry Pi running PiAware headless (no monitor/keyboard/mouse) that I moved from wired ethernet to wifi, and every few days it becomes unreachable over wifi, but the activity lights appear to show it’s still up.

Looking through the syslog entries, around the time it appears to drop off the network there is this error that starts repeating:

Aug 31 00:00:09 piaware ntpd[14162]: error resolving pool 3.debian.pool.ntp.org: Temporary failure in name resolution (-3)

This post appears to see the same thing, and there’s a suggestion to turn off the power save function on the wifi:

sudo iwconfig wlan0 power off

I’ve given this a go and will monitor over the next few days.

RetroPie / EmulationStation – Rotating output to the Raspberry Pi 7″ LCD 90 degrees for portrait orientation

If you are running RetroPie on a Raspberry Pi 7″ LCD, running some games e.g. arcade games using MAME, in the usual landscape orientation means the output of the game is only displayed in the center of the screen.

There are a number of options for rotating output to the screen, depending on what you need to do and/or your preferences:

Rotate the video output

You can do this by editing /boot/config.txt and adding a line like:

display_rotate=1

or

lcd_rotate=1

(depending on whether you are rotating HDMI output or output to the 7″ LCD). 1=90 degrees rotation, 2=180, 3=270

Rotate all Retroarch output

Edit /opt/retropie/configs/arcade/retroarch.cfg and add:

video_allow_rotate = "true"
video_rotation = "3"

Use a rotation value of 1, 2, or 3 etc same as rotating the video output. From here.

Rotate individual MAME rom output

In your ROMs folder, create a rom-name.zip.cfg file and add the same 2 lines as above. Same approach as the overlay configs created here, which also has config for adding a rotated background graphics overlay too.

Rotate EmulationStation display

To rotate the EmulationStation gui you can pass the –screenrotate option in the autostart config for EmulationStation, which you can either set in the cfg file directly or via the RetroPie-Setup.sh – described here.

For the 7″ LCD these options worked for me:

--screenrotate 3 --screenszie 480 800 #auto

    Searching for available install packages on Debian / Raspbian / Ubuntu (Installing Java on a Raspberry Pi Zero)

    On Linux distros that use apt package manager, you can search for packages by name using:

    sudo apt search package-name

    I’m looking to install a supported version of OpenJDK on a Raspberry Pi Zero, which has significantly less resources than a regular Pi and I believe is also an older ARM cpu version than current Pi 4 and 5.

    Using ‘apt search’ for openjdk shows a number of 7, 8, 11 and 17 candidates, and also versions compiled specifically for the Pi Zero:

    openjdk-17-jre-zero/oldstable-security 17.0.11+9-1~deb11u1 arm64
    Alternative JVM for OpenJDK, using Zero