Add Starlink status lines for the physical gateway pane (closes #3)
check / check (push) Failing after 1s
check / check (push) Failing after 1s
When the non-VPN physical gateway is a Starlink dish, two lines are shown under that pane: state, uptime, obstruction and alert count; then pop-ping latency and drop rate with downlink/uplink throughput. They turn red when the dish is not connected or an alert is active. Detection is a TCP connect to the dish's fixed endpoint 192.168.100.1:9200, bound to the physical interface the same way the latency probes bind. Until a dish answers nothing is drawn and no status is fetched, so an absent dish adds no noise. Status comes from the dish's local get_status gRPC call. Detection and the fetch sit behind a small Client interface; the loop and the pure Render function are tested with a fake, no dish and no network. Model: opus-4-8
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
// A minimal slice of the Starlink dish's local gRPC API: just the one
|
||||
// unary RPC (SpaceX.API.Device.Device/Handle) and the get_status request
|
||||
// and dish status response, reduced to the handful of fields rtnetmon
|
||||
// shows. The proto package name and field numbers must match the dish
|
||||
// exactly for the wire format to line up; every other field the dish sends
|
||||
// is ignored as an unknown field.
|
||||
//
|
||||
// Field numbers, message names and the DishState enum are transcribed from
|
||||
// the community-maintained pre-generated bindings at
|
||||
// github.com/starlink-community/starlink-grpc-go, commit
|
||||
// 2e89f3d7e3092adecbcc04e9e003e61ed5f7c6a3 (get_status = 1004,
|
||||
// dish_get_status = 2004). They are not verified against a live dish here.
|
||||
//
|
||||
// Regenerate with:
|
||||
// protoc --go_out=. --go_opt=paths=source_relative \
|
||||
// --go-grpc_out=. --go-grpc_opt=paths=source_relative \
|
||||
// internal/starlink/pb/starlink.proto
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
package SpaceX.API.Device;
|
||||
|
||||
option go_package = "git.eeqj.de/sneak/rtnetmon/internal/starlink/pb;starlinkpb";
|
||||
|
||||
service Device {
|
||||
rpc Handle(Request) returns (Response);
|
||||
}
|
||||
|
||||
message Request {
|
||||
oneof request {
|
||||
GetStatusRequest get_status = 1004;
|
||||
}
|
||||
}
|
||||
|
||||
message GetStatusRequest {}
|
||||
|
||||
message Response {
|
||||
oneof response {
|
||||
DishGetStatusResponse dish_get_status = 2004;
|
||||
}
|
||||
}
|
||||
|
||||
message DishGetStatusResponse {
|
||||
DeviceState device_state = 2;
|
||||
DishObstructionStats obstruction_stats = 1004;
|
||||
DishAlerts alerts = 1005;
|
||||
DishState state = 1006;
|
||||
float pop_ping_drop_rate = 1003;
|
||||
float downlink_throughput_bps = 1007;
|
||||
float uplink_throughput_bps = 1008;
|
||||
float pop_ping_latency_ms = 1009;
|
||||
}
|
||||
|
||||
message DeviceState {
|
||||
uint64 uptime_s = 1;
|
||||
}
|
||||
|
||||
message DishObstructionStats {
|
||||
float fraction_obstructed = 1;
|
||||
}
|
||||
|
||||
message DishAlerts {
|
||||
bool motors_stuck = 1;
|
||||
bool thermal_shutdown = 2;
|
||||
bool thermal_throttle = 3;
|
||||
bool unexpected_location = 4;
|
||||
}
|
||||
|
||||
enum DishState {
|
||||
UNKNOWN = 0;
|
||||
CONNECTED = 1;
|
||||
SEARCHING = 2;
|
||||
BOOTING = 3;
|
||||
}
|
||||
Reference in New Issue
Block a user