diff --git a/dish_grpc_text.py b/dish_grpc_text.py index 77f6923..06fe99e 100644 --- a/dish_grpc_text.py +++ b/dish_grpc_text.py @@ -4,6 +4,11 @@ This script pulls the current status info and/or metrics computed from the history data and prints them to stdout either once or in a periodic loop. By default, it will print the results in CSV format. + +Note that using this script to record the alert_detail group mode as CSV +data is not recommended, because the number of alerts and their relative +order in the output can change with the dish software. Instead of using +the alert_detail mode, you can use the alerts bitmask in the status group. """ from datetime import datetime diff --git a/starlink_grpc.py b/starlink_grpc.py index 921c2f8..b7c02f2 100644 --- a/starlink_grpc.py +++ b/starlink_grpc.py @@ -107,14 +107,16 @@ their nature, but the field names are pretty self-explanatory. : **alert_motors_stuck** : Alert corresponding with bit 0 (bit mask 1) in *alerts*. -: **alert_thermal_throttle** : Alert corresponding with bit 1 (bit mask 2) in +: **alert_thermal_shutdown** : Alert corresponding with bit 1 (bit mask 2) in *alerts*. -: **alert_thermal_shutdown** : Alert corresponding with bit 2 (bit mask 4) in +: **alert_thermal_throttle** : Alert corresponding with bit 2 (bit mask 4) in *alerts*. : **alert_unexpected_location** : Alert corresponding with bit 3 (bit mask 8) in *alerts*. : **alert_mast_not_near_vertical** : Alert corresponding with bit 4 (bit mask 16) in *alerts*. +: **slow_ethernet_speeds** : Alert corresponding with bit 5 (bit mask 32) in + *alerts*. General history data -------------------- @@ -555,7 +557,8 @@ def status_data(context=None): for field in status.alerts.DESCRIPTOR.fields: value = getattr(status.alerts, field.name) alerts["alert_" + field.name] = value - alert_bits |= (1 if value else 0) << (field.index) + if field.number < 65: + alert_bits |= (1 if value else 0) << (field.number - 1) return { "id": status.device_info.id,