Saturday, June 27, 2020

Ubuntu 20.04 for the Raspberry Pi 4!

So it's finally been released -- a stable version of a 64-bit Ubuntu for the Raspberry Pi. This is what many have been waiting for, but the current version is not for the absolute beginner. To get to the GUI Desktop that gives the Raspberry Pi a much needed "Oomph!", we have to do a little command line work, as I think as of this writing, it's still beta. What I have here is a list of things you need to do in order to get to the point where everything will be working as you expect it to if this were Raspian.

Ok, so choose an SD card to put Ubuntu on. I recommand a nice large one, like a 128GB or 256GB -- because if you end up liking it, you'lre going to want to have plenty of room for more apps! Use your Mac or PC, and insert the SD Card into an available USB port. I recommend the new Raspberry Pi installer. It's got the edge on Balena Etcher -- Raspberry Pi installer actually locates the latest supported images and downloads them so you don't have to.

When selecting the OS in the Raspberry Pi installer, first choose Ubuntu.

Then select Ubuntu 20.04 LTS 64-bit.

After burning the SD card, put it into your Raspberry PI and boot. It will take a while, but eventually you will be asked to log in.

username=ubuntu
password=ubuntu

It should ask you to change the password after accepting the login. BE CAREFUL AND CHOOSE A PASSWORD THAT YOU CAN REMEMBER!

When you are done changing the password, it will leave you at a command prompt. Now at this point, you can just start using it as a command line OS, JUST LIKE THE GOOD OLD DAYS! Before graphical desktops, Unix, the predecessor of Linux, was just a command line. DOS, CP/M, Unix, and other pre-1980's operating systems all used their own unique command line language to navigate. But we know you want the GUI, so here is what to do to get everything up and running.

This is what you do after booting your Raspberry Pi 4 with the Ubuntu 20.04 image for the first time. First, we have to update the OS you just installed, so type the following commands:

sudo apt update
sudo apt upgrade
sudo reboot

Installing an Ubuntu Desktop

Next, we have to install the Ubuntu Desktop, so you can use an OS that is more familiar to you. There are many choices, which offer various improvements and compromises. The Default is the Ubuntu Fossa Desktop. if you're in the mood for other desktops, here are a few more. Currently, I'm testing out Ubuntu MATE Desktop, which seems to have better video playback speed.

GNOME is the default desktop for Ubuntu.

Below are the different desktops, and their terminal command lines to install them. You can actually try them all out, or read up on them HERE.

During the install of these desktop environments, you will be asked which Display Manager you want to use, and will be prompted to choose either GDM, GD3, GDM3 (All Variations on the "Gnome Desktop" manager) or SDDM. This is still something I'm experimenting with. I selected GD, because it was supposed to be lighter, and had less bells and whistles, which I figured would create extra work. SDDM is SUPPOSED to have better support for video, but I haven't tried it yet. When I have a chance to compare the two, I'll re-write this section to give my recommendation.

Just remember, it doesn't really matter which one you choose if you're experimenting like me. Just try one, then the other later on, and decide which one is your favorite.

DesktopTerminal command to install it
Ubuntu Fossa Desktopsudo apt-get install ubuntu-desktop
Ubuntu MATE Desktopsudo apt-get install ubuntu-mate-desktop
Gnomesudo apt-get install gnome-session gdm3
KDE Plasma Desktopsudo apt-get install kubuntu-desktop
Budgie Desktopsudo apt-get install ubuntu-budgie-desktop
Xfce/Xubuntu Desktopsudo apt-get install xubuntu-desktop
Cinnamon Desktopsudo apt-get install cinnamon-desktop-environmentp
LXQt Desktopsudo apt-get install lxqt sddm
Gnome Flashback Desktopsudo apt-get install gnome-session-flashback

Don't forget that after installing each of these, you should type in:
sudo reboot

Setting up Remote Desktop access

After rebooting, we should add the Remote Desktop software, to allow you to connect to it with your Windows or Macintosh PC. You can use your Raspian/other Linux computer to access it remotely.

