Difference between revisions of "Raspberry Pi"

From SatNOGS Wiki
(Show how to install satnogs-client from fork for testing)
 
(48 intermediate revisions by 15 users not shown)
Line 1: Line 1:
{{Message|This page assumes you have an account and a ground station registered on either network.satnogs.org or network-dev.satnogs.org. Make note of your station ID and API Key.}}
+
[[File:B3342fcc865731d69e0c9d7a8b1abb887185bc13 1 531x500.jpg|alt=Libre Space Foundation Raspberry Pi Case|thumb|Libre Space Foundation Raspberry Pi Case, [https://www.thingiverse.com/thing:3233687 on thingiverse]]]
  
= Intro =
+
==Introduction==
  
The Raspberry Pi 3 is the reference platform for SatNOGS. You can try using various distributions for this (eg. Arch, Fedora), but the one we suggest is our custom image based on latest Raspbian.
+
The Raspberry Pi (version 3 and 4) is the reference platform for SatNOGS (see our [[SatNOGS Client Ansible|Ansible guide]] to install SatNOGS on other Linux machines). You can try using various distributions for this (eg. Debian/Armbian, Arch, Fedora), but the one we suggest is our custom image based on latest Raspbian.
  
= Fedora =
+
{{Message|This page assumes you have an account and a ground station registered on either network.satnogs.org or network-dev.satnogs.org. Make note of your station ID and API Key.}}
  
Instructions for installing on Fedora can be found [[Fedora_Installation|here]].
+
==Download==
 +
'''<big>Raspbian SatNOGS Image:</big> [https://gitlab.com/librespacefoundation/satnogs/satnogs-pi-gen/-/jobs/artifacts/2020100800/download?job=release <big>artifacts.zip</big>] '''  (Release: 2020100800)
  
= Raspbian =
+
Download the latest Raspbian SatNOGS Image from above (or via the "Download" icon on the right side of the [https://gitlab.com/librespacefoundation/satnogs/satnogs-pi-gen/tags latest tag page on GitLab]). This image has the SatNOGS setup script installed, the SSH server enabled and all required packages preinstalled. You will get an <code>artifacts.zip</code> file with the following content:
  
== Download ==
+
*A Zipped image file
 +
*An Image info file
 +
*A SHA256 checksum file
  
You can download the latest Raspbian SatNOGS image following the links from the [https://gitlab.com/librespacefoundation/satnogs/satnogs-pi-gen/tags latest tag on GitLab].
+
===Data integrity verification===
  
=== Artifacts list ===
+
You should verify the data integrity of the artifacts by comparing the SHA256 checksums. On Linux, run <code>sha256sum -c sha256sums</code> in the directory where the artifacts are downloaded and unzipped.
 
 
The current artifacts list consists of:
 
* A Zipped image file
 
* An Image info file
 
* A SHA256 checksums file
 
 
 
== Data integrity verification ==
 
 
 
You should verify the data integrity of the artifacts by checking the SHA256 checksums. On Linux, run <code>sha256sum -c sha256sums</code> in the directory where the artifacts are downloaded
 
  
 
Example:
 
Example:
 
<pre>
 
<pre>
 
$ sha256sum -c sha256sums  
 
$ sha256sum -c sha256sums  
2017-09-29-Raspbian-SatNOGS-master-lite.info: OK
+
2020-10-08-Raspbian-SatNOGS-master-lite.info: OK
image_2017-09-29-Raspbian-SatNOGS-master-lite.zip: OK
+
image_2020-10-08-Raspbian-SatNOGS-master-lite.zip: OK
 
</pre>
 
</pre>
  
== Flashing and Setup ==
+
==Flashing==
 
 
 
[https://www.raspberrypi.org/documentation/installation/installing-images/README.md Follow the usual Raspbian flashing instructions], and boot your Raspberry Pi.
 
[https://www.raspberrypi.org/documentation/installation/installing-images/README.md Follow the usual Raspbian flashing instructions], and boot your Raspberry Pi.
  
Once your Raspberry Pi is booted, log in with username "pi" password "raspberry" and run:
+
==Getting console access==
<pre>
+
You can log in the Raspberry Pi by connecting it to a keyboard and monitor or through network via an SSH connection.
sudo raspi-config
 
</pre>
 
 
 
You will want to be sure to do the following:
 
 
 
* Set a strong, unique password
 
* Change localization settings:
 
** by default the rpi locale is configured for EN-GB, change as appropriate (ie: to EN_US.UTF-8)
 
** set timezone (we recommend UTC so your logs match the times in Network)
 
** set keyboard layout, again this is defaulting to a UK layout
 
** set wifi country
 
* Finish and reboot
 
 
 
Next, run
 
<pre>
 
sudo apt-get update && sudo apt-get -y upgrade
 
</pre>
 
 
 
== Networking ==
 
 
 
If you are using wired Ethernet you should get connectivity right away. If you are using wireless then see [https://www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md this doc for network configuration instructions].
 
 
 
== Setup ==
 
 
 
SSH to the Raspberry Pi with user "pi" and password "raspberry" (no quotes).
 
 
 
# Run "sudo satnogs-setup"
 
# Select "Update" to update the configuration tool
 
# Set basic configuration
 
# Select "Apply" and the Raspberry Pi will configure itself; this may take some time
 
# Select "Back" to exit
 
 
 
* Note: you can always reconfigure the software by running "sudo satnogs-setup" again.
 
 
 
=== Basic setup ===
 
 
 
* '''SATNOGS_API_TOKEN''':  The API token assigned to your ground station on the SatNOGS Network website.
 
 
 
* '''SATNOGS_NETWORK_API_URL''':  The API for the SatNOGS network site.  If you're working on the stage environment, this is https://network-dev.satnogs.org/api/; if you're working on the prod environment, this is https://network.satnogs.org/api/.
 
 
 
* '''SATNOGS_RX_DEVICE''':  If you are using an RTL-SDR, this is <code>rtlsdr</code>.  Other devices supported by gr-satnogs include <code>usrpb200</code>, <code>usrp2</code>, <code>airspy</code> or <code>hackrf</code>; a complete list can be found [https://gitlab.com/librespacefoundation/satnogs/gr-satnogs/blob/master/apps/flowgraphs/satellites/README.md here].
 
 
 
* '''SATNOTS_STATION_ELEV''':  The elevation of your ground station in metres.
 
 
 
* '''SATNOTS_STATION_ID''':  The ID assigned to your station in the SatNOGS network site (either stage or prod).
 
 
 
* '''SATNOTS_STATION_LAT''': The latitude of your station.  North is positive, south is negative.
 
 
 
* '''SATNOTS_STATION_LONG''': The longitude of your station.  East is positive, west is negative.
 
  
* '''HAMLIB_UTILS_ROT_ENABLED''':  Whether or not to enable the Hamlibs rotator daemon.  Rotctld is a software daemon that provides a network server to control a rotator on a serial port.  If you don't have a rotator (like the [https://wiki.satnogs.org/No_rotator No rotator setup]), enter <code>False</code>.
+
===Keyboard and monitor===
 +
Once your Raspberry Pi is booted, log in with username "'''pi'''" password "'''raspberry'''".
  
* '''HAMLIB_UTILS_ROT_OPTS''':  Options for rotcld. For a yaesu rotator, use <code>-m 601 -r /dev/ttyACM0 -s 9600 -T 0.0.0.0</code>
+
===Ethernet===
 +
If you are using wired Ethernet you should get connectivity right away. You just need to find the IP address of Raspberry Pi (e.g. in your router management interface). Log in with SSH using username "'''pi'''" password "'''raspberry'''", for example:
 +
  $ ssh pi@192.168.1.2
 +
If your network supports [[wikipedia:Zero-configuration_networking|<code>zeroconf</code>]], then you can use the hostname of your Pi:
 +
$ ssh pi@raspberrypi.local
  
=== Advanced Setup ===
+
===Pre-boot wireless configuration===
 +
If neither keyboard/monitor, nor a wired Ethernet are available, you can set up a WiFi connection before boot by mounting the boot partition of the flashed SD card and editing files directly. Note your OS may mount boot partition in a different location. [https://raspberrypi.stackexchange.com/questions/10251/prepare-sd-card-for-wifi-on-headless-pi#comment98121_57023 Windows users have line ending problems]. Suggested actions:
  
* '''SATNOGS_CLIENT_URL''': If you to try a development version of satnogs-client, you can change the URL here. The URL needs to be in [https://pip.pypa.io/en/stable/reference/pip_install PIP format].  Here are some examples:
+
  $ $EDITOR /media/Raspbian_SatNOGS-boot/wpa_supplicant.conf
** git+https://gitlab.com/librespacefoundation/satnogs/satnogs-client.git@0 -- the '0' branch (the current development version) of satnogs-client
 
** git+https://gitlab.com/jdoe/satnogs-client.git@new-feature -- the 'new-feature' branch of jdoe's fork of satnogs-client
 
  
{{Message|Changing this setting is ''not'' recommended unless you're developing satnogs-client itself.}}
+
contents: (note key_mgmt options include NONE, WPA-PSK, WPA-EAP)
  
== Updating ==
+
    ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
 +
    update_config=1
 +
    country=US
 +
   
 +
    network={
 +
        ssid="NETWORK_NAME"
 +
        psk="password"
 +
        key_mgmt=WPA-PSK
 +
    }
  
To update SatNOGS software, re-run <code>sudo satnogs-setup</code>. Select "Update" to pull the latest Ansible playbook and then "Apply" to apply any updates.
+
==Configuration==
 
 
Raspbian packages can be updated using the normal APT updating methods (e.g. <code>apt-get upgrade</code> or <code>aptitude</code>).
 
 
 
WARNING: An update can potentially interrupt a running observation!
 
 
 
== Testing ==
 
 
 
To see if satnogs-client has started successfully, check the logs with journalctl:
 
  
 +
===Raspberry Pi Setup===
 +
Once your Raspberry Pi is booted, log in with username "'''pi'''" password "'''raspberry'''" and run:
 
<pre>
 
<pre>
journalctl -u satnogs-client.service
+
$ sudo raspi-config
 
</pre>
 
</pre>
  
You should see entries running approximately once per minute that look like this:
+
You will want to be sure to do the following:
 
 
<pre>
 
Oct 01 23:02:13 raspberrypi satnogs-client[6695]:  * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
 
Oct 01 23:02:14 raspberrypi satnogs-client[6695]: 2017-10-01 23:02:14,466 - satnogsclient - INFO - [LD] Downlink thread waiting for first downlink packet
 
Oct 01 23:03:14 raspberrypi satnogs-client[6695]: 2017-10-01 23:03:14,450 - apscheduler.executors.default - INFO - Running job "get_jobs (trigger: interval[0:01:00], next run at: 2017-10-01 23:03:14 UTC)" (scheduled at 2017-10-01 23:03:14.423393+00:00)
 
Oct 01 23:03:47 raspberrypi satnogs-client[6695]: 2017-10-01 23:03:47,324 - satnogsclient - DEBUG - Opening TCP socket: 127.0.0.1:5011
 
Oct 01 23:03:47 raspberrypi satnogs-client[6695]: 2017-10-01 23:03:47,325 - satnogsclient - DEBUG - Sending message: []
 
Oct 01 23:03:47 raspberrypi satnogs-client[6695]: 2017-10-01 23:03:47,327 - apscheduler.executors.default - INFO - Job "get_jobs (trigger: interval[0:01:00], next run at: 2017-10-01 23:04:14 UTC)" executed successfully
 
Oct 01 23:04:14 raspberrypi satnogs-client[6695]: 2017-10-01 23:04:14,453 - apscheduler.executors.default - INFO - Running job "get_jobs (trigger: interval[0:01:00], next run at: 2017-10-01 23:04:14 UTC)" (scheduled at 2017-10-01 23:04:14.423393+00:00)
 
Oct 01 23:04:14 raspberrypi satnogs-client[6695]: 2017-10-01 23:04:14,484 - apscheduler.executors.default - INFO - Running job "post_data (trigger: interval[0:02:00], next run at: 2017-10-01 23:04:14 UTC)" (scheduled at 2017-10-01 23:04:14.436367+00:00)
 
Oct 01 23:04:14 raspberrypi satnogs-client[6695]: 2017-10-01 23:04:14,489 - apscheduler.executors.default - INFO - Job "post_data (trigger: interval[0:02:00], next run at: 2017-10-01 23:04:14 UTC)" executed successfully
 
Oct 01 23:04:15 raspberrypi satnogs-client[6695]: 2017-10-01 23:04:15,627 - satnogsclient - DEBUG - Opening TCP socket: 127.0.0.1:5011
 
Oct 01 23:04:15 raspberrypi satnogs-client[6695]: 2017-10-01 23:04:15,628 - satnogsclient - DEBUG - Sending message: []
 
Oct 01 23:04:15 raspberrypi satnogs-client[6695]: 2017-10-01 23:04:15,629 - apscheduler.executors.default - INFO - Job "get_jobs (trigger: interval[0:01:00], next run at: 2017-10-01 23:05:14 UTC)" executed successfully
 
</pre>
 
  
You can also try visiting satnog-client's web interface. In your browser, go to '''<nowiki>http://(ip address of your raspberry pi):5000</nowiki>'''. You should see something like this:
+
*Set a strong, unique password
 +
*Change localization settings:
 +
**by default the rpi locale is configured for EN-GB, change as appropriate (ie: to EN_US.UTF-8)
 +
**set timezone (we recommend UTC so your logs match the times in Network; UTC is under the 'none of the above' submenu)
 +
**set keyboard layout, again this is defaulting to a UK layout
 +
**set wifi country
 +
**expand filesystem (under the Advanced menu)
 +
*Configure network or WiFi (see [https://www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md this doc for network configuration instructions])
 +
*Finish and reboot
  
[[File:SatNOGS_client_screenshot.png|400px|thumb|center|SatNOGS client web page]]
+
===SatNOGS Setup===
 +
SSH to the Raspberry Pi with user "'''pi'''" and your new password.
  
 +
Follow [[SatNOGS Client Setup]] instructions to configure the system.
  
If you see that, great -- you're ready to [[Operation|schedule your first observation]]! If not, check out the [[Troubleshooting]] page.
+
[[Category:Build]]
 +
[[Category:Software]]

Latest revision as of 10:20, 18 October 2020

Libre Space Foundation Raspberry Pi Case
Libre Space Foundation Raspberry Pi Case, on thingiverse

Introduction

The Raspberry Pi (version 3 and 4) is the reference platform for SatNOGS (see our Ansible guide to install SatNOGS on other Linux machines). You can try using various distributions for this (eg. Debian/Armbian, Arch, Fedora), but the one we suggest is our custom image based on latest Raspbian.

Idea.png
This page assumes you have an account and a ground station registered on either network.satnogs.org or network-dev.satnogs.org. Make note of your station ID and API Key.

Download

Raspbian SatNOGS Image: artifacts.zip (Release: 2020100800)

Download the latest Raspbian SatNOGS Image from above (or via the "Download" icon on the right side of the latest tag page on GitLab). This image has the SatNOGS setup script installed, the SSH server enabled and all required packages preinstalled. You will get an artifacts.zip file with the following content:

  • A Zipped image file
  • An Image info file
  • A SHA256 checksum file

Data integrity verification

You should verify the data integrity of the artifacts by comparing the SHA256 checksums. On Linux, run sha256sum -c sha256sums in the directory where the artifacts are downloaded and unzipped.

Example:

$ sha256sum -c sha256sums 
2020-10-08-Raspbian-SatNOGS-master-lite.info: OK
image_2020-10-08-Raspbian-SatNOGS-master-lite.zip: OK

Flashing

Follow the usual Raspbian flashing instructions, and boot your Raspberry Pi.

Getting console access

You can log in the Raspberry Pi by connecting it to a keyboard and monitor or through network via an SSH connection.

Keyboard and monitor

Once your Raspberry Pi is booted, log in with username "pi" password "raspberry".

Ethernet

If you are using wired Ethernet you should get connectivity right away. You just need to find the IP address of Raspberry Pi (e.g. in your router management interface). Log in with SSH using username "pi" password "raspberry", for example:

$ ssh pi@192.168.1.2

If your network supports zeroconf, then you can use the hostname of your Pi:

$ ssh pi@raspberrypi.local

Pre-boot wireless configuration

If neither keyboard/monitor, nor a wired Ethernet are available, you can set up a WiFi connection before boot by mounting the boot partition of the flashed SD card and editing files directly. Note your OS may mount boot partition in a different location. Windows users have line ending problems. Suggested actions:

$ $EDITOR /media/Raspbian_SatNOGS-boot/wpa_supplicant.conf

contents: (note key_mgmt options include NONE, WPA-PSK, WPA-EAP)

   ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
   update_config=1
   country=US
   
   network={
       ssid="NETWORK_NAME"
       psk="password"
       key_mgmt=WPA-PSK
   }

Configuration

Raspberry Pi Setup

Once your Raspberry Pi is booted, log in with username "pi" password "raspberry" and run:

$ sudo raspi-config

You will want to be sure to do the following:

  • Set a strong, unique password
  • Change localization settings:
    • by default the rpi locale is configured for EN-GB, change as appropriate (ie: to EN_US.UTF-8)
    • set timezone (we recommend UTC so your logs match the times in Network; UTC is under the 'none of the above' submenu)
    • set keyboard layout, again this is defaulting to a UK layout
    • set wifi country
    • expand filesystem (under the Advanced menu)
  • Configure network or WiFi (see this doc for network configuration instructions)
  • Finish and reboot

SatNOGS Setup

SSH to the Raspberry Pi with user "pi" and your new password.

Follow SatNOGS Client Setup instructions to configure the system.