Issue running service_counter and service_client examples

Hi there,

I’m attempting to run both the service_counter and service_client examples and am encountering issues with the second terminal (step 2) for both. The steps I’ve followed for setting up my environment were:

  • Followed the instructions for installing from source
  • Navigated to py/examples/service_client (w/ venv activated)
  • Started the service with python --service-config config.json, leading to the expected output (Sending /health…)
  • Created a second terminal, reactivating the venv and navigating to the same directory.
  • Attempted to run the client with python --service-config config.json --a 1 --b 2

However, the second terminal hangs after running that command. I’ve replaced the “host”: localhost with the appropriate Tailscale address for the brain for both examples’ config files.

Please let me know if you have any insights as to why this may not be working or if I’ve missed something with the environment setup.

Hey @larslundqvist ,

The second terminal printing nothing indicates that the target service is not publishing anything, which tells me that either the service in not properly setup or you are looking in the wrong place.

In you specific case, I believe the problem is that, when you start the service, it starts on your local machine, not on the robot. If you take a look at the example, you will see that EventServiceGrpc calls grpc.aio.server() which starts a local server. Looks like the confusion here is that we are using the same config.json on and even though service don’t use the host parameter. I believe we can make a better job on making that clear on the example page, so, thank you for pinpointing that!

So, basically, try to ssh’in on the robot, start the service, and them use to subscribe to it from within the robot listening on localhost or from your local machine listening on your machines Tailscale IP address.