Doing Astrometry with Kstars / Ekos / INDI with a Raspberry Pi3


I have recently switched my entire telescope setup over to the open free development platform known as INDI. It runs in concert with another piece of software called Kstars which interfaces your equipment using a module in Kstars called Ekos. These instructions only cover getting this working between a RP3 and a PC. I don't own a MAC computer - sorry. This is a great setup because you run everything over Wifi with no cables connecting your telescope equipment to your PC. So you can run everything from a distance inside of a nice warm place. The Kstars / Ekos / INDI combo supports a lot of equipment - I recommend reading up on what it can do.

The basic setup breaks down like this:


So basically the Raspberry Pi3 (RP3) turns into an equipment server. All of the drivers for the equipment are hosted in Ubuntu Mate on the RP3 and you are just sending commands to them over your home Wifi network and getting real-time feedback inside of Kstars.

A few things you will need to get started:
- Verify your equipment is supported: INDI Supported Devices
- A Raspberry Pi 3: Option from Amazon
- At least 2 amp v5 power supply: Option from Amazon
- Heat sinks are encouraged: Option from Amazon
- Decent micro SD card: Option from Amazon
- Optional case of your choosing:Option from Amazon
- Highly recommended to use a powered USB hub of some kind so equipment is not taking power from the RP3.
- Spare keyboard / mouse / HDMI monitor (Only for temporary use to setup the RP3)
- A PC running Kstars

SETTING UP THE RP3

- First, it is a good idea to get the RP3's heat sinks installed. Simple operation as they come with adhesive heat paste.
- Download Ubuntu Mate image for Raspberry: Ubuntu Mate Download Page
- After the download is complete to your PC, use the program Etcher to write the image to the SD card you purchased above. This is a very simple 3 step operation, can't mess it up.
- Once the image is flashed to the Micro SD card, insert it into the RP3, hookup a Monitor / Mouse / Keyboard, and plug the power in. You should enter the Ubuntu Mate OS. Follow whatever steps are necessary to get into the OS.
- Get used to the Ubuntu OS. (Its not much different than OSX or Windows)
- Connect to your home Wifi. Choose a static IP for the RP3. You can set it in the Ubuntu OS or look up the documentation on your home Router to setup an IP reservation by Mac address. I am using 192.168.1.5. Keep the static IP as you will need it later to connect to the RP3 from Ekos.
- We are now ready to install stuff.
- First install INDI. This is done with the Terminal program in Ubunutu Mate. Very easy to find as a shortcut should have been made on the taskbar. It is a command line interface.
- By default, commands entered in Terminal are not ran at the highest elevated privileges in the OS. You will add the word sudo before any command you need to run with admin rights. Get familiar with some basic Ubuntu/Linux commands 10 basic commands.
- Type / Copy Paste this command into Terminal and hit Enter: sudo add-apt-repository ppa:mutlaqja/ppa
- Then: sudo apt-get update
- Then: sudo apt-get install indi-full
- After these are all done, you should have INDI installed on your system.
- Make sure all of the drivers for your equipment are installed. A lot are included, but some are not. You can find drivers for your supported devices here: Devices. For instance, from the Ubuntu Mate OS I had to download the drivers for my Atik from the site listed at the previous link and install them manually (GUI installer) in Ubuntu
- The Atik driver I had to install was: driver for ARMHF (V6+) Debian Linux or Raspbian atikccd-1.26-armhf.deb

USING INDI

- Once you have the RP3 with the OS installed, a static IP, and INDI installed, you really don't need a monitor / keyboard / mouse anymore. From here we will be connecting to the PR3 over the Wifi network using Putty.



- Putty is a program that lets you access the Terminal we used earlier remotely from a PC. It is simple to use / configure. Just put in the IP of the RP3, give it a name, and save it for later use. To connect, just double click on the name. Once you connect, you are prompted for a username and password you setup during the OS setup earlier.



