Skip to content

Build Instruction: Mimic Software Setup Instructions

ISS Mimic Project edited this page Nov 6, 2023 · 23 revisions

Requirements

Hardware

Other hardware than listed below may be used, but only the following hardware is supported and tested:

  • Raspberry Pi 4 (we use the 4GB option, but that's probably not required)
  • 8GB or larger Class 10 MicroSD Card
  • Raspberry Pi Official 7" Touchscreen
  • Peripherals (Keyboard, Mouse, USB cables for power)
  • Touchscreen Case - optional, but really nice to have
  • USB Battery Pack with at least 2A output - for portable setups - optional

Software (this tutorial covers installing all of this, and it takes about half an hour ish)

  • Python 3.9 (installed on Raspbian by default)
  • Various python libraries
  • Kivy 2.1 (Python graphical library)

Option 1 - Setup the project from scratch using our setup script (easiest method) or manually entering commands

Some Basics

It's really best to try these steps on a fresh Raspbian install.

If you are new to Unix-like operating systems it might be useful to familiarize yourself with basic Unix commands.

Operating System Installation

Follow these instructions from the Raspberry Pi Foundation to install Raspbian. If you use the Imager on their site, you don't need to download the Raspbian image separately. It takes about 15 minutes to do this but will vary depending on your hardware.

Setting up the Pi for the Mimic project

The setup commands are all done from a terminal. Once you have powered on the pi and it is at the desktop screen, open a terminal window by selecting the terminal shortcut (Menu -> Accessories -> Terminal) or Ctrl-Alt-T.

Setup script

If you want to use our setup script, you can avoid having to run most of the setup steps yourself manually. It will even set up Kivy for you. - Please let us know if this script doesn't work.

**If you want to use our script, first clone the repo, then enter the Mimic directory and simply run the setup.py script. If the setup fails, you can try re-running the script or manually running the command that failed"

    git clone --depth 1 https://github.com/ISS-Mimic/Mimic.git/ 
    cd ~/Mimic
    python setup.py

That should be it! The setup script will take a few minutes at least, but once it finished (with no errors) everything should be properly setup and mimic should be ready to run - skip to step

Manual Install

This assumes you are starting from a fresh build of the latest rasbian OS, these steps may not work if you are using an older build.

1.) Update existing packages

Open a terminal window and enter these commands:

    sudo apt update
    sudo apt -y upgrade
    sudo reboot

2.) Clone our git repository.

    cd ~
    git clone https://github.com/ISS-Mimic/Mimic.git/

3.) Install vim and Sqlite3

    sudo apt -y install vim sqlite3

4.) Install Kivy

This should be the only command needed to install kivy but it changes occasionally:

python -m pip install "kivy[base,media]"

Once Kivy is installed, you need to run Kivy so that it finishes its setup. You can run one of the example projects mentioned on their page. Or you can just import it into python once to make it work.

python -c "import kivy"

Once you've run Kivy, you need to edit the Kivy config file it created to make it look nice on the Pi Touchscreen. Replace the Kivy config file (~/.kivy/config.ini) with the one we have (or copy the changes listed) Kivy Config File. As explained on their page, you need to make sure these 3 lines are in the [input] section:

5.) Install stuff to make kivy work

sudo apt-get install python3-sdl2

6.) Install Python libraries

    pip install ephem pytz matplotlib pyudev lightstreamer-client-lib 
    pip install -U numpy

autobahn and maybe twisted cause problems with cryptography module autobahn twisted

7.) Install python3-mpltoolkits.basemap

    sudo apt -y install python3-mpltoolkits.basemap
    sudo apt -y install libatlas-base-dev

Now Mimic is ready to run!

The Mimic program interfaces with the server that receives the actual ISS telemetry. Whenever a telemetry value is updated, iss_telemetry.py updates the SQLite database (iss_telemetry.db) with the new value. The Python GUI.py app retrieves these values from the database and displays them to the user.

You should frequently "pull" the latest version of the Mimic repository to make sure you have the latest version of the code

    cd ~/Mimic/Pi/
    git pull

Launch GUI.py

Now is finally the time to launch the main program! From ~/Mimic/Pi, run the following:

    cd ~/Mimic/Pi/
    python GUI.py

Option 2 - Pre-configured Raspberry Pi Mimic Image

You can download our pre-configured raspi image here.

This is easy to install, but it gets out of date easily and might not work on all Pis. We make no guarantees that the image will work, the setup.py script in Option 1 is kept up to date however.

The Image should be installed on a 8GB or larger Class 10 MicroSD Card.

Using an SD card etching program (the Raspberry Pi Imager is great), you can either select our pre-configured image or plan to install their default Raspbian image and set things up from scratch (details below). Select which SD card to install it on. Once it has finished writing to the SD card, you can eject it and then plug it into the Pi. If you used our pre-configured image, everything should be all setup once this is done! It takes about 15 minutes to do this but will vary depending on your hardware.