-
Notifications
You must be signed in to change notification settings - Fork 99
Useful grpcurl commands
This page lists a few grpcurl commands that may be of interest to users of this project.
The following commands perform equivalent operations to those in the dish_control.py script.
Reboot the dish:
grpcurl -plaintext -d {\"reboot\":{}} 192.168.100.1:9200 SpaceX.API.Device.Device/HandleStow the dish:
grpcurl -plaintext -d {\"dish_stow\":{}} 192.168.100.1:9200 SpaceX.API.Device.Device/HandleUnstow the dish:
grpcurl -plaintext -d {\"dish_stow\":{\"unstow\":true}} 192.168.100.1:9200 SpaceX.API.Device.Device/HandleGet GPS (Lat/Lon/Alt) data from the dish:
grpcurl -plaintext -emit-defaults -d '{"getLocation":{}}' 192.168.100.1:9200 SpaceX.API.Device.Device/HandleIf you want to poke around in the gRPC protocol the dish uses, you can list out what is available using the following commands.
To start at the top, you can list available services:
grpcurl -plaintext 192.168.100.1:9200 listthen list methods in the relevant service:
grpcurl -plaintext 192.168.100.1:9200 describe SpaceX.API.Device.DeviceThe relevant method is Handle, which takes a single request message and returns a specific response message depending on which request was issued.
To list possible requests:
grpcurl -plaintext 192.168.100.1:9200 describe SpaceX.API.Device.Requestand the respective responses:
grpcurl -plaintext 192.168.100.1:9200 describe SpaceX.API.Device.Responseand then you can go on to describe the individual requests or responses, for example:
grpcurl -plaintext 192.168.100.1:9200 describe SpaceX.API.Device.DishGetStatusResponseNote that not all of the requests are implemented on the dish. Some are specific to the router, some are just not implemented, and some fail with a "not authorized" error. Note also that even requests that are implemented may have individual fields that are not implemented, and thus will always return the default for the field's data type.