Skip to content

Instantly share code, notes, and snippets.

@rickbassham
Last active November 10, 2021 20:16
Show Gist options
  • Save rickbassham/3033fb09890809db7a49aabd9efd11af to your computer and use it in GitHub Desktop.
Save rickbassham/3033fb09890809db7a49aabd9efd11af to your computer and use it in GitHub Desktop.
Astrobuntu Step-by-step

Instructions (works on amd64 and arm64)

A copy/paste guide to getting a full working astro-imaging computer running on Ubuntu 20.04 LTS. Installs latest stable versions of gpsd, KStars, INDI, OACapture, SkyChart, ASTAP, and Astrometry.net.

Install Ubuntu 20.04 (or Xubuntu, Kubuntu, or any other Ubuntu)

PC (amd64)

https://releases.ubuntu.com/20.04/

Raspberry Pi (arm64)

https://ubuntu.com/download/raspberry-pi

All commands below are to be run on the astro pc unless otherwise noted.

Set Hostname

Set Hostname (only needed on Raspberry Pi)

The raspberry pi ubuntu distro ships with a default hostname of ubuntu. You will probably want to change it. You will probably want to change astrobuntupi-dev to something more meaningful for you.

sudo hostnamectl set-hostname astrobuntupi-dev
sudo reboot

If you want to change the default ubuntu user name, now is the time.

Enable ssh with no password

Not required, but nice to have. Uses your public key to authenticate so you do not need to type your password when you ssh. Replace astrobuntupi-dev with the hostname you set above.

# from remote pc, not the astro-imaging pc
cat ~/.ssh/id_rsa.pub | ssh ubuntu@astrobuntupi-dev 'mkdir -p .ssh && cat >> .ssh/authorized_keys'

Install screen

screen will keep your ssh session running even if you get disconnected.

sudo apt install screen
# auto start screen when you ssh
echo 'if $(screen -ls | grep -q pts); then  screen -x; else screen -R; fi' >> ~/.bash_profile
exit

Configure WiFi

https://linuxconfig.org/ubuntu-20-04-connect-to-wifi-from-command-line

Set Your Timezone

sudo dpkg-reconfigure tzdata

Disable Automatic Upgrades

Ubuntu by default will automatically run apt upgrade periodically for new stable updates. To keep a good working configuration and prevent updates in the middle of imaging, run:

sudo dpkg-reconfigure unattended-upgrades

Install x11vnc

sudo apt install -y x11vnc
x11vnc -storepasswd

Start x11vnc on boot

cat << EOF | sudo tee /etc/systemd/system/x11vnc.service
[Unit]
Description=Start x11vnc at startup.
After=multi-user.target
[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -auth guess -forever -loop -repeat -rfbauth ${HOME}/.vnc/passwd -rfbport 5900 -shared -nodpms
[Install]
WantedBy=multi-user.target
EOF

sudo systemctl daemon-reload
sudo systemctl enable x11vnc.service
sudo systemctl start x11vnc
sudo systemctl status x11vnc
# press q to quit the status viewer

Astro software

# INDI, KStars, Astrometry.net, web browser, etc.

# if you want to live on the edge, you can use the nightly builds here
# sudo add-apt-repository ppa:mutlaqja/indinightly

# stable releases
sudo add-apt-repository -y ppa:mutlaqja/ppa
sudo apt install -y ekos-debugger gsc indi-full kstars-bleeding astrometry.net ser-player gpredict gpsd-clients breeze-icon-theme oxygen-icon-theme

# PHD2
sudo add-apt-repository -y ppa:pch/phd2
sudo apt install -y phd2 phdlogview

# Note that oacapture doesn't have an arm64 distro for 20.04 yet, so if you want it, you'll need to compile it. See http://www.openastroproject.org to get the source and installation instructions.
sudo apt install -y libhidapi-libusb0
wget http://www.openastroproject.org/wp-content/uploads/2020/12/ubuntu-20.04-amd64/oacapture_1.8.0-1_amd64.deb
sudo dpkg -i oacapture_1.8.0-1_amd64.deb

# ASTAP and supporting database
wget https://iweb.dl.sourceforge.net/project/astap-program/linux_installer/astap_$(dpkg --print-architecture).deb
wget https://cfhcable.dl.sourceforge.net/project/astap-program/star_databases/h17_star_database_mag17_astap.deb

sudo dpkg -i astap*.deb h17*.deb

# SkyChart and a stand-alone INDI client
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8B8B57C1AA716FC2
sudo sh -c "echo deb http://www.ap-i.net/apt stable main > /etc/apt/sources.list.d/skychart.list"
sudo apt update
sudo apt install -y skychart indistarter

# Stellarium
sudo add-apt-repository -y ppa:stellarium/stellarium-releases
sudo apt install -y stellarium

Astrometry.net Data

Download the info you need from http://data.astrometry.net/debian/

Astro Live Stacker

https://github.com/gehelem/als

Install

sudo apt update && sudo apt install -y git gcc python3-dev python3-venv libraw-dev
git clone https://github.com/gehelem/als.git
cd als

If you are running on a raspberry pi, run this:

patch < ci/rpi4_requirements.patch
./utils/venv_setup.sh
source ./venv/bin/activate
python3 setup.py develop

Run

cd als
source ./venv/bin/activate
als

Update

cd als
git pull

Remote GPSD

For my setup, I have a couple of mounts running, so I built a dedicated Raspberry Pi Zero W GPSD server. Since the indi-gpsd driver will only connect to localhost, this is a decent workaround that forwards any tcp connections for localhost:2947 to another machine.

cat << EOF | sudo tee /etc/default/remote-gpsd
# hostname that actually runs gpsd
REMOTE_HOST=pi-gps-ntp
EOF

cat << 'EOF' | sudo tee /etc/systemd/system/remote-gpsd.service
[Unit]
Description=Remote GPSD Service
After=network.target remote-gpsd.socket
Requires=remote-gpsd.socket

[Service]
EnvironmentFile=-/etc/default/remote-gpsd
ExecStart=/usr/lib/systemd/systemd-socket-proxyd ${REMOTE_HOST}:2947
PrivateTmp=yes

[Install]
WantedBy=default.target
EOF

cat << EOF | sudo tee /etc/systemd/system/remote-gpsd.socket
[Unit]
Description=Remote GPSD Socket
PartOf=remote-gpsd.service

[Socket]
ListenStream=127.0.0.1:2947

[Install]
WantedBy=sockets.target
EOF

sudo systemctl daemon-reload
sudo systemctl enable --now remote-gpsd.socket

Conclusion

You should now have a fully functional, open source astro-imaging pc, running a modern 64-bit OS, with a lightweight desktop environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment