# Is there have a pyuavcan firmware update example?

**URL:** <https://forum.opencyphal.org/t/is-there-have-a-pyuavcan-firmware-update-example/1147>\
**Category:** PyCyphal\
**Created:** [March 3, 2021, 12:35pm UTC](https://forum.opencyphal.org/t/is-there-have-a-pyuavcan-firmware-update-example/1147 "2021-03-03T12:35:28Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cherish-forever](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/cherish-forever/32/802_2.png) [@Cherish-forever](https://forum.opencyphal.org/u/Cherish-forever)\
**Post date:** [March 3, 2021, 12:35pm UTC](https://forum.opencyphal.org/t/is-there-have-a-pyuavcan-firmware-update-example/1147/1 "2021-03-03T12:35:28Z")

</div>

I am writting upper computer of firmware updater base on pyuavcan protocol by libcanard v1.0.  
is there have a pyuavcan firmware update example?

---

<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 5, 2021, 11:59pm UTC](https://forum.opencyphal.org/t/is-there-have-a-pyuavcan-firmware-update-example/1147/2 "2021-03-05T23:59:24Z")

</div>

Now there is:

> <https://github.com/UAVCAN/yakut/pull/11>

Feedback welcome.

---

<div class="post-metadata">

**Author:** ![Cherish-forever](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/cherish-forever/32/802_2.png) [@Cherish-forever](https://forum.opencyphal.org/u/Cherish-forever)\
**Post date:** [March 8, 2021, 3:31am UTC](https://forum.opencyphal.org/t/is-there-have-a-pyuavcan-firmware-update-example/1147/3 "2021-03-08T03:31:49Z")

</div>

Thank you very much, I have some idea about file name:

NAME-HWMAJ.HWMIN-SWMAJ.SWMIN.VCS.CRC.app\*

1. The fields are terminated by a literal string “.app”, or it can be string “boot”? that means need update bootloader. sometimes we need consider update bootloader.

2. VSC can be used as build number? sometimes we use CI to generate release binaries, it`s easy to identify build number. and it is decimal.

---

<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 8, 2021, 3:35am UTC](https://forum.opencyphal.org/t/is-there-have-a-pyuavcan-firmware-update-example/1147/4 "2021-03-08T03:35:36Z")

</div>

> [@Cherish-forever](#):
>
> The fields are terminated by a literal string “.app”, or it can be string “boot”? that means need update bootloader. sometimes we need consider update bootloader.

You can append arbitrary data after the `.app`. The server will recognize, say, `com.example.product-1.0.app.boot` as a valid package despite the `.boot` at the end. For the server itself it makes no difference if the package is intended for the bootloader or whatever.

> [@Cherish-forever](#):
>
> VSC can be used as build number? sometimes we use CI to generate release binaries, it`s easy to identify build number. and it is decimal.

I can’t see why not, sure. It’s up to you. The server only checks this number to see if it is the same on the device and on the local package file; if there is a different and the other two version numbers are not older, it will trigger an update.

@davids5 fyi

---

<div class="post-metadata">

**Author:** ![Cherish-forever](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/cherish-forever/32/802_2.png) [@Cherish-forever](https://forum.opencyphal.org/u/Cherish-forever)\
**Post date:** [March 8, 2021, 12:09pm UTC](https://forum.opencyphal.org/t/is-there-have-a-pyuavcan-firmware-update-example/1147/5 "2021-03-08T12:09:12Z")

</div>

Issue:  
in yakut/cmd/compile.py line:180  
gpi = pyuavcan.dsdl.compile(

pyuavcan now use pyuavcan.dsdl.generate\_package

on branche bootloader

---

<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 8, 2021, 12:44pm UTC](https://forum.opencyphal.org/t/is-there-have-a-pyuavcan-firmware-update-example/1147/6 "2021-03-08T12:44:38Z")

</div>

You can’t use this branch with stable PyUAVCAN. You probably ran into a dependency management problem, try this:

```
pip uninstall -y pyuavcan pydsdl nunavut yakut
pip install git+https://github.com/UAVCAN/yakut@bootloader
```

---

<div class="post-metadata">

**Author:** ![Cherish-forever](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/cherish-forever/32/802_2.png) [@Cherish-forever](https://forum.opencyphal.org/u/Cherish-forever)\
**Post date:** [March 8, 2021, 12:56pm UTC](https://forum.opencyphal.org/t/is-there-have-a-pyuavcan-firmware-update-example/1147/7 "2021-03-08T12:56:59Z")

</div>

install\_requires =  
pyuavcan[transport\_udp,transport\_serial,transport\_can\_pythoncan] @ git+https://github.com/UAVCAN/pyuavcan@uavcan.file#egg=pyuavcan-1.2.0b5

[https://github.com/UAVCAN/pyuavcan@uavcan.file#egg=pyuavcan-1.2.0b5](https://github.com/UAVCAN/pyuavcan@uavcan.file#egg=pyuavcan-1.2.0b5)  
no found

---

<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 8, 2021, 12:57pm UTC](https://forum.opencyphal.org/t/is-there-have-a-pyuavcan-firmware-update-example/1147/8 "2021-03-08T12:57:39Z")

</div>

This is odd. Try this:

```
pip install git+https://github.com/UAVCAN/pyuavcan@uavcan.file
```

---

<div class="post-metadata">

**Author:** ![Cherish-forever](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/cherish-forever/32/802_2.png) [@Cherish-forever](https://forum.opencyphal.org/u/Cherish-forever)\
**Post date:** [March 8, 2021, 1:05pm UTC](https://forum.opencyphal.org/t/is-there-have-a-pyuavcan-firmware-update-example/1147/10 "2021-03-08T13:05:31Z")

</div>

Sorry, I have pyuavcan cache repository
