Saturday, July 20, 2024

10 things to do after you get your ClockworkPi uConsole

Note: For a more up to date version of this post, please see my github.

https://github.com/cjstoddard/Clockworkpi-uConsole

Unless you bought your uConsole from ebay for way too much money or you bought it from a sketchy Alliexpress seller, you probably waited months to receive it. Once you have it, the question is, what now? Well, The first thing you probably did was  assemble it, I am not going to cover that, there are plenty of Youtube videos out there for that. I am going to cover the things I had to do after I assembled it to get it where I wanted it to be in terms of software and usability. Here are the 10 things you can do to improve your uConsole experience. This list does require some working knowledge of Linux and Raspberry Pi's in general.

1. Get the Community OS image

The first thing t do is either boot to the SD card sent with the uConsole, if you did not get an SD card, get a 32GB SD card and download the stock image.

https://github.com/clockworkpi/uConsole/tree/master#uconsole-os-images

Burn it to the SD card and boot your uConsole with it. Test it out, make sure everything works. Now shut it down, remove this card and set it aside. This is your base line, if something goes wrong you can always boot off this SD card to make sure your problem is not just wonky software.

Next get a 64, 128 or bigger SD card, a 32 GB SD will fill up fast. Go download the community image.

https://forum.clockworkpi.com/t/bookworm-6-6-y-for-the-uconsole-and-devterm/13235

This image is based on a much newer version of the Raspberry Pi image along with an updated kernel. Burn this image to the larger SD card. Use it to boot up your uConsole and make sure everything works.

2. Update your system

Having an up to date system is paramount for any system, run these commands on a regular basis.

sudo apt update

sudo apt upgrade

3. Install useful programs

The first set of programs are text mode programs that I find useful, the second set are GUI programs I use. Adjust according to taste.

sudo apt install sudo mc links cmus htop neofetch tmux ffmpeg net-tools build-essential lame zsh mailutils git ufw default-jre tty-clock calcurse git wget curl flex bison bc libavcodec-extra -y
sudo apt install synaptic tilix audacious flameshot thunderbird filezilla transmission remmina gdebi thonny mozo vlc zim code -y

4. Change Desktop Environment (DE)

I am not a big fan of Wayfire or Wayland. If you want to change your DE to something else, use Tasksel to install the DE of your choice. I would also select Debian desktop environment, this will install things like LibreOffice and GIMP, but if you prefer a minimal setup, then leave it unchecked.

sudo tasksel
If you do this, the default Display Manager does not let you change your DE, for that you will need to install sddm.
sudo apt install sddm
The problem with sddm is when you reboot it will be sideways, so follow the next set of instructions to correct the screen orientation for sddm before you reboot.
sudo echo "xrandr --output DSI-1 --rotate right" >>  /usr/share/sddm/scripts/Xsetup

sudo echo "[X11\]" >> /var/lib/sddm/state.conf

sudo echo "DisplayCommand=/usr/share/sddm/scripts/Xsetup" >> /var/lib/sddm/state.conf

Once you have logged into your new DE, you will likely have to go to the display settings and rotate the display.

5. Safely Overclock your uConsole

The Raspberry Pi Compute Module CPU speed is 1.5 Ghz, and the GPU speed is 500 Mhz.  Most people find this barely usable. You can kick this up by overclocking your CPU and GPU. I have done this many times and I have never had a problem with these settings. While this speed is still not great, you will find the system much more usable. Run the following command;

sudo nano /boot/firmware/config.txt
add these lines to the bottom of the file, save and reboot.
over_voltage=6
arm_freq=2000
gpu_freq=750
gpu-mem=256
After your reboot run;

vcgencmd measure_clock arm
To make sure your CPU is running at 2 Ghz. You can try to set the CPU speed higher using arm_freq=2147, but not all devices will handle this speed gracefully. If you are going to experiment, please do so carefully and don't blame me if your shit breaks.

6. Setup Firewall

If you are going to be using your uConsole in public places, you will want to take some steps to secure it from bad actors. If you have not installed ufw yet, do so now with "apt install ufw".  Before you enable the firewall, you will want to allow ssh connections through your firewall so you can connect to it remotely.

sudo ufw allow ssh
sudo ufw enable

7. Secure ssh access to your system

Next you will want to setup your uConsole so it will only accept ssh connections from system you want it to. First log into your uConsole from the system you want to access it from, then log back out, then run the following command to generate a private and public key set.

ssh-keygen

Just hit enter three times to generate the keys. Next you will want to copy your public key to your uConsole with the following command;

ssh-copy-id remote_username@remote_server_ip_address

Now you should be able to log in using ssh, but the uConsole will not require a password. Repeat these steps from each machine you want to remotely access the uConsole from. Once you have done that, you will now want to disable password authentication so that only connections from systems that the uConsole has a key for will be allowed to log in. Run the following command;

sudo nano /etc/ssh/sshd_config

Search for the line "#PasswordAuthentication yes", delete the # and change yes to no. Save the file and then reboot the system.

8. Install Flatpak

Raspberry Pi OS has the same issue as Debian, the packages tend to fall behind long before a new release is made.  If you have programs that you want to stay up to date on, Flatpak is the way to do it. If you have not installed Flatpak, please do so now with "sudo apt install flatpak". Then to enable the repo run the following command;

flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
Now you can install programs from the Flatpak repo, which will be more up to date without breaking your install. For instance, if you want to install Discord, run the following;
flatpak install --user --assumeyes flathub com.discordapp.Discord
You can go to https://flathub.org/ to see what programs are available.

9. Get a screen protector

