Port Configuration Error

Hello,

I am trying to run the demo application provided in PyCyphal specification. I have created the client application to send requests to both sirius_cyber_corp.PerformLinearLeastSquaresFit and
uavcan.node.ExecuteCommand_1. My client plant.py runs for the request to send an execute command and I am able to read the status of the response uavcan.node.ExecuteCommand.Response.1.3(status=0, output=‘’). But with the Linear Squares request, I get the following error:

File “/home/ghost/Documents/pycyphal-demo/plant.py”, line 45, in init
self.cln_least_sq = self.node.make_client(sirius_cyber_corp.PerformLinearLeastSquaresFit_1, 42, “least_squares”)
File “/home/ghost/.local/lib/python3.10/site-packages/pycyphal/application/_node.py”, line 180, in make_client
service_id=self._resolve_port(dtype, “cln”, port_name),
File “/home/ghost/.local/lib/python3.10/site-packages/pycyphal/application/_node.py”, line 202, in _resolve_port
return self._resolve_named_port(dtype, kind, name_or_id)
File “/home/ghost/.local/lib/python3.10/site-packages/pycyphal/application/_node.py”, line 243, in _resolve_named_port
raise PortNotConfiguredError(
pycyphal.application._node.PortNotConfiguredError: (‘uavcan.cln.least_squares.id’, “Cannot initialize cln-port ‘least_squares’ because the register does not define a valid port-ID and no fixed port-ID is defined forsirius_cyber_corp.PerformLinearLeastSquaresFit.1.0. Check if the environment variables are passed correctly or if the application is using the correct register file.”)

this is my script to set up the environment variables:
// Set UAVCAN environment variables
export UAVCAN__NODE__ID=43 # Set the local node-ID 42 (anonymous by default)
export UAVCAN__UDP__IFACE=127.0.0.1 # Use Cyphal/UDP transport via localhost
export UAVCAN__SRV__EXECUTE_COMMAND__ID=435
export UAVCAN__SRV__LEAST_SQUARES__ID=123
export UAVCAN__DIAGNOSTIC__SEVERITY=2 # This is optional to enable logging via Cyphal

Could anyone explain why I get the PortNotConfiguredError. I can post the plant.py code as well if required. Thank you!

Did you try this?

Yep, in the script to set the environmental variables:

this is my script to set up the environment variables:
// Set UAVCAN environment variables
export UAVCAN__NODE__ID=43 # Set the local node-ID 42 (anonymous by default)
export UAVCAN__UDP__IFACE=127.0.0.1 # Use Cyphal/UDP transport via localhost
export UAVCAN__SRV__EXECUTE_COMMAND__ID=435
export UAVCAN__SRV__LEAST_SQUARES__ID=123
export UAVCAN__DIAGNOSTIC__SEVERITY=2 # This is optional to enable logging via Cyphal

Well, perhaps try following this, then:

To use a client you need to export UAVCAN__CLN__.... This design where you need to specify the direction of the port explicitly is actually a deficient one. I am considering to discard it in favor of omnidirectional names when this change is implemented:

The scheme I am envisioning is a much simpler one: cyphal.sub.id.PORT_NAME for subjects (both subscriptions and publications), cyphal.rpc.id.PORT_NAME for RPC-services (both clients and servers). This will have certain positive implications on orchestration (where a multitude of topics needs to be configured at once in a config file) and for the eventual named topic support.