sudo apt install xrdp
sudo systemctl status xrdp
sudo systemctl restart xrdp
sudo reboot

Net-Tools

Net-tools gives you a few more useful things to help you figure out networking issues or monitor your network. Just install them. They are useful once you realize you have these features in Windows.

sudo apt install net-tools

Overclocking the Raspberry Pi 4

Next, we need to edit the usercfg.txt file. Ubuntu doesn't let you edit the config files while you're running, unlike Raspian. So we have to use another PC/Mac to edit it. shut down and remove the SD card. Put the card into your PC, locate and double-click on usercfg.txt

You should only do this if you have a CPU fan installed on your Raspberry Pi 4. If you want to be adventurous, you can try the faster (hotter) speeds:

SafesthotVery Hot (beware!)
over_voltage=4 over_voltage=6 over_voltage=6
arm_freq=1750 arm_freq=2000 arm_freq=2147
gpu_freq=620 gpu_freq=750 gpu_freq=750

Create a section of the usercfg.txt file labeled [Pi4]. Add your choice of the lines above to the [Pi4] section. It should look like this:

[pi4]
over_voltage=4
arm_freq=1750
gpu_freq=620

This will overclock the Raspberry Pi 4 at the safest speed. Use the others as long as you have a good fan attached.

Next, there is a video issue with Ubuntu, that limits you to a lower resolution than the 1920x1080 that everyone wants. It also has Overscan, which puts an annoying border around the edge of the screen. To fix that, we need to add a couple more lines to the usercfg.txt file. To enable 1920x1080 resolution, and disable the overscan, Add the following to your usercfg.txt file:

dtoverlay=vc4-fkms-v3d
disable_overscan=1

Save the usercfg.txt file. Be sure to right-click on the drive containing the sd card, and select EJECT before removing it. Insert the SD card into your Raspberry Pi and reboot!

Audio Issues

The Ubuntu setup likes to default to the HDMI Audio out, but there are those of us prefer using headphones, or who have speakers that we'd like to pump the sound through. Unfortunately, there is a problem with Ubuntu's audio manager -- you can select the headphones/analog output all you want, but it just keeps going through the HDMI. To fix this, simply open terminal, and type the following:

amixer -q cset numid=3 1

Now put on your headphones and play some music.
if you need to know, the settings (last number on the command from above) are:
(1=analog, 2=HDMI0, 3=HDMI1).

The Argon One Raspberry Pi Case

For users of the Argon One Raspberry Pi 4 Case with fan, you will need to download the fan control software. Currently, Argon is working on an Ubuntu script for the fan software, so check their website before doing the following:

Open terminal, and type the following:

cd /tmp/
wget https://raw.githubusercontent.com/meuter/argon-one-case-ubuntu-20.04/master/argon1.sh
chmod a+x argon1.sh
sudo ./argon1.sh

The script will generate a bunch of scripts and config files. The main commands are:

argonone-config to config the fan behavior
argonone-uninstall to remove all the scripts and services (conf file remains though)
argonone-tempmon which monitors the temerature using the linux sysfs.

getting Bluetooth to work

The BLuetooth drivers for the Raspberry Pi 4 do not get installed by Ubuntu (again, it's a beta version, so it'll probably be fixed along with the screen res and other issues). Fortunately, thanks to Damir Biscan from the Raspberry Pi 4 Facebook forum, I got the fix for that. IN terminal, just enter the following, and it will take care of it in one shot -- just reboot after, for it to take effect.

sudo apt install bluetooth pi-bluetooth bluez blueman

After rebooting, your control panel and menu bar items for bluetooth will work.

Kodi users mouse fix

SO if you like to use Kodi, there is an issue that plagues all Raspberry Pi users, regardless of operating system choices. When you open Kodi, the mouse is slow and choppy, and so isn't the video. We fix that in a deceptively simple way.

In terminal, type:
sudo nano /boot/firmware/cmdline.txt

