# Uavcan and raspberry pi

**URL:** <https://forum.opencyphal.org/t/uavcan-and-raspberry-pi/592>\
**Category:** PyCyphal\
**Created:** [August 12, 2019, 5:39pm UTC](https://forum.opencyphal.org/t/uavcan-and-raspberry-pi/592 "2019-08-12T17:39:39Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Malis](https://forum.opencyphal.org/letter_avatar_proxy/v4/letter/m/9e8a1a/32.png) [@Malis](https://forum.opencyphal.org/u/Malis)\
**Post date:** [August 12, 2019, 5:39pm UTC](https://forum.opencyphal.org/t/uavcan-and-raspberry-pi/592/1 "2019-08-12T17:39:39Z")

</div>

Hi,

I was trying to set up my raspberry pi 3b to communicate to a device via pyuavcan.  
Is there any tutorial on how to set it up and smoke testing?

Best regards,

Malis

---

<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:** [August 12, 2019, 7:50pm UTC](https://forum.opencyphal.org/t/uavcan-and-raspberry-pi/592/2 "2019-08-12T19:50:33Z")

</div>

This should be good to start with:

[https://pyuavcan.readthedocs.io](https://pyuavcan.readthedocs.io)

---

<div class="post-metadata">

**Author:** ![Malis](https://forum.opencyphal.org/letter_avatar_proxy/v4/letter/m/9e8a1a/32.png) [@Malis](https://forum.opencyphal.org/u/Malis)\
**Post date:** [August 19, 2019, 2:28pm UTC](https://forum.opencyphal.org/t/uavcan-and-raspberry-pi/592/3 "2019-08-19T14:28:47Z")

</div>

Hi Pavel,

Thanks a lot for your reply.  
Here is the error I get when I try to run the create node basic usage script.

> **[Open technology for real-time communications in cyber-physical systems](https://opencyphal.org/)**
>
> Cyphal is an open technology for real-time intravehicular distributed computing and communication
> based on modern networking standards (Ethernet, CAN FD, etc.).
> It is created to address the challenge of on-board deterministic computing and...

(I apologize in advance, I m a beginner)

> Traceback (most recent call last):  
> File “create\_no.py”, line 8, in   
> node\_info.hardware\_version.unique\_id = b’12345’ # Setting first 5 bytes; rest will be kept zero  
> File “/home/pi/.local/lib/python2.7/site-packages/uavcan/transport.py”, line 589, in **setattr**  
> raise AttributeError(‘Array field could not be constructed from the provided value’, ex)  
> AttributeError: (u’Array field could not be constructed from the provided value’, ValueError(u’encode() can be used only with string-like arrays’,))

Any idea?

Side question, I’m trying to close and retrieve an exiting node, but cannot find a way to do it because I get:

> ```
> closing(uavcan.driver.make_node('can0', bitrate=500000))
> 
> ```
> 
> NameError: name ‘uavcan’ is not defined

if I run

> import uavcan  
> from contextlib import closing  
> closing(uavcan.driver.make\_node(‘can0’, bitrate=500000))

Best regards,

Malis

---

<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:** [August 21, 2019, 2:39pm UTC](https://forum.opencyphal.org/t/uavcan-and-raspberry-pi/592/4 "2019-08-21T14:39:45Z")

</div>

> [@Malis](#):
>
> Any idea?

Wrong version of Python. The tutorial says:

> This tutorial will walk you through the basic usage of Pyuavcan. It is intended for execution in an interactive shell of **Python 3.4 or newer**. While Pyuavcan supports Python 2.7, its use is strongly discouraged.

You shouldn’t see the error if you use Python 3. You should also beware that [Python 2.7 will reach its end-of-life in 4 months](https://pythonclock.org/) so writing any new software in it is probably not a good idea.

---

<div class="post-metadata">

**Author:** ![ka\_ru](https://forum.opencyphal.org/letter_avatar_proxy/v4/letter/k/94ad74/32.png) [@ka\_ru](https://forum.opencyphal.org/u/ka_ru)\
**Post date:** [December 22, 2019, 3:43pm UTC](https://forum.opencyphal.org/t/uavcan-and-raspberry-pi/592/5 "2019-12-22T15:43:59Z")

</div>

you should check python3

```auto
apt-cache policy python3 python3-pip python3-numpy

```

and install

```auto
sudo apt-get install python3-pip python3-numpy
pip3 install pyuavcan[transport_can_pythoncan,transport_serial,cli]

```

---

<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:** [December 22, 2019, 3:46pm UTC](https://forum.opencyphal.org/t/uavcan-and-raspberry-pi/592/6 "2019-12-22T15:46:54Z")

</div>

OP seems to be using UAVCAN v0. The instructions you posted are for UAVCAN v1. I would recommend OP to consider switching to v1 though; for that, one should refer to [**pyuavcan.readthedocs.io**](http://pyuavcan.readthedocs.io).

---

<div class="post-metadata">

**Author:** ![ka\_ru](https://forum.opencyphal.org/letter_avatar_proxy/v4/letter/k/94ad74/32.png) [@ka\_ru](https://forum.opencyphal.org/u/ka_ru)\
**Post date:** [December 22, 2019, 3:48pm UTC](https://forum.opencyphal.org/t/uavcan-and-raspberry-pi/592/7 "2019-12-22T15:48:56Z")

</div>

pip is for python 2.7.  
or need to set

alias python=’/usr/bin/python3.7’

~/.bashrc

---

<div class="post-metadata">

**Author:** ![ka\_ru](https://forum.opencyphal.org/letter_avatar_proxy/v4/letter/k/94ad74/32.png) [@ka\_ru](https://forum.opencyphal.org/u/ka_ru)\
**Post date:** [December 23, 2019, 7:10am UTC](https://forum.opencyphal.org/t/uavcan-and-raspberry-pi/592/8 "2019-12-23T07:10:47Z")

</div>

I have a pyuavcan installed. I am running the script  
./show\_data\_type\_info.py  
I get.  
PyUAVCAN is not installed. Please install from PIP: sudo pip3 install uavcan  
library [https://github.com/UAVCAN/libcanard](https://github.com/UAVCAN/libcanard) is not V1.0?

---

<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:** [December 24, 2019, 5:31am UTC](https://forum.opencyphal.org/t/uavcan-and-raspberry-pi/592/9 "2019-12-24T05:31:20Z")

</div>

There are two Python packages related to PyUAVCAN, they cannot be used simultaneously: `uavcan` that implements v0, and `pyuavcan` that implements v1. From our earlier conversation I deduce that you need v0, so you should do `pip uninstall pyuavcan -y && pip install uavcan`.

Support for v1 is implemented in Libcanard in a separate branch, it is very experimental still. I should finalize it soon.

---

<div class="post-metadata">

**Author:** ![ka\_ru](https://forum.opencyphal.org/letter_avatar_proxy/v4/letter/k/94ad74/32.png) [@ka\_ru](https://forum.opencyphal.org/u/ka_ru)\
**Post date:** [December 24, 2019, 11:15am UTC](https://forum.opencyphal.org/t/uavcan-and-raspberry-pi/592/10 "2019-12-24T11:15:12Z")

</div>

I do not want to use V0. V0 is leaving and will not be supported anymore. or? Where to discuss about new data types(DSDL). I am interested in the parameters for motors, RPM, etc. This is not standard V1.

---

<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:** [December 24, 2019, 6:51pm UTC](https://forum.opencyphal.org/t/uavcan-and-raspberry-pi/592/11 "2019-12-24T18:51:06Z")

</div>

> [@ka\_ru](#):
>
> V0 is leaving and will not be supported anymore.

We don’t yet have a well-defined date for its EOL, but you are correct in your view that new applications should be using v1. The first stage of the v0-v1 transition will begin in 2020Q1, as explained in [UAVCAN 2019 roadmap](https://forum.opencyphal.org/t/uavcan-2019-roadmap/666). This is when we are going to update the website and all GitHub repositories to point to v1 by default. For the benefit of existing deployments, v0 will still be available and maintained for a few more years at least.

> [@ka\_ru](#):
>
> Where to discuss about new data types(DSDL). I am interested in the parameters for motors, RPM, etc.

This forum is the right place for such discussions. If you have a piece of feedback or a proposal, please start a new topic in [Development & Maintenance - OpenCyphal Forum](https://forum.opencyphal.org/c/dev).

> [@ka\_ru](#):
>
> This is not standard V1.

V1 does not and will not include any application-specific data types. Instead, they are relegated to the `regulated` namespace, which is outside of the scope of the Specification. Eventually, we will use that to define a set of application-specific profiles, but they are not going to be part of the core specification (think of it like USB device classes or CANopen profiles).

You can learn more about this decision here:

- [UAVCAN V1 FAQ s](https://forum.opencyphal.org/t/uavcan-v1-faq-s/479)
- [Data type regulation policy and membership fees](https://forum.opencyphal.org/t/data-type-regulation-policy-and-membership-fees/707)
- [UAVCAN: a highly dependable publish-subscribe protocol for real-time intravehicular networking](https://forum.opencyphal.org/t/uavcan-a-highly-dependable-publish-subscribe-protocol-for-real-time-intravehicular-networking/557)
- Chapter 2 of the [Specification](https://new.uavcan.org/specification).

From the [other thread](https://forum.opencyphal.org/t/uavcan-cli-control-on-rpi-over-ssh/719/10):

> [@UAVCAN CLI control on RPi over SSH](https://forum.opencyphal.org/t/uavcan-cli-control-on-rpi-over-ssh/719/10):
>
> We do not use rad/s.  
> Why is it in the zubax category? It looks very biased and not abstract.  
> I can place the parameters in my category.  
> Will you add my company to your git?

All regulated data types will use SI, hence radian/second instead of RPM. We are unlikely to accept a data type using RPM because it does not follow the application recommendations outlined in the Specification and in the public regulated data types repository.

We can certainly add a new namespace for your company if it does not replicate the functionality available under existing namespaces and it follows the data type design recommendations. If you would like to go ahead, I recommend you to start a new thread in /c/dev with your proposal.

---

<div class="post-metadata">

**Author:** ![ka\_ru](https://forum.opencyphal.org/letter_avatar_proxy/v4/letter/k/94ad74/32.png) [@ka\_ru](https://forum.opencyphal.org/u/ka_ru)\
**Post date:** [December 24, 2019, 7:40pm UTC](https://forum.opencyphal.org/t/uavcan-and-raspberry-pi/592/12 "2019-12-24T19:40:25Z")

</div>

RPM is not in the si system?

> **[Revolutions per minute](https://en.wikipedia.org/wiki/Revolutions_per_minute)**
>
> Revolutions per minute (abbreviated rpm, RPM, rev/min, r/min, or with the notation min−1) is the number of turns in one minute. It is a unit of rotational speed or the frequency of rotation around a fixed axis.
> According to the International System of Units (SI), rpm is not a unit. This is because the word revolution is a semantic annotation rather than a unit. The annotation is instead done as a subscript of the formula sign if needed. Because of the measured physical quantity, the formula sign...

I think this is a dead end. Almost all motor manufacturers use RMP. You do not plan to enter the market of industrial applications? Standards are made for relief, not inconvenience. Do you think that the company is Simems or Bosch, NXP and etc. will someone use a UVACAN with a type **zubax**? It would be more logical if the type of **zubax** or another manufacturer was on the Git of the manufacturer, and in the Git UAVCAN there were abstract types. as it is not logical for an advanced abstract protocol.

---

<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:** [December 24, 2019, 10:23pm UTC](https://forum.opencyphal.org/t/uavcan-and-raspberry-pi/592/13 "2019-12-24T22:23:46Z")

</div>

As explained in [Data type regulation policy and membership fees](https://forum.opencyphal.org/t/data-type-regulation-policy-and-membership-fees/707), the idea is to enable vendors to collaborate on abstract, reusable interfaces in a well-regulated fashion. In the longer term, we will use regulated vendor namespaces (such as `regulated.zubax`) as a base to define standard vendor-agnostic profiles. Keeping such generic namespaces in one repository is necessary to reduce the risk of fragmentation and to simplify their maintenance.

I don’t think the name of a namespace could prevent other companies from using it in their systems or products.
