Yesterday, I received my Pi4 and other stuff needed to get up and running.
I decided to write down what I did step by step hoping that it will help someone else.
I wrote the guide on a level so anyone should be able to follow (even people with no Linux experience).
I will start with the required steps and then I will add more posts with optional steps that I used to improve my setup.
Guide: StellarMate OS on Raspberry Pi4
1. Prepare Raspbery Pi 4. I decided to put it inside a Flirc heatsink case. I bought a small USB-C to Micro USB adapter so I can use the same cable as I used to power my old Raspberry Pi 3.
2. Download StellarMate OS and follow the Installation guide on this link to put it on an SD card with Etcher: www.stellarmate.com/products/stellarmate-os.html
3. Insert MicroSD card into the Pi4 and power it up.
4. Wait a few minutes and use any other device to connect to the WiFi hotspot named stellarmate (default hotspot password is stellar@mate)
5. Now you can either use:
a. Any VNC client from any device to connect to hostname stellarmate (default password is smate). I used UltraVNC Viewer from a Windows PC
b. KStars client on any device to remote control your astro gear attached to the Pi4
As I mentioned earlier these are the only required steps needed to get the StellarMate OS up and running.
If you are happy with the way it works you don't have to follow any of the optional steps that I will post next.
OPTIONAL: Disable the hotspot and connect the StellarMate to your home WiFi:
1. Right click the WiFi icon in the top of the screen -> Edit Connections...
2. Click the big plus in the bottom -> Choose Wi-Fi
3. On the Wi-Fi tab fill out the SSID of your home WiFi and change mode to Client. I set Band to 2.4 GHz, channel to default and Device to wlan0.
4. On the general tab ensure that "Connect automatically with priority" is selected and fill out a priority. I gave it priority 10 to make sure it will be the first choice when attempting to connect automatically after boot.
5. On the Wi-Fi Security tab select the security mode and password for your home WiFi. I selected WPA & WPA2 PErsonal and typed in my password.
6. In the top select a connection name or leave it as default if you want to and Click Save
7. Select stellarmate in the list -> click the big Minus in the bottom to delete the stellarmate hotspot
8. Now you will loose connection because the stellarmate hotspot that you are connected to does not exist anymore. Close your VNC client and wait for a few minutes
9. Now connect to your home WiFi with any device and connect to the StellarMate via your preferred VNC Client again (hostname stellarmate)
10. Now you can remote control StellarMate again and this time it has internet connection
OPTIONAL: Update the StellarMate software (Internet connection required):
1. Start the terminal via VNC
2. sudo apt-get update
3. sudo apt-get upgrade
4. Answer Yes when needed
OPTIONAL: Synchronize the time on the StellarMate with an internet time server (internet connection required):
1. Figure out the name of your current timezone with a command like this (change "Copenhagen" to the name of a big city near you or the name of the continent you live on)
timedatectl list-timezones | grep Copenhagen
2. Set the timezone on the StellarMate with this command (change the name of the timezone to your timezone):
sudo timedatectl set-timezone Europe/Copenhagen
3. Enable synchronization via internet time server with this command:
sudo timedatectl set-ntp true
4. Wait a few seconds and observe that the time on the StellarMate is now correct.
OPTIONAL: Getting the powered USB hub up and running
1 Connect the hub to one of the USB3 ports of the Pi4
2. Power up the hub
3. Now every device you attach to the hub will be powered by the hub's power source so it does not take power from the Pi4. Because of this it is recommended to connect all USB devices to the hub instead of the PI4's USB ports.
OPTIONAL: Getting the external USB WiFi adapter up and running
1. Connect the USB WiFi adapter to the powered USB hub
2. Click the WiFi icon in the top of the screen
3. Now you have 2 WiFi adapters in here. Under the external WiFi adapter click on your home WiFi and provide the password
4. Now you are connected to your home WiFi via the external WiFi adapter.
1. Connect the USB WiFi adapter to the powered USB hub
2. Navigate to the /usr/src folder
3. Download the driver:
sudo git clone github.com/EntropicEffect/rtl8822bu.git
4. Edit the makefile:
sudo nano Makefile
5. Update lines 100 and 101 to this and save the file:
CONFIG_PLATFORM_I386_PC = n
CONFIG_PLATFORM_ARM_RPI = y
6. Build and install the driver:
sudo make install
8. Click the WiFi icon in the top of the screen
9 Now you have a new WiFi adapter in here. Under the external WiFi adapter click on your home WiFi and provide the password
10. Now you are connected to your home WiFi via the external WiFi adapter.
Here is the output from speedtest-cli afterwards:
Ping: 6.965 ms
Download: 132.26 Mbit/s
Upload: 133.52 Mbit/s
OPTIONAL: Setup a quick FTP server for easy file transfer between StellarMate and other devices
1. Install FTP server:
sudo apt-get install vsftpd
2. Edit configuration file:
sudo nano /etc/vsftpd.conf
3. Find these lines and remove the # in front of them:
4. Add these lines to the end of the file:
5. Add necessary folders:
6. Change permission of the ftp folder:
chmod a-w ~/ftp
7. Restart the service to reload the configuration:
sudo service vsftpd restart
8. Now you can use any FTP client from any device to download any files in the ~/ftp folder of the stellarmate (connect to hostname stellarmate on port 21 with username stellarmate and default password smate)
This is especially useful if you need to download movie or image files captured with FireCapture or Ekos and saved on the StellarMate.
OPTIONAL: Install FireCapture to supplement KStars/Ekos with great planetary astrophotography
1. In order to install FireCapture, download the Raspberry Pi version from: www.firecapture.de/
2. Unpack the file:
sudo tar -xzf ~/Downloads/FireCapture_v2.6_armhf.tar.gz --directory /usr/share/
3. Set permissions on the folder:
sudo chmod 777 -R /usr/share/FireCapture_v2.6_armhf/
4. Edit the start.sh script:
sudo nano /usr/share/FireCapture_v2.6_armhf/start.sh
5. Change heap to
6. Hit CTRL + X to exit and Y (when prompted to save) then Enter to confirm your change.
7. Afterwards FireCapture can be started with these commands:
OPTIONAL: Make a shortcut on the desktop to start FireCapture
1. Create a new desktop shortcut
sudo nano /home/stellarmate/Desktop/FireCapture.desktop
2. Add these lines to the file:
3. Hit CTRL + X to exit and Y (when prompted to save) then Enter to confirm your change.
4. Make the script executable:
sudo chmod +x /usr/share/FireCapture_v2.6_armhf/start.sh
5. Edit the script:
sudo nano /usr/share/FireCapture_v2.6_armhf/start.sh
6. add this line in the beginning of the script:
7. Hit CTRL + X to exit and Y (when prompted to save) then Enter to confirm your change.
8. Now you can double click the new FireCature shortcut on the desktop to start the program
If you get the error message "Failed to execute child process "xterm"" when you try to start FireCapture from the desktop shortcut, then one solution is to run this command to create a symbolic link:
sudo ln -s /usr/bin/lxterminal /usr/bin/xterm
And then activate the desktop shortcut again afterwards.
OPTIONAL: Getting the external SSD harddrive up and running
1. Insert the harddrive stick into the plugable USB 3.0 harddrive connector
2. Connect the USB3 cable to the powered USB hub
3. Run this command and find the SSD harddrive in the list
sudo fdisk -l
4. My disk is located at /dev/sda. I found it in the list using the size and the model name.
5. Use this command to edit the disk’s partition table (Remember to adjust the path if your SSD drive is located somewhere else):
sudo fdisk /dev/sda
6. Enter the following options when prompted: n, p, 1, <enter>, <enter>, w
7. Use this command to format the partition:
sudo mkfs -t ext4 /dev/sda1
8. Use this command to create a directory to use as the filesystem mount:
sudo mkdir /ssd
9. Use this command to mount the partition:
sudo mount /dev/sda1 /ssd
OPTIONAL: Configure the Pi4 to mount the SSD on boot (Warning: If this is done wrong you loose all data on the sd card)
1. Use this command to get the Partition UUID:
sudo blkid /dev/sda1
2. Use this command to edit the fstab file:
sudo nano /etc/fstab
3. Add your SSD drive to the file. For me the added line looks like this (Remember to change 1st and 2nd parameter to match your ssd details):
PARTUUID=19efd0bd-01 /ssd ext4 defaults,nofail 0 0
4. reload the fstab file without rebooting with this command:
sudo mount -a
5. Observe that the SSD is mounted with this command:
OPTIONAL: Make the Pi4 run almost everything from the SSD Harddrive
The theoretical maximum for the SD card reader on Pi4 is 50MBps and with USB3.0 the theoretical maximum is 640MBps.
Often it is "only" possible to achieve around 200MBps with a SSD drive on Pi4, but that is still much better than the SD card.
Everything will load 4-5 times faster with an SSD and platesolve will also be lightning fast when done with Astrometry.net setting set to Offline via Kstars on the Pi4 or when done with Astrometry.net setting set to Remote via KStars on another device.
When the Astrometry.net setting is set to Online it will still be very slow, so don't use that.
1. Ensure that the SSD drive is mounted (it is if you followed the previous steps)
2. Copy files from your root folder to the SSD with this command:
sudo rsync -avx / /ssd
3. Open the /boot/cmdline.txt file for editing
sudo nano /boot/cmdline.txt
4. Paste the following text at the end of the first (and likely only) line of cmdline.txt (Remember to change the PARTUUID to the one matching your SSD partition. See information above on how to get it)
root=PARTUUID=19efd0bd-01 rootfstype=ext4 rootwait
5. Hit CTRL + X to exit and Y (when prompted to save) then Enter to confirm your change.
6. Now the Pi4 will see /dev/sda1 (provided that that is your external drive partition) as your primary storage drive. From here on both the microSD card and the external SSD must be connected in order to boot.
7. Reboot the Pi4. It won't boot unless the external drive is connected as long as this text is in the cmdline.txt file.
You must remove the line from the file if you want to boot without the SSD connected.
8. Use this command to verify that /dev/root now matches the size of your SSD instead of the size of your microSD card
There is an obvious improvement of using the External Ralink RT5370 USB WiFi over the Built-in Raspberry Pi4 WiFi.
The improvement is biggest in a location that don't have too bad WiFi coverage.
There is only a small improvement in signal strength of using the replacement 5dBi antenna over the stock 2 dBi antenna.
So I could keep using the small antenna and I would not reccomend buying a replacement antenna.
However, now that I have it, I will continue using it.
Thanks for reading this far down.
I hope that my posts are useful to someone in the future.
Let me know if you had any use of it.
And also let me know if you have any suggestions for ways to do the same things a lot easier.
And feel free to post your own OPTIONAL steps in this thread that I and others can use to improve our Raspberry Pi4 setup even further.