Add the following text at the end of the line in that file (Do not add new lines. it all has to be on the one line)

usbhid.mousepoll=8

Save and close, and reboot!

Kodi should operate at a more normal speed.

Now you are ready to start using 64-bit Ubuntu on your 64-bit Raspberry Pi!

ADDENDUM: If you are having trouble getting Chrome to install on your Raspi with Ubuntu, Click HERE for a solution. Chrome for ARM using Linux is available, but it's not as simple as a download to get it working. Chrome is installed with some of the desktop environments, but not others. I discovered this while trying out Ubuntu Mate.


Tuesday, January 21, 2020

Raspberry Pi super-system

One of the ongoing endeavors with the Raspberry Pi 4/4GB model is to try to use it in the same capacity as a standard Desktop and Laptop computer. My needs are pretty basic, but cover a wide spectrum of different applications. Also -- every time I find software for the Raspberry Pi 4, it involves a lot of searching, but I never document where I find it -- so I can't repeat the install on another system. So this entry in my blog serves that purpose -- to document where I find great apps that I want to put on my Pi Workstations, and how to install the more complicated ones. Linux is a new OS for me, and though I've had it for years, I've never had a lot of opportunity to just dive in and become as familiar with it as DOS, Windows, and MacOS. On my PC, I use the web, mostly, for browsing and email. I am into Emulation of legacy computer systems and software. I like to play movies and music. I like to create art, memes, and other things, as well.

Along the way, I realized that other people would want this information as I collect it, because if you're not as familiar with the Raspberry Pi and Linux as I am, you'll have all of the same problems with it as I did, and you'll get frustrated and want to give up. No need to lose hope.

The "Raspberry Pi Super System" is just a nickname for my Raspberry Pi that is as much like my Windows PC as possible, and capable of being used on the road, or in place of my desktop for everything except hi-end gaming. The Raspberry Pi 5 or 6 will have to address the need for gaming. Though it's just a standard Raspberry Pi 4 with 4GB of RAM and a 256GB microSD, the idea of the Super System means that it's going to be as capable as my PC in terms of being able to let me get all the stuff done that I need. Facebook, Youtube, Email, Internet, TV, Movies, Music, Blogging, emulating lots of old computers, retro-programming, burning bootable images, and more, are what I'm going for.

Some people may ask "But what does a Raspberry Pi 4 have to do with retro computing, and the other things in this blog?" a Lot, actually. It is the Raspberry Pi line of single-board computers that is at the heart of many retro projects, mainly because of Retropi (An Emulator that emulates over 7000 games from old video game consoles and arcade machines), SimH, and of course, the Raspberry Pi is at the very heart of the PiDP-8 and PiDP-11 projects that simulate the Digital PDP-8 and PDP-11 minicomputers. One project I'll document later is my own project "PiDEC", which is a Raspberry Pi running SimH that has a 9-pin serial port on it, which I connect to the serial port on an old DEC terminal to give a complete retro-experience. I can just velcro the Raspberry Pi onto the back of an old terminal, and I have a fully self-contained "mini-computer in a terminal". Having the software on your Raspberry Pi to put these projects together will let you have one workstation to do it all on, so that you can use your Windows PC or Mac free of the clutter that having all the software for Raspberry Pi's on it, and having to move back and forth between one and the other.

The following Raspberry Pi apps are what you should add to your Raspberry Pi Build if you're going to use it as a workstation to do normal, everyday things with. Of course, what each user does with their desktop or laptop computer varies from user to user. My list is geared toward users who do a variety of different things revolving around the internet. There are apps for entertainment, using the web, and a few enhanced programs to make things easier to do in general.

*** Balena Etcher ***

Balena Etcher is a popular SD Card imaging program. If you have a Raspberry Pi, you need to have a program to do this, if you don't want to have to switch back and forth to a PC. Currently, Raspberry Pi users need to have a PC or Mac handy to image SD Cards to use in a Raspberry Pi. Etcher for the Raspberry Pi is the same Etcher that you use on the PC and Mac, so if you're already using it, the Raspberry Pi version will require no learning curve.