LCD screens are prone to  getting scratched, so this is a necessary step to preserve you investment in this device. Fortunately the uConsole screen is pretty close to the Blackmagic Pocket Cinema 6K Camera in screen size, so almost any screen protector for it will work for a uConsole.

https://www.amazon.com/dp/B07WCQD1NZ?ref=ppx_yo2ov_dt_b_product_details&th=1 

10. Get a carrying case

A nice hard shell is also a good idea. The one I am using is Hermitshell Hard Travel Case. It is designed for VR headsets, but works great for the uConsole and accessories.

https://www.amazon.com/gp/product/B01DVMTJQE/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1

Bonus. Build Emacs from source

This is not particularly necessary, you could just install it with "apt install emacs" or "flatpak install flathub org.gnu.emacs", but what fun is that. Besides showing your Hacker Street Cred, this is also a good way to stretch the legs of your new uConsole and make sure that the overclock settings are not causing any problems. For this exercise you will need to enable the source repo's in /etc/apt/sources.list and run "sudo apt update".

sudo apt install build-essential libgtk-3-dev libwebkit2gtk-4.0-dev
sudo apt build-dep emacs

flatpak install flathub org.gnu.emacsflatpak install flathub org.gnu.emacs

git clone https://github.com/emacs-mirror/emacs.git
cd emacs
./autogen.sh
mkdir build
cd build
../configure --with-cairo --with-xwidgets --with-x-toolkit=gtk3
make -j4
sudo make install

Doing it this way means you cannot update Emacs using apt or flatpak and you will need to do it manually. I would make shell script out of this and run it once a month or whatever.

cd emacs
git pull
cd build
make -j4
sudo make install

Alternatively, if you prefer Neovim, here is how to build it from source.

sudo apt-get install ninja-build gettext libtool libtool-bin autoconf automake cmake g++ pkg-config unzip curl doxygen
sudo apt build-dep neovim

git clone https://github.com/neovim/neovim.git
cd neovim
make -j4 CMAKE_BUILD_TYPE=RelWithDebInfo
sudo make install

Tuesday, July 16, 2024

M5Stack Cardputer

 

On the other side of the cool hardware spectrum from the uConsole, is the M5Stack Cardputer. This is a neat little gadget, with some medicore bits of software. The Cardputer runs about $30, but if you buy it from the manufacturer it will be on a slow boat from China, literally. It is better to grab one off of ebay. I got mine for $45 shipped and had it in 3 days.

In 1985 if you had asked me what a computer would look like in 2025, this is probably what I would have described. Basically what we had back then, maybe slightly more powerful, but definitely smaller. This has a lot in common with the Commodore 64, limited RAM, can only run one program at a time, the main difference being you copy firmware onto the internal storage rather than swap cartridges and it requires a reboot to switch programs.

I do see some potential for this little device, but I struggle to find anything super useful to do with it. It does run Doom pretty well, but beyond that most of the programs pranks and low grade hacking tools. Even the Mp3 players available are not particularly good, mostly because of the under powered hardware. The best program I have found so far is the Pipboy Demo, which does actually have one or two useful features, like a web radio and note pad.

It does have four exposed GPIO pins, one for 3.3v power, one for ground and two for communication, again pretty limited when compared to something like the Rasperry Pi Pico or just about any Arduino.

In theory, this is a neat idea, but in practice, not terribly useful. I think someone needs to port Basic to it and make it easy to swap out programs without rebooting the bloody thing. Until it finds its niche, I suggest skipping this one.

ClockworkPi uConsole, My new favorite toy

 

This is something I ordered months ago and finally received. Clockwork Pi is terrible at getting product out the door, it is so bad, I had basically forgotten that I ordered it. The uConsole hand held costs $189.00 with the Raspberry Pi CM4 board, if you can source your own, they cost $119.00, which is what I suggest you do, simply because you can then get the CM4 with 8 GB of RAM, rather than the 4 GB they send. If you do not want to wait months and months to get one, they regularly become available on ebay, but you will pay a premium for them. You should also be prepared to assemble this yourself, which for me was half the fun.

Things I didn't like:

The screen is a bit small for my eyes, but considering its size, it is a trade off I am willing to make. I am not much of a thumb typist, so the keyboard took some getting use to. The assembly can be a bit tricky and the instructions are a bit vague. The big mistake I made was putting the CM4 in upside down, it would not boot, but I quickly figured the issue out when I saw an actual picture of what it was supposed to look like, so I had to tear it apart again. The default image of the Raspberry Pi OS provided by the company is based on an old version of Debian. Fortunately there is a community image based on the current version of Debian that seems to work really well. Finally, you will find your wifi signal to be weak, it is just a design flaw with positioning of the antenna. It was not a serious problem for me, but if you find it is, there are a couple of hacks out there for fixing the problem.

Things I liked:

This is just fucking cool. On the box it calls the uConsole a "Fantasy Console" and I agree with them. When I very first read Neuromancer back in the late 80's, this was what I envisioned a cyberdeck to looked like, the only thing it is missing is a headset. I like the tiny track ball, it is nicely calibrated for the screen and has a nice feel to it. While the keyboard does take some getting use to, the buttons are very tactile and feel solid. The screen, while a bit small, is very clear with a solid refresh rate. The CM4 with 8 GB of RAM make this a peppy little system, even though the OS does run off an SD card. If your are familiar with the Raspberry Pi 4, runs about the same.

Overall:

I think with some practice this could easily replace my laptop for traveling. Usually when I am out and about, I am not doing anything heavy duty. I don't think I could do any heavy lifting on this system, but for web browsing, email, light document creation and quick programing projects, this would exceed my expectations. Honestly, this thing is a work of art. It is beautiful to behold and a heck of a lot of fun to put together.

Mastodon