Skip to content

Commit

Permalink
Documentation and module requirements updates
Browse files Browse the repository at this point in the history
Docs and new dependencies for dish_check_update.py

Update all pinned pip package versions to latest available in Docker image.
  • Loading branch information
sparky8512 committed Apr 21, 2024
1 parent 792b0ab commit d8c8a22
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 10 deletions.
17 changes: 9 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ else \
fi; \
# Install python prerequisites
pip3 install --no-cache-dir $NOBIN_OPT \
grpcio==1.50.0 six==1.16.0 \
influxdb==5.3.1 certifi==2022.9.24 charset-normalizer==2.1.1 idna==3.4 \
msgpack==1.0.4 python-dateutil==2.8.2 pytz==2022.6 requests==2.28.1 \
urllib3==1.26.12 \
influxdb-client==1.34.0 reactivex==4.0.4 \
paho-mqtt==1.6.1 \
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 \
pypng==0.20220715.0 \
typing_extensions==4.4.0 \
yagrc==1.1.1 grpcio-reflection==1.50.0 protobuf==4.21.9
python-dateutil==2.9.0 \
typing_extensions==4.11.0 \
yagrc==1.1.2 grpcio-reflection==1.62.2 protobuf==4.25.3

COPY dish_*.py starlink_*.py entrypoint.sh /app/
WORKDIR /app
Expand Down
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,25 @@ These operations can also be done using `grpcurl`, thus avoiding the need to use
python3 dish_control.py set_sleep -h
```

#### Firmware update checking and triggering

`dish_check_update.py` checks for pending dish software updates, and can optionally trigger the update by rebooting the dish if it detects one. This can be useful if your dish normally does its automatic software install reboots at a time you don't want. To simplify this use case, this script supports a cron-like scheduling option, in addition to the `-t` periodic interval loop scheduling that most of the other scripts support.

To use the cron-like scheduler, add the `-c` command line option to specify the schedule, using the same string format cron uses for its crontab entries (`minute` `hour` `day_of_month` `month` `day_of_week`). By default, it will use system local timezone, including DST adjustment. To use a different timezone, use the `-m` option. For example, to check and trigger updates at 2:30am local time daily:
```shell script
python3 dish_check_update.py -c "30 2 * * *" --install
```
or same for specific timezone:
```shell script
python3 dish_check_update.py -c "30 2 * * *" -m "America/Los_Angeles" --install
```
or to immediately check without triggering install, you can do:
```shell script
python3 dish_check_update.py -v
```

Run with the `-h` command line option for full usage details. For more information on the cron schedule string format or timezone names, see the [croniter](https://github.com/kiorky/croniter) or [dateutil](https://github.com/dateutil/dateutil) project documentation, respectively.

### The JSON parser script

`dish_json_text.py` operates on a JSON format data representation of the protocol buffer messages, such as that output by [gRPCurl](https://github.com/fullstorydev/grpcurl). The command lines below assume `grpcurl` is installed in the runtime PATH. If that's not the case, just substitute in the full path to the command.
Expand Down
1 change: 0 additions & 1 deletion loop_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import signal
import time


# Max time to sleep when using non-monotonic time. This helps protect against
# oversleeping as the result of large clock adjustments.
MAX_SLEEP = 3600.0
Expand Down
4 changes: 3 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ paho-mqtt>=1.5.1
influxdb>=5.3.1
influxdb_client>=1.23.0
pypng>=0.0.20
typing-extensions>=4.3.0
typing-extensions>=4.3.0
croniter>=1.0.1
python-dateutil>=2.7.0

0 comments on commit d8c8a22

Please sign in to comment.