Starting from Scratch
Assuming you use a Raspberry Pi 5. If you have some other hardware this steps may differ but still can be a usefull reference on what is needed. Requirements:
- A Raspberry Pi 5 (R-Pi)
- A microSD card (16GB or larger recommended)
- A microSD card reader
- The pre-configured HAlpha image file. You will find the latest release in the source repo.
- Imaging software Raspberry Pi Imager
- Power source 5V@5A
Write image Steps
- Open Raspberry Pi Imager.
- Plug your sd card with your sd card reader to your computer.
- Under
Raspberry Pi DeviceselectRaspberry Pi 5. - Under
Operating System, under the menuRaspberry Pi OS(other)selectRaspberry Pi OS Lite (64-bit). - Under
Storagechoose you sd card. - Press
ctrl+shift+xto open the OS Customisation menu. Under menu GENERAL do the following:- Unset the hostname
- Set a username and password (for example username: pi and password: raspberry) you can also later change it with cmd
passwd - If you connect over ethernet unset Wireless
- Set your keyboard layout

- Under SERVICES do the following:
- Enable SSH
- Enable Use password authentication

- OS Customisation menu and press
next. - For the question
Would you like to apply OS customisation settings?press yes. - Press again yes for formatting the sd card. Then the image getts written to your sd card. (It can take some minutes.)
- Once the image is finished take the sd card and plug it into the unpowered Raspberry pi sd card slot.
Get the source code
Once you have flashed the sd card you can plugin a keyboard, network cable and display to the raspberry pi and power it up. Now you should see a black starting screen loading up. Once finished it will ask to login with your prevvios set username and password. 1. Login using the username password we created in the imager 2. Get the hostname of the R-Pi with the command
This will give you back the ip4 adress of your RP5. Know we can use the ip4 adress to ssh into our R-Pi from within the same networkTip
if you already had an ssh connection under this ip4 address you will get an error:
to resolve this just navigate to the /.ssh folder and delete all the entries of this ip4 address from known_hosts file.Install git
Now we have to install git to get the source code from the repo. To do this we first update the R-Pi and then install git:
pi@raspberrypi:~ $ sudo apt-get update
pi@raspberrypi:~ $ sudo apt-get upgrade
pi@raspberrypi:~ $ sudo apt-get install git
pi@raspberrypi:~ $ mkdir /home/pi/docs
pi@raspberrypi:~ $ cd docs
pi@raspberrypi:~ $ git clone https://github.com/pmodwrc/halpha.git
pi@raspberrypi:~ $ cd halpha
Install other dependencies
To properly use python we need a virtual environment. For this we uses venv but you could also use conda.
opencv we need to have libg installed. To do this we install
Installing Samba
To later share our png files on a external drive we install Samba and the client smbclient.
Setting up the virtual environment
To create an environment we go to our halpha directory and we run the venv command inside of python
in our case we just keep it close inside the our halpha directory thus the command is If you type nowls you should see the venv directory Tip
Note that if you're in a different directory you need to specify the correct path to the venv directory. Once the venv is activated you should see the current activated environment in the first part of your terminal.
Now we install all the needed python packages we have in our code.
Setup the Samba client
To do this you just need to configure to environment variables. Ask your sysadmin what is the username and password for your saba client and run in the terminal:
pi@raspberrypi:~$ export SAMBA_USER=<your_user>
pi@raspberrypi:~$ export SAMBA_PASSWORD=<your_password>
Installing the camera driver
For this step we change the directory to /camera_driver/raspberrypi_5. Here we unpack the compressed driver file:
(venv) pi@raspberrypi:~/docs/halpha/camera_driver/raspberrypi_5 $ tar -xvf sdk_libqhyccd_20240118.tar
sdk_Arm64_24.01.09 directory. We inter this directory and run the installation script:
(venv) pi@raspberrypi:~/docs/halpha/camera_driver/raspberrypi_5/sdk_Arm64_24.01.09 $ sudo ./install.sh
usr/local/testapp/ or you can run our python script to test out if the installation worked.
For the second one go back to the root of halpha and go into the sun_catching directory.
Try it out! Hook-up the camera and run the pythonscript! For this you run python process.py.
If everything went well you should be now setup and ready!
Happy coding