Installation:

  • In terminal, type: curl -s https://packagecloud.io/install/repositories/swift-arm/etcher/script.deb.sh | sudo bash
  • Then type: sudo apt-get install balena-etcher-electron
Once installed, it should appear in your Raspberry Pi button menu under Accessories.

*** GPartEd ***

Used in conjunction with Balena Etcher (above), GPartEd will allow you to format SD Cards for your Raspberry Pi Projects without having to use a Windows or Mac-based computer. GPartEd is a Partition editor and formatting tool that allows you to correctly format an SD Card in Fat32, which is the preferred file system for Raspian and Linux operating systems in general. Using this will truly free you from needing another computer to set up your Images.

Installation:

  • Go to Start--> preferences --> Add/Remove programs (or Synaptics package manager) and search for "GParted".

*** Cool Retro Term ***

Cool Retro Term is a great program for people who do emulation of old computer systems. It enhances the terminal program of the Raspberry Pi by simulating an old CRT Screen, complete with simulations of various electronic problems inherent with the old CRT technology -- like Blur, burn-in, flickering, loss of vertical sync, etc. I include it here as entertainment, though it really has a limited audience.

Installation:

  • Open up the terminal on your raspberry Pi.
  • copy and paste this into Terminal (or type it in):
    sudo apt install build-essential qmlscene qt5-qmake qt5-default qtdeclarative5-dev qml-module-qtquick-controls qml-module-qtgraphicaleffects qml-module-qtquick-dialogs qml-module-qtquick-localstorage qml-module-qtquick-window2 qml-module-qt-labs-settings qml-module-qt-labs-folderlistmodel
  • After the above completes, type:
    git clone --recursive https://github.com/Swordfish90/cool-retro-term.git
  • Type:
    cd cool-retro-term
  • Type:
    qmake && make

    (This will take a while. You may have to wait 5-10 minutes, but it will keep grinding away. Be patient)

  • When The above is done, you access the program by doing the following:

    open the Raspberry Pi Terminal
    cd \cool-retro-term
    ./cool-retro-term

Options can be changed by right-clicking on the Cool-Retro-Term window.

*** Synaptic package manager ***

Synaptic package manager is a better and more versatile software package manager than the one included with your Raspian Buster Image (Add/Remove Software). It has a better search function and categorizes software to make the correct packages you are looking for easier to find.

Installation:

  • Open Terminal and type:

    sudo apt-get install synaptic

*** VLC Media Player ***

VLC Media Player is an open source video player that plays virtually all video formats, and had great support for PC, Mac, and Linux. It's most likely already installed on your Raspberry Pi's Raspian Buster image. However, if you did a light install, and it's not there, you can alweays add it later.

Installation:

  • Go to Start--> preferences --> Add/Remove programs (or Synaptics package manager) and search for "VLC Media Player".

*** DOSBOX ***
DOSBOX is a multi-platform program that allows you to run old MSDOS programs from the days before Windows. It's generally people who are into Retro-gaming and retro-programming that would get this, but it's still handy to have. It's open source, and has a huge degree of support.

Installation:

  • Go to Start--> preferences --> Add/Remove programs (or Synaptics package manager) and search for "DOSBox".

*** Deluge Bit-torrent client ***

You may not have a need for downloading Bit Torrents as a PC or Mac user. Many of you have heard that bit torrents are associated with software, video, and music piracy, but the bit-torrent format is not illegal, and a lot of legitimate software and media can be downloaded using a Bit Torrent downloader. Essentially, when a file is far too large to download over the internet, Bit Torrent format is how to allow software, music, and video to be downloaded in a format that saves a lot of resources. Bit Torrents are spread out on multiple sites around the web, so that no single source will get charged with all the data fees from it being downloaded by hundreds of people every day.

In the Linux world, bit torrents are used quite a lot for software and disk images. Having Deluge on your system will come in handy when you come across a disk image that you want to burn to an SD card or USB stick.

