Raspberry Pi / small computers Tips and trick


Power and peripherals


Configuring before boot

imager 1

Save time and pre configure a couple of things when burning the PI image:

imager 2

ctrl-shift-X !

Connecting a bluetooth keyboard

Simply.
Other bluetooth devices (speakers, etc).
You can also make sure it is on at boot time.

Using a phone or tablet as keyboard/screen

This one is very easy, because it is standard unix procedure.
  1. Enable ssh on your raspberry.
  2. Find the IP address of the pi.
  3. Install a client on the other machine.
    If you are using a windows machine, putty or mobaXterm are very good choices. MobaXterm is recommended since it comes with an X server as well.
    On android, JuiceSSH or connectBot are nice. On the iPhone you can use aShell.
    If you have chrome installed, you can simply use the chrome shell app.
  4. That's it! just connect :-) - just remember that if you don't have an X server, you're limited to text mode.


raspberry
Using a phone as screen and a bluetooth keyboard.

Using a phone or tablet as screen (1)

using a USB cable.

Using a phone or tablet as screen (2)

using an HDMI to USB converter.

Using a phone or tablet as screen (3)

using VNC, or here.
En français.

Using a phone or tablet as screen (4)

using RDP.
Free RDP android application, or here.

Using several systems

(multi-boot)
You can either have several microSD cards, one with each system, and swap when needed, or you can have several systems on one single card and use the berryboot loader to choose every time you boot.
Install instructions.
BerryBoot konfigurieren.
Instructions d'installation.
The loader for the pi3 is hidden here.
Some remarks which don't make sense:
- every time I bypassed the wifi connection, the SD formatting crashed.
- sometimes the crash was so bad a simple low-level format wasn't enough, I had to reformat with the official SD Formatter.
- when all other option failed, btrfs formatting worked.
Told you it didn't make sense.

Collection of berryboot systems images

Alex Goldcheidt fantastic site.
More images.
More images.

Speeding up

That said, the SD is definitely pi's achille heel. Most time the system is slowing down, it is because it is waiting for the SD card. Memory and cpu are less of a problem. To the point that I now use a sd card with berryboot because it has to boot on the SD, but then I immediately move to either a usb key or a network drive. Berry boot allows you to store the system on an external USB drive, and the home directory is mounted on the network.

raspberry
Luckily, for the Raspberry Pi 4 this is no longer necessary, as the Pi Imager will now let you change the boot sequence. Here is an alternate procedure for the eeprom update .

Apparemment c'est possible aussi pour le 3 (non testé).

Another trick to speed up your raspberry is to change your file system to f2fs. (disponible en français ici).

Android ssh/X11

JuiceSSH 2.1.4 .(This works with android < 8.0 - tested on 2.3.4)
X11 Server 1.31. (needs android => 5.0)
To display programs within the X-Server app you need to set the DISPLAY environment variable on your host device. Its also highly recommended to use a window manager (i.e. lwm)(*).
(hint: write a script or an alias!
This works for me:
export DISPLAY=`echo $SSH_CLIENT | cut -f1 -d " "`:0'
You may have to force ipv4 with -4)

A simple window manager (FLWM) is already embedded into the application.
ie:
$ export DISPLAY=192.178.1.2:0
$ lwm &
$ xclock
Here running dillo and xclock:
raspberry X

Other versions:
X11
XSDL
Realistically, to use the graphic mode (X11), you need a tablet, unless you have a very big phone :-)
(*) You can use tinywm to save memory.


Real life notes

On the raspberry3, CPU intensive or disk-intensive tasks are out. Not because it will not work, (it eventually will), but because of the time it takes. Simply loading chromium, the default browser, will max out cpu usage at 12 (after 15 minutes I gave up).
Taking that into account, and considering the type of use I have for the raspberry, here are a couple of simple rules that make the machine actually viable:
- If you can, upgrade firmware to boot from USB and move your OS to an external disk. Also add a swap. That is the best you can do.
- I usually do this: If everything works according to plan, you know have on your usb key a system image running f2fs instead of ext4 and a swap of 4/5Gig. You could of course put the swap on another key. Depends on the number of ports you have on your usb hub - don't forget you need the alim for all those.
- Enable ssh immediately and connect to the machine. That way you have a backdoor that will allow to kill the offending program and recover control of the machine.
- Upgrade manually with apt rather than using the graphic tool provided.
- As a general rule, avoid anything graphic if you can. It unecessary uses cpu.
- For the browser: lynx of course (and links, elinks, links2), but also dillo and midori. Midori will max out at 5, which is less than half of chromium or firefox. At least you have a chance to see the page. I have tried several version of other browsers (like vivaldi, since opera doesn't exist for arm), it is no better as most are based on chrome. There is also puffin which works like the old opera-mini used to on android, ie it sends your queries to a server that fetches and compress them for you. I don't trust the privacy much, but it's an option.
- Replace LibreOffice by Abiword for word processing and gnumerics for spreasheet (assuming you really need one). Better still: markdown is easy and fast in vi, and with pandoc you'll have that in docx or pdf format without hassle.
- Switch to gemini (*) ! The offpunk client works wonders on that machine, even if it has its learning curve. (see also amfora or Bombadillo).

(*): (if you don't know what it is, see Le "petit internet" or The rise of the small internet).

That said, as a server on an internal network with a small http server (I simply use busybox with cgi), the raspberry 3 is perfect. I even moved the whole config to an old raspberry 2 that I was given, and it still works too !

Similarly, I have another R3A+ configured for the boat with openplotter; it pays to configure / upgrade it in advance, as it will take a while, even with the system hosted on a USB key. Also if you are not familiar with the various programs (opencpn, etc), it is worth exploring them first. To save time what I did was to download the maps and prepare as much as possible on another machine. As I use bootberry to boot on the USB, I also put LibrElec on the USB as multimedia/TV center when not using OpenPlotter. It works really well and is really recommended.
If you need to shrink an image to use a smaller card, have a look here..

There are many other Single Board Computers, so don't limit yourself to rapsberries.
You can find Debian SD images for single board computers here:https://sd-card-images.johang.se/boards.html.
Similarly, Linux is not the only free unix-like implementation. If you need a unix-like for a non-MMU board, try fuzix or ELKS.
Find out more operating systems for the raspberry.
This is just mind-blowing !!.
See also here !!.










[Top]