Get Raspberry PI INDI server up and running

Published on 1 March 2023 at 08:58

Astrophotography is a fascinating hobby for anyone who has an interest in astronomy and photography. With the right equipment and techniques, you can capture stunning images of stars, planets, galaxies, and other celestial objects. In recent years, the Raspberry Pi HQ Camera has become a popular tool for astrophotography enthusiasts, as it offers a high-quality camera at an affordable price.

The problem we are trying to solve

 

With the latest 64-bit Raspberry Pi OS come new camera support library Libcamera. It is very promising but it is still heavy under development and support for it isn't straightforward at the moment.

There is already great free solution for astrophotography with Raspberry Pi with Astroberry server. But unfortunatelly Astroberry server isn't updated to latest 64 bit Raspberry Pi OS Bullseye just yet (if it ever will be).

In this article, we'll walk you through the process of setting up your Raspberry Pi with Raspberry Pi OS Bullseye 64-bit and installing the necessary software to take astrophotography pictures with HQ Camera. We'll cover how to install the INDI server, INDI-3rdparty drivers (like popular indi_eqmod_telescope) and KStars planetary software using a script called astro-soft-build. We'll also show you how to install the indi_pylibcamera library to control the HQ Camera from KStars and Ekos.

Setting up your Raspberry Pi

 

Before you begin, you'll need to have a Raspberry Pi 4B with 4GB of RAM and a Raspberry Pi HQ Camera. You'll also need a microSD card (at least 16GB, recomended is 32GB or more), a power supply, and an HDMI cable (optional). Follow these steps to set up your Raspberry Pi:

  1. Download the latest version of Raspberry Pi OS Bullseye 64-bit from the official Raspberry Pi website.

  2. Flash the OS image to your microSD card using a tool like Raspberry Pi Imager or Balena Etcher.

  3. Insert the microSD card into your Raspberry Pi and connect it to a power supply.

  4. If you're using a monitor, connect it to your Raspberry Pi using an HDMI cable.

  5. Boot up your Raspberry Pi and follow the on-screen instructions to set up the operating system.

  6. Once you've set up the operating system, open the terminal and enter the following command to update your Raspberry Pi's software:
    sudo apt update && sudo apt upgrade -y

  7. If you dont have git installed, install it with this command:
    sudo apt-get install -y git

INDI Library

 

INDI Library is an open-source software used to control astronomical equipment. It is based on the Instrument Neutral Distributed Interface (INDI) protocol and acts as a bridge between software clients and hardware devices. Since it is network transparent, it enables you to communicate with your equipment transparently over any network without requiring any 3rd party software.

Build, install INDI and KStars

 

Astro-soft-build is a script that installs the INDI server, INDI-3rdparty drivers and KStars planetary software on your Raspberry Pi. It was created by great guy Dušan Poizl Please follow these steps:

  1. In your terminal window type this:
    mkdir ~/Projects
  2. Move to newly created Projects directory
    cd ~/Projects
  3. Download astro-soft-build Git repository
    git clone https://gitea.nouspiro.space/nou/astro-soft-build.git
  4. Change directory to:
    cd astro-soft-build
  5. Before first build you have to install dependencies (this may take a while):
    ./install-dependencies.sh
  6. After dependancy instalation, run the following command:
    ./build-soft-stable.sh
  7. Wait for hour or two for script to finish

After this procedure you have working INDI server with all third party drivers. Check if indi server is installed with this command: indiserver

Install indi_pylibcamera

 

Great guy Ronald Schreiber developed Indi_pylibcamera Python INDI driver. It allows you to control the HQ Camera from within the INDI server. Follow these steps to install indi_pylibcamera:

  1. Check if libcamera is properly installed and that it detects your HQ camera:
    libcamera-hello --list-cameras
  2. Move to Projects directory
    cd ~/Projects
  3. Install required libraries
    sudo apt-get install -y libcamera-apps indi-bin python3-picamera2 python3-lxml python3-astropy
  4. Install driver from PyPi Python Package Index
    sudo pip3 install indi_pylibcamera
    or
    sudo pip3 install indi_pylibcamera --break-system-packages 
    (only for Raspberry PI OS Bookworm or above)
  5. Run post install script
    sudo indi_pylibcamera_postinstall

Install indi_gpsd (optional)

 

Because Raspberry PI 4B+ doesnt have RTC (Real Time Clock) on board, I solved this issue with USB GPS dongle. It provide Raspberry PI with GPS information and accurate time at the same time.

Follow steps bellow to get it running:

  1. Plugin in the GPS receiver
  2. Open terminal and type following command:
    ls /dev/tty*
  3. In the list you should see /dev/ttyACM0
  4. You can check if it is working with this command:
    sudo cat /dev/ttyACM0
  5. To install GPSD type following command:
    sudo apt install gpsd
  6. To make GPSD available on boot open /etc/default/gpsd with nano text editor:
    sudo nano /etc/default/gpsd

    Edit file to match this:
    # Devices gpsd should collect to at boot time.
    # They need to be read/writeable, either by user gpsd or the group dialout.
    DEVICES=""

    # Other options you want to pass to gpsd
    GPSD_OPTIONS="/dev/ttyACM0"

    # Automatically hot add/remove USB GPS devices via gpsdctl
    USBAUTO="true"

    # Start the GPSD daemon automatically ate the boot time
    START_DAEMON="true"

  7. Reboot Raspberry PI
    sudo reboot

If everything is OK, GPSD should now be available and you can now use indi_gpsd driver in your astronomical sofrware.

Start INDI server

 

All that is left to do now is to acctually start INDI server and connect to it remotelly with KStars and Ekos.

To start INDi server write this command in your terminall screen:

  1. start the server with:
    indiserver -v indi_pylibcamera indi_eqmod_telescope indi_gpsd

If you want to automate this step, see my article Install INDI Web Manager on Raspberry PI covering that.

Connect KStars to INDI server

 

I will asume that you are already familiar with KStars and Ekos. KStars Profile editor should look like this:

If you are using some other mount use INDI driver for your mount. I'm using Skywatcher AZ-GZi in EQ mode. For camera driver type in driver name indi_pylibcamera. Save configuration, close window and start Ekos. If all is OK, you now have working Ekos session capable of long exposures with your HQ Camera! Isn't that just great?

Clear skies!

Rating: 5 stars
3 votes

Add comment

Comments

Buz McCullough
2 years ago

I want to use Raspberry Pi Global Shutter Camera on a Dob without goto mount. Can I just leave the Mount box blank? Also, Ekos tells me it isn't finding the py_libcamera. What I am trying to do is use the camera for plate solving and a push to guide.

Simon
2 years ago

Yes, you can leave mount field blank or even better, choose telescope simulator. That way you can see where your actual position is and where EKOS "think" you are. You can see this youtube video how to achieve this: https://www.youtube.com/watch?v=ZA-ykUrxmlY