Installation:

  • Open the terminal and type:
    sudo apt-get install deluged deluge-console python-mako deluge-web

*** Thunderbird (Mail Client) ***

Thunderbird, from Mozilla, is a free, open source email program that is free from a lot of the bloat of Microsoft Outlook. It's got a very old school look to it, and can handle all of your email needs. Though the Raspberry Pi comes with Claws Mail, Thunderbird has a lot more features and optional plug-ins.

Installation:

  • Go to Start--> preferences --> Add/Remove programs (or Synaptics package manager) and search for "Thunderbird".

*** FileZilla (FTP Client) ***

If you use the web for business or pleasure, you occasionally need an FTP Client. FTP is a file transfer protocol that works from any browser, historically, but for more versatility, an FTP Client gives you more options. FileZilla has become the standard Cross-platform, free application that everyone has been using for years. It will come in useful to Linux users who have to download a lot of files over the Internet.

Installation:

  • Go to Start--> preferences --> Add/Remove programs (or Synaptics package manager) and search for "Filezilla".

*** QMMP (WinAmp-like Music Player ***

Everyone uses music players, whether you're playing something to listen to while you work, or just putting music on the computer to play at your next party, a music player is essential. Mac user have Itunes. Windows users have Media Player, but everyone was using Winamp about 10 years ago. Winamp was still kicking Media Player's and iTunes asses until it was forgotten about by Apple and Microsoft, as they made their own media players the default on their systems. Linux and Raspberry Pi's don't have a native media player app like WinAmp, Microsoft media Player, or Apple iTunes -- but QMMP is my choice. It looks just like Winamp, has a visualization library just like WinAmp, and pretty much the same user interface.

Installation:

Go to Start--> preferences --> Add/Remove programs (or synaptics package manager) and search for "QMMP".

*** CUPS (Printer adding/management utility) ***

The one problem that all Linux users face is printing. Getting a printer to print in Linux is something that shouldn't give us as much trouble as it does. Not all printer makes and models support Linux, and finding a driver can be difficult. CUPS is a utility that helps Linux users get their printers working.

Installation:

Go to Start--> preferences --> Add/Remove programs (or synaptics package manager) and search for "CUPS".

*** P7Zip (Zip archiving and extraction tool) ***

P7Zip is a Zip Archiving tool. It can understand many different variants of the *.ZIP format, is open source, and free. It's specially made for the Raspberry Pi, and is made by the same people who gave us "7_Zip".

Installation:

Go to Start--> preferences --> Add/Remove programs (or synaptics package manager) and search for "P7Zip".

*** RealVNC ***

RealVNC allows you to control one computer from another computer safely and securely. It is a cross-platform program, so it works in Windows, Mac OS, and Linux. RealVNC allows you to connect up to multiple computers from one computer, and control them. I like to use it to copy files from my PC to the Mac in my workshop, or copy video files to my TV-box.

Installation:

Go to Start--> preferences --> Add/Remove programs (or synaptics package manager) and search for "VNC Viewer".

"VNC Server" will be needed on the computers that you want to connect to.

*** Kodi 18.5 Leia ***

Kodi is The multimedia streaming app that allows you to install many different plugins to access different content. Primarily, it's used to watch TV and Movies, but there are apps that allow you to stream radio, watch Youtube and your video subscription services like netflix and Amazon Prime. I've used it for years, and have it on most of my computers, as well as on my personal TV box. When the Raspberry Pi 4 came out, a new version had to be compiled for the new chips on the Raspberry Pi. This led to a lot of confusion about where to get it.

Installation Instructions:

Go to Start--> preferences --> Add/Remove programs (or synaptics package manager) and search for "Kodi 18".

*** Open Shot Video Editor ***

OpenShot video editor is a free, award-winning, open source video editing program that rivals a lot of stuff that you have to pay for. You can bring all sorts of video file formats into it, and it will satisfy everyone from the casual editor who is just organizing home movies, to the YouTube video content maker and more. It runs surprisingly fast on a Raspberry Pi 4, too.

Installation:

Go to Start--> preferences --> Add/Remove programs (or synaptics package manager) and search for "OpenShot".

*** Putty ***

PuTTY is a free and open-source terminal emulator, serial console and network file transfer application. It supports several network protocols, including SCP, SSH, Telnet, rlogin, and raw socket connection. It can also connect to a serial port.

Installation:

Go to Start--> preferences --> Add/Remove programs (or synaptics package manager) and search for "Putty".

*** ExFAT and NTFS Support ***

Every Pi Owner who uses Windows PCs needs to be able to read ExFAT and NTFS file systems for compatibility. Let's say you make a USB memory stick and fill it full of files that you want to move from your Windows PC over to a Raspberry Pi, or, more realistically, someone gives you a USB drive with files on it that you want or need. If the USB device is formatted in ExFAT or NTFS, Raspbian will not be able to read it. Having the ability to read and work with those file formats will save you a lot of grief, and allow your Raspberry Pi to function more smoothly and flexibly.

Installation:

Run Terminal and type the following commands:

  • sudo apt-get install exfat-fuse
  • sudo apt-get install exfat-utils
  • sudo apt-get install ntfs-3g

Reboot your Raspberry Pi for good measure, and that's it!

There are instructions included with the above programs that show you how to get more flexibility out of them (mostly under unusual situations where the default settings aren't enough for what you need to do), but for 95% of most Raspberry Pi users, the Raspberry Pi will just automatically see and be able to transfer files to and from these formats, seamlessly.

*** Admin/Management Tools ***

The Raspberry Pi Foundation removed a bunch of Gnome (The default GUI Desktop Environment on many distributions of Linux, including Debian, but sort of compatible with LXDE, the default GUI for Raspbian) control panels from the Raspberry Pi's menus. Because the Raspberry Pi is intended for education, and it's supposed to be really easy to use, they wisely chose to keep powerful admin tools out of the hands of the average user, who might not be fully aware of the damage that can be done to their own stuff with those tools easily available. So the Raspberry Pi Foundation removed the GUI control panels from the menus. To do things like Adding new users, changing the access rights to certain folders and applications, etc, you can still do it all through the Terminal, but it requires more steps and knowledge to do it.

If you're like me, you want to be able to control and manage your Raspberry Pi as easily and conveniently as you can on your Mac or PC. To do that, you only need to re-add the Gnome Desktop admin tools.

Installation:

Open the Terminal and type in the following:

  • apt-get install gnome-system-tools

The new control panels should show up in the menus. Users and Groups will appear under the Preferences section of the main menu.

*** Variety ***

Variety is a desktop background changer that will automatically change the Desktop Background image at intervals that you decide. This program allows you to have a feature that Windows 10 and Mac OSX both have, but which isn't a default part of Raspian. The same software is also available for other flavors of Linux, too. What makes Variety stand above and beyond the natural Windows and Mac OSX background changer, though, is that you can select not just pictures that you've downloaded to your computer, but it will automatically download random images from a bunch of public domain image sites, like Desktopper.co, Bing photo of the day, Unsplash.com, NASA's picture of the day, live wallpaper from Die.net, Peter Levi's Flicker page, and any other place you find and want to add. It really offers you the most control over everything. It's also very easy to use.

Installation:

Open up Add/Remove Programs or use Synaptic Package manager, and search for "Variety". There will be a long list. Just follow alphabetically to find "Variety", and that should be it.

This list of software install instructions will be appended as I discover more software.

ADDENDUM: Virtually all of the software mentioned in this article is available for other versions of Linux, and if you use Ubuntu, the install instructions are virtually identical. In most cases, the Synaptics package manager is available for your version of Linux, and it will install the correct versions of the software for your particular Linux distribution. What this means is that you can have any PC or Mac, or other system on which Linux runs, and the software will work. It's not limited to Raspberry Pi/ARM computers.