# Port Configuration Error

**URL:** <https://forum.opencyphal.org/t/port-configuration-error/2114>\
**Category:** PyCyphal\
**Created:** [April 23, 2024, 3:23am UTC](https://forum.opencyphal.org/t/port-configuration-error/2114 "2024-04-23T03:23:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![akura](https://forum.opencyphal.org/letter_avatar_proxy/v4/letter/a/dfb087/32.png) [@akura](https://forum.opencyphal.org/u/akura)\
**Post date:** [April 23, 2024, 3:23am UTC](https://forum.opencyphal.org/t/port-configuration-error/2114/1 "2024-04-23T03:23:31Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![maksim.drachov](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/maksim.drachov/32/1577_2.png) [@maksim.drachov](https://forum.opencyphal.org/u/maksim.drachov)\
**Post date:** [April 24, 2024, 9:28am UTC](https://forum.opencyphal.org/t/port-configuration-error/2114/2 "2024-04-24T09:28:10Z")

</div>

![image](https://forum.opencyphal.org/uploads/default/original/2X/b/b4299ce1bf5d3b7cf247ea5f4aeb6a0ddacf4797.png)

Did you try this?

---

<div class="post-metadata">

**Author:** ![akura](https://forum.opencyphal.org/letter_avatar_proxy/v4/letter/a/dfb087/32.png) [@akura](https://forum.opencyphal.org/u/akura)\
**Post date:** [April 25, 2024, 8:16pm UTC](https://forum.opencyphal.org/t/port-configuration-error/2114/3 "2024-04-25T20:16:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![maksim.drachov](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/maksim.drachov/32/1577_2.png) [@maksim.drachov](https://forum.opencyphal.org/u/maksim.drachov)\
**Post date:** [May 2, 2024, 7:59am UTC](https://forum.opencyphal.org/t/port-configuration-error/2114/4 "2024-05-02T07:59:57Z")

</div>

Well, perhaps try following this, then:

> <https://github.com/maksimdrachov/opencyphal-tutorial/blob/main/docs/1-pc-demo/pycyphal.md>

---

<div class="post-metadata">

**Author:** ![pavel.kirienko](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/pavel.kirienko/32/9_2.png) [@pavel.kirienko](https://forum.opencyphal.org/u/pavel.kirienko)\
**Post date:** [May 6, 2024, 8:32am UTC](https://forum.opencyphal.org/t/port-configuration-error/2114/5 "2024-05-06T08:32:09Z")

</div>

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:

> [@Consider the implications of renaming the "uavcan" namespace into "cyphal"](https://forum.opencyphal.org/t/consider-the-implications-of-renaming-the-uavcan-namespace-into-cyphal/1975/9):
>
> There are two aspects: renaming the DSDL namespace itself and renaming the registers. The DSDL renaming can be done by copying all non-deprecated definitions from the uavcan namespace into cyphal with the appropriate changes to the documentation where the original namespace is referenced. All uavcan.\* definitions will be made @deprecated immediately, with their complete removal deadline set somewhere in the future. The standard register names will be updated from uavcan.\* to cyphal.\*. Nodes w…

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](https://github.com/OpenCyphal-Garage/cyraft).
