Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
FROM python:3.9
LABEL maintainer="neurocis <neurocis@neurocis.me>"
FROM python:3.12

RUN true && \
\
Expand All @@ -11,16 +10,16 @@ else \
fi; \
# Install python prerequisites
pip3 install --no-cache-dir $NOBIN_OPT \
croniter==2.0.5 pytz==2024.1 six==1.16.0 \
grpcio==1.62.2 \
influxdb==5.3.2 certifi==2024.2.2 charset-normalizer==3.3.2 idna==3.7 \
msgpack==1.0.8 requests==2.31.0 urllib3==2.2.1 \
influxdb-client==1.42.0 reactivex==4.0.4 \
paho-mqtt==2.0.0 \
croniter==6.0.0 pytz==2025.2 six==1.17.0 \
grpcio==1.76.0 \
influxdb==5.3.2 certifi==2026.1.4 charset-normalizer==3.4.4 idna==3.11 \
msgpack==1.1.2 requests==2.32.5 urllib3==2.6.3 \
influxdb-client==1.50.0 reactivex==4.1.0 \
paho-mqtt==2.1.0 \
pypng==0.20220715.0 \
python-dateutil==2.9.0 \
typing_extensions==4.11.0 \
yagrc==1.1.2 grpcio-reflection==1.62.2 protobuf==4.25.3
python-dateutil==2.9.0.post0 \
typing_extensions==4.15.0 \
yagrc==1.1.2 grpcio-reflection==1.76.0 protobuf==6.33.4

COPY dish_*.py loop_util.py starlink_*.py entrypoint.sh /app/
WORKDIR /app
Expand Down
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ For more information on what Starlink is, see [starlink.com](https://www.starlin

## Prerequisites / Installation

Most of the scripts here are [Python](https://www.python.org/) scripts. To use them, you will either need Python installed on your system or you can use the Docker image. If you use the Docker image, you can skip the rest of the prerequisites other than making sure the dish IP is reachable and Docker itself. For Linux systems, the python package from your distribution should be fine, as long as it is Python 3, version 3.7 or later.
Most of the scripts here are [Python](https://www.python.org/) scripts. To use them, you will either need Python installed on your system or you can use the Docker image. If you use the Docker image, you can skip the rest of the prerequisites other than making sure the dish IP is reachable and Docker (or Podman) itself. For Linux systems, the python package from your distribution should be fine, as long as it is Python 3, version 3.7 or later.

All the tools that pull data from the dish expect to be able to reach it at the dish's fixed IP address of 192.168.100.1, as do the Starlink [Android app](https://play.google.com/store/apps/details?id=com.starlink.mobile), [iOS app](https://apps.apple.com/us/app/starlink/id1537177988), and the browser app you can run directly from http://192.168.100.1. When using a router other than the one included with the Starlink installation kit, this usually requires some additional router configuration to make it work. That configuration is beyond the scope of this document, but if the Starlink app doesn't work on your home network, then neither will these scripts. That being said, you do not need the Starlink app installed to make use of these scripts. See [here](https://github.com/starlink-community/knowledge-base/wiki#using-your-own-router) for more detail on this.

Running the scripts within a [Docker](https://www.docker.com/) container requires Docker to be installed. Information about how to install that can be found at https://docs.docker.com/engine/install/. See below for how to pull the starlink-grpc-tools container image.
Running the scripts within a [Docker](https://www.docker.com/) container requires either Docker to be installed, or some alternative that can run Docker containers, such as [Podman](https://podman.io/). Information about how to install Docker can be found at https://docs.docker.com/engine/install/. Information about how to install Podman can be found at https://podman.io/get-started. See below for how to get the starlink-grpc-tools container image.

### Required Python modules (for non-Docker usage)

Expand Down Expand Up @@ -161,10 +161,12 @@ Possibly more simple examples to come, as the other scripts have started getting

`extract_protoset.py` can be used in place of `grpcurl` for recording the dish protocol information. See [the related Wiki article](https://github.com/sparky8512/starlink-grpc-tools/wiki/gRPC-Protocol-Modules) for more details.

## Running with Docker
## Running with Docker (or Podman)

The supported docker image for this project is the one hosted in the [GitHub Packages repository](https://github.com/sparky8512/starlink-grpc-tools/pkgs/container/starlink-grpc-tools). This is a multi-arch image built for `linux/amd64` (x64_64) and `linux/arm64` (aarch64) docker platforms.

The commands listed in this section assume you are using Docker. If you are using Podman instead, replace `docker` in the commands below with `podman`.

You can get the "latest" image with the following command:
```shell script
docker pull ghcr.io/sparky8512/starlink-grpc-tools
Expand All @@ -190,15 +192,15 @@ docker run --name=starlink-grpc-tools -e INFLUXDB_HOST={InfluxDB Hostname} \
-e INFLUXDB_DB={Pre-created DB name, starlinkstats works well} \
ghcr.io/sparky8512/starlink-grpc-tools
```
Note that for legacy reasons, this default command uses the InfluxDB 1.x client, and most people using InfluxDB will probably want the InfluxDB 2.x client.

When running in the background, you will probably want to specify a `-t` script option, to run in a loop, otherwise it will exit right away and leave an inactive container. For example:
Also, when running in the background, you will probably want to specify a `-t` script option, to run in a loop, otherwise it will exit right away and leave an inactive container. For example (using InfluxDB 2.x client):
```shell script
docker run -d -t --name=starlink-grpc-tools -e INFLUXDB_HOST={InfluxDB Hostname} \
-e INFLUXDB_PORT={Port, 8086 usually} \
-e INFLUXDB_USER={Optional, InfluxDB Username} \
-e INFLUXDB_PWD={Optional, InfluxDB Password} \
-e INFLUXDB_DB={Pre-created DB name, starlinkstats works well} \
ghcr.io/sparky8512/starlink-grpc-tools -v -t 60 status alert_detail
docker run -d -t --name=starlink-grpc-tools -e INFLUXDB_URL={URL of InfluxDB server} \
-e INFLUXDB_TOKEN={InfluxDB token value, if applicable} \
-e INFLUXDB_Bucket={InfluxDB bucket name defined in the DB} \
-e INFLUXDB_ORG={Organisation name defined in the DB} \
ghcr.io/sparky8512/starlink-grpc-tools dish_grpc_influx2.py -v -t 60 status alert_detail
```
The `-t` option to `docker run` will prevent Python from buffering the script's standard output and can be omitted if you don't care about seeing the verbose output in the container logs as soon as it is printed.

Expand Down
7 changes: 4 additions & 3 deletions dish_obstruction_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"""

import argparse
from datetime import datetime
from datetime import datetime, timezone
import logging
import os
import png
Expand Down Expand Up @@ -92,8 +92,9 @@ def pixel_bytes(row):
else:
now = int(time.time())
filename = opts.filename.replace("%u", str(now))
filename = filename.replace("%d",
datetime.utcfromtimestamp(now).strftime("%Y_%m_%d_%H_%M_%S"))
filename = filename.replace(
"%d",
datetime.fromtimestamp(now, timezone.utc).strftime("%Y_%m_%d_%H_%M_%S"))
filename = filename.replace("%s", str(opts.sequence))
out_file = open(filename, "wb")
if not snr_data or not snr_data[0]:
Expand Down