# How do I change my Node ID in PyUAVCAN?

**URL:** <https://forum.opencyphal.org/t/how-do-i-change-my-node-id-in-pyuavcan/1150>\
**Category:** PyCyphal\
**Created:** [March 5, 2021, 12:45pm UTC](https://forum.opencyphal.org/t/how-do-i-change-my-node-id-in-pyuavcan/1150 "2021-03-05T12:45:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mechatronikus](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/mechatronikus/32/834_2.png) [@Mechatronikus](https://forum.opencyphal.org/u/Mechatronikus)\
**Post date:** [March 5, 2021, 12:45pm UTC](https://forum.opencyphal.org/t/how-do-i-change-my-node-id-in-pyuavcan/1150/1 "2021-03-05T12:45:45Z")

</div>

Hi

I am using the pyuavcan demo application as a starting point for my own demo application to get familiar with how uavcan works.  
Currently I am trying to implement the Register-API, specifically the uavcan.node.id register.  
How do I change the Node ID in the demo application? I couldn’t find any function to change it. I looked through this forum, the pyuavcan documentation and the pyuavcan source code. But there is no mention of changing the node id. The only thing I found was that the demo app mentions that the node id is assigned statically here and most applications would need it configurable.

Any help or pointers would be appreciated. Thanks.

---

<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:** [March 6, 2021, 10:13pm UTC](https://forum.opencyphal.org/t/how-do-i-change-my-node-id-in-pyuavcan/1150/2 "2021-03-06T22:13:12Z")

</div>

We have a new demo that is not yet public but it should answer your questions better than the current one:

[https://pyuavcan--154.org.readthedocs.build/en/154/pages/demo.html](https://pyuavcan--154.org.readthedocs.build/en/154/pages/demo.html)

I expect it to go live in a few days assuming that the review is not going to take too long. To reproduce it locally, install the library and the Yakut tool directly from git:

```
pip install git+https://github.com/UAVCAN/yakut@orc

```

(this command will also pull in PyUAVCAN as a dependency)

---

<div class="post-metadata">

**Author:** ![Mechatronikus](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/mechatronikus/32/834_2.png) [@Mechatronikus](https://forum.opencyphal.org/u/Mechatronikus)\
**Post date:** [March 9, 2021, 10:21am UTC](https://forum.opencyphal.org/t/how-do-i-change-my-node-id-in-pyuavcan/1150/3 "2021-03-09T10:21:34Z")

</div>

Thank you for your response.  
I looked at the demo and it’s much clearer now.

I gave the demo a try but the node id wasn’t stored persistently. Writing a new node id via the register API worked and the new node id was in the response of the register call. But once i restarted the node it was back to the old id.  
Did I forget something?

---

<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:** [March 9, 2021, 6:33pm UTC](https://forum.opencyphal.org/t/how-do-i-change-my-node-id-in-pyuavcan/1150/4 "2021-03-09T18:33:50Z")

</div>

Sounds like you restored the original node-ID via environment variables at the second launch. Make sure to unset `UAVCAN __NODE__ ID`.

---

<div class="post-metadata">

**Author:** ![Mechatronikus](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/mechatronikus/32/834_2.png) [@Mechatronikus](https://forum.opencyphal.org/u/Mechatronikus)\
**Post date:** [March 10, 2021, 7:29am UTC](https://forum.opencyphal.org/t/how-do-i-change-my-node-id-in-pyuavcan/1150/5 "2021-03-10T07:29:21Z")

</div>

Yes. That was it. Thank you again.