- With the RP3 on, to get INDI server going you'd typically run a command like this: indiserver -v indi_atik_ccd (other equipment)... BUT, there is a much easier way to do this with a GUI. Install INDI Web Manager.
- INDI Web is a python program that gives you access to the INDI server with a GUI and makes selecting equipment and starting the server much easier.
- From a Putty command window run: sudo python pip install indiweb
- Now that INDI Web is installed, we have to start it up each time we want to image. So each time you boot up your equipment with the RP3, you have to Putty into it and start INDI Web
- From a Putty command window run: indi-web -v
- To access the GUI web interface from your PC, you have to open up a web browser window and navigate to the IP of your RP3 at port 8624 like so: http://192.168.1.5:8624 (Bookmark this page for quicker access)
- Once there, you are presented with a very nice GUI for choosing which equipment you have and starting the server that looks like this:

(Click to enlarge)


- Get familiar with this page and setup your equipment profile - start the server.
- Record the outgoing port number which you will use to connect to the RP3 from Ekos. 7624 is default and should be fine.

CONNECTING TO RP3 FROM EKOS

- Kstars is the planetarium you will use to navigate the sky ect. Ekos is the interface inside of Kstars for connecting to your equipment and shooting images.
- Not much I can do to help with Kstars, just need to play with it a lot to get familiar with the interface and options. It is like most other planetarium software packages.
- Once Kstars is all setup for your location, you can launch Ekos from the tools menu. You will get another separate window with some configuration options.

- Configure Ekos as follows matching the equipment profile you setup in the INDI Web Manager:


- Make sure indi-web is running on the RP3. After you configure Ekos, you can click "Start INDI" then "Connect". This will present the driver setups for each of your attached devices. Go over all of these settings carefully to ensure they are to your liking.
- From here, you have full access of your equipment in Ekos. You can plate solve, autoguide, schedule, image, ect ect.

RECAP and FURTHER NOTES

- You have to start the INDI Web server each time you setup using Putty: indi-web -v
- You have to navigate to the web interface and start the INDI server each time: http://(Raspberry IP):8624
- From EKOS equipment profile choose "Start INDI" then "Connect" to get your equipment connected.

FURTHER COMMANDS:
- Your RP3 is now writing and shooting the images. If you are doing astrometry you want to make sure the system time is very accurate:
- Run: sudo apt-get ntp
- Run: sudo apt-get ntpdate
- To sync time: sudo ntpdate-debian or sudo ntpdate server 1.us.pool.ntp.org
- To view a date stamp run: date
- Turn off Wifi power managment for better wifi performance: sudo iwconfig wlan0 power off
- Config your RP3 OS options from Putty: raspi-config (I used this to set the timezone to UTC)
- Reboot RP3: sudo reboot
- Shutdown RP3: sudo shutdown or sudo shutdown now

My typical workflow is now:
- Setup telescope and polar align (I still do this with USB and SGP)
- Connect USB hub with equipment into the RP3
- Power up RP3
- Putty into RP3 from PC
- Start INDI Web with command: indi-web -v
- Sync RP3 with time server: sudo ntpdate-debian (should show you time correction)
- Verify time is accurate by loading a UTC website with UTC time, and then running command: date (compare times)
- Turn off wifi power management command: sudo iwconfig wlan0 power off
- Navigate to INDI-Web Manager in browser: http://192.168.1.5:8624
- Start the INDI server from there
- Open Kstars / Open Ekos
- Start INDI in Ekos, Connect to equipment
- Commence navigation in Kstars / imaging with Ekos

When done:
- Stop INDI in Ekos, Disconnect
- Stop INDI in Web Manager
- Stop Web Manager in Putty Window (Ctrl + C)
- Shutdown RP3: sudo shutdown

This may seem like a lot of work, but it has proven to be more than worth the effort. It is very reliable and the ability to run everything wireless from in the house is amazing.

Feel free to post questions in the comments below. I'll help out where I can.