-
Notifications
You must be signed in to change notification settings - Fork 4
Installation
last update: Feb. 17th, 2023
The following installation procedure was used by the author. It was tested on:
- Raspberry Pi Zero
- Raspberry Pi 3
- Raspberry Pi 4
There is no warrantee that the installation procedure will also work on your setup. The author is not liable for any damages, data losses and any other harms.
In January 2023 Stellar Mate did not provide the latest libcamera and pycamera2 packages needed to run indi_libcamera (see issue on indi_pylibcamera, message in Indilib forum and issue on picamera2). Therefore the following instructions are made for Raspberry Pi OS and not for Stellar Mate. The author does not know if an installation on Stellar Mate is possible in the meantime.
-
Use Raspberry Pi Imager to setup a SD card with Raspberry Pi OS Bullseye 32bit. The Raspberry Pi Zero will be too slow to run the graphical user interface: better you select the OS version without desktop environment. Before writing to the card press the button with the gear and:
- give it a host name (that makes it easier to find it later on your WiFi)
- setup the password for user "pi"
- enable ssh access
- input your WiFi SSID and password, set your WiFi country
- setup your localization
-
Before the first boot: Raspberry Pi Zero and Rasperry Pi 4 can do ethernet network over the USB cable. Especially for the Zero this is a good option when you plan to connect the Zero to a computer, a Pi 3 or a Pi 4. Remember that you may not have a WiFi network on your observation site! To enable this you need to setup the Raspberry Pi as USB RNDIS gadget:
- open the SD card on your computer
- add
dtoverlay=dwc2
to the end of fileconfig.txt
- insert
modules-load=dwc2,g_ether
to the line in filecmdline.txt
This will not work on Raspberry Pi 2 and 3!
-
Insert the SD card in your Raspberry Pi and boot. First boot can take a while.
-
Login to your Raspberry Pi:
ssh -l pi <computer name>
(replace <computer name> with the name you set above during the SD card setup) -
The default user "pi" is not allowed to login on a remote desktop. Therefore we work with a second user "cam" (or give it an other name you like) which is in user groups sudo, video and dialout:
sudo adduser cam sudo adduser cam sudo sudo adduser cam video sudo adduser cam dialout
-
Upgrade the OS to the very latest version:
sudo apt-get update sudo apt-get upgrade sudo apt-get dist-upgrade sudo reboot
-
After the reboot you can now login as user "cam":
ssh -l cam <computer name>
Do the next steps as "cam" user. -
If you do this for a Pi 3 or 4 and you want login on a remote desktop: install XRDP with
sudo apt-get install xrdp
-
If you want to access the user home directory as a Windows network share:
sudo apt-get install samba samba-common-bin
- Modify file "/etc/samba/smb.conf":
sudo nano /etc/samba/smb.conf
- add line
wins support = yes
right after lineworkgroup = WORKGROUP
- add at end of file:
[camhome] comment=cam home directory path=/home/cam browsable=Yes # guest ok=yes writable=Yes only guest=no create mask=0777 directory mask=0777 public=no
- add line
- Set password:
sudo smbpasswd -a cam
-
Test if libcamera works:
libcamera-hello --list-cameras
Expected output is a list of your connected cameras.
- INDI can be found on the Raspberry Pi OS repository:
sudo apt-get install indi-bin libindilx200-1 libindi-data libindi-dev libindi-plugins libindialignmentdriver1 libindidriver1
- Test INDI server:
No error messages should come up. Stop the server with
indiserver -v indi_simulator_ccd indi_simulator_telescope
^C
.
This is only needed when you plan to run KStars/EKOS on the Raspberry Pi. The Raspberry Pi must be powerfull enough to run the graphical user interface and KStars. Don't try this on a Raspberry Pi Zero!
The author tested KStars/EKOS on Raspberry Pi 3 and 4 but decided to use it on a Linux laptop for performance and stability reasons.
To install KStars on the raspberry Pi: sudo apt-get install kstars breeze-icon-theme
You need this only when you plan to use PHD2 on Raspberry Pi for guiding. The Raspberry Pi must be powerfull enough to run the graphical user interface and PHD2. Don't try this on a Raspberry Pi Zero!
The author tested PHD2 on Raspberry Pi 3 and 4 but decided to use it on a Linux laptop for performance and stability reasons.
Unfortunately PHD2 is not in the OS repository and needs to compiled manually:
sudo apt-get install build-essential git cmake pkg-config libwxgtk3.0-gtk3-dev wx-common wx3.0-i18n libindi-dev libnova-dev gettext zlib1g-dev libx11-dev libcurl4-gnutls-dev
mkdir ~/Projects
cd ~/Projects
git clone https://github.com/OpenPHDGuiding/phd2.git
cd phd2
git checkout v2.6.11dev4
cd ~/Projects
mkdir build_phd2
cd build_phd2
cmake -DOPENSOURCE_ONLY=1 ../phd2
make
The git checkout v2.6.11dev4
was needed because the latest commit could not be compiled. During the make
you will have time for a coffee (or 2 or 3). The make
will show some warnings about changed GCC behavior but it should not end with an error. After all you should have a file phd2.bin
in folder ~/Projects
. Test it:
cd ~/Projects
./phd2.bin
If it works you can install it:
sudo make install
-
To install the indi_pylibcamera driver do:
sudo apt install git python3 python3-lxml python3-astropy python3-picamera2 mkdir -p ~/Projects cd ~/Projects git clone https://github.com/scriptorron/indi_pylibcamera
-
Test the driver:
cd ~/Projects/indi_pylibcamera indiserver -v ./indi_pylibcamera.py
No error messages should come up. Stop the server with
^C
.Use the same commands to start the indiserver for operation.
-
In some cases you want to give your camera a different name. For instance when you have more than one Raspberry Pi camera on your telescope (one for taking pictures and one for guiding) you will give them different names to distinguish them in INDI. You can do this with a settings file:
- Copy the settings file:
mkdir -p ~/.indi_pylibcamera cp ~/Projects/indi_pylibcamera/indi_pylibcamera.ini ~/.indi_pylibcamera
- Edit the settings file and mdodify "DeviceName" to your needs:
nano ~/Projects/indi_pylibcamera/indi_pylibcamera.ini
-
After setting up a Raspberry Pi 4 with graphical user interface and XRDP the remote desktop was pretty slow. Reason was a process "mutter" taking a lot of CPU (you can see which process makes your CPU bussy with
top
). To fix this it was needed to activate VNC insudo raspi-config
. After reboot the window manager "openbox" will be used and CPU load will be less than 1%. -
The accurate time is essential for KStars to calculate star positions. The Raspberry Pi does not has a real time clock. Normally it gets its clock from internet. But maybe you do not have internet access on your observation site. You can manually set the system time with
sudo date --set="2023-01-18T10:13:36+01:00"
. -
When you setup your Pi as USB RNDIS gadget and you connect it with USB to a computer or other Pi it will do ethernet over USB and get a local IP address. Often you can use
<computer name>.local
(replace<computer name>
with the name yo gave your Pi) to access the gadget. If that does not work you can find out the local IP address by runningifconfig
(Linux or Raspberry Pi) oripconfig
(Windows) on the host, looking for USB networks and scanning the network withnmap
. It seems the gadget always gets the same IP address. -
If you configured WiFi on your Raspberry Pi and you connect it also with LAN cable or as USB RNDIS you will end up with 2 active network connections. This can have strange effects. You can disable the WiFi connection on your Raspberry Pi with
sudo ifconfig wlan0 down
. To enable it again dosudo ifconfig wlan0 up
-
The authors hardware consists of
- Main camera: Pi Zero with HQ camera
- Guiding camera: Pi 3 with HQ camera (2nd setup: Pi 4 with V1 camera)
- main camera gets power and network over USB from the guiding camera
- guiding camera has LAN cable to a Linux laptop running KStars/EKOS and PHD2.
When powering the whole setup with a single USB cable on the guiding camera the software was very unreliable: from time to time programs got stuck, cameras stopped to answer or the whole network connection got lost. The voltage drop on the USB cable was too high. The issues disappeared when supplying the guiding camera with a 5V regulator directly connected to the Raspberry Pi pin header (short distance!).