# Reading CAN bus from pixhawk CAN port to RPI

**URL:** <https://forum.opencyphal.org/t/reading-can-bus-from-pixhawk-can-port-to-rpi/631>\
**Category:** PyCyphal\
**Created:** [October 2, 2019, 1:54am UTC](https://forum.opencyphal.org/t/reading-can-bus-from-pixhawk-can-port-to-rpi/631 "2019-10-02T01:54:43Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![bduva002](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/bduva002/32/337_2.png) [@bduva002](https://forum.opencyphal.org/u/bduva002)\
**Post date:** [October 2, 2019, 1:54am UTC](https://forum.opencyphal.org/t/reading-can-bus-from-pixhawk-can-port-to-rpi/631/1 "2019-10-02T01:54:43Z")

</div>

Hello all,  
I am using a RPI 3b+ with a MIKROE CAN to SPI 3.3 volt click board. I am attempting to read RAWIMU through the can bus port on the pixhawk. I am using socket can and was able to test my hardware setup and am able to send an receive messages.  
Here is my problem, when I connect my pixhawk to the bus I cant read any CAN messages from the pixhawk. I have setup all the necessary parameters in mission planner. Do I have to send a message before I can start reading?

Any help would be greatly appreciated

---

<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:** [October 2, 2019, 2:36am UTC](https://forum.opencyphal.org/t/reading-can-bus-from-pixhawk-can-port-to-rpi/631/2 "2019-10-02T02:36:46Z")

</div>

You need to make sure that the APM is actually publishing the data you are looking for. Consider using a conventional USB-CAN adapter with the GUI tool to test that.

---

<div class="post-metadata">

**Author:** ![bduva002](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/bduva002/32/337_2.png) [@bduva002](https://forum.opencyphal.org/u/bduva002)\
**Post date:** [October 2, 2019, 2:53am UTC](https://forum.opencyphal.org/t/reading-can-bus-from-pixhawk-can-port-to-rpi/631/3 "2019-10-02T02:53:55Z")

</div>

Thank you for the reply Pavel,  
I meant to ask this question before…  
So is it possible to use uavcan.equipment.ahrs.RawIMU to read raw imu data from the can bus port of the pixhawk in arduplane?

I have a USB-CAN adapter too. I will try that next

---

<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:** [October 2, 2019, 3:12am UTC](https://forum.opencyphal.org/t/reading-can-bus-from-pixhawk-can-port-to-rpi/631/4 "2019-10-02T03:12:54Z")

</div>

> [@bduva002](#):
>
> So is it possible to use uavcan.equipment.ahrs.RawIMU to read raw imu data from the can bus port of the pixhawk in arduplane?

I don’t know. Please ask ArduPlane developers instead.

---

<div class="post-metadata">

**Author:** ![bduva002](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/bduva002/32/337_2.png) [@bduva002](https://forum.opencyphal.org/u/bduva002)\
**Post date:** [October 2, 2019, 3:14am UTC](https://forum.opencyphal.org/t/reading-can-bus-from-pixhawk-can-port-to-rpi/631/5 "2019-10-02T03:14:29Z")

</div>

Thanks!

---

<div class="post-metadata">

**Author:** ![bduva002](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/bduva002/32/337_2.png) [@bduva002](https://forum.opencyphal.org/u/bduva002)\
**Post date:** [October 2, 2019, 7:11pm UTC](https://forum.opencyphal.org/t/reading-can-bus-from-pixhawk-can-port-to-rpi/631/6 "2019-10-02T19:11:25Z")

</div>

I plugged in a USB-CAN adapter and clicked read. I am seeing traffic! The problem is I am only seeing one node id: 1001550A go by at about one Hz. Should I be seeing more then one node id if other sensors are publishing to the bus?

Also I found this test code for publishing  
[https://github.com/ArduPilot/uavcan/blob/master/libuavcan/test/node/publisher.cpp](https://github.com/ArduPilot/uavcan/blob/master/libuavcan/test/node/publisher.cpp)  
Would i have to use this to see other nodes on the bus?

---

<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:** [October 2, 2019, 7:17pm UTC](https://forum.opencyphal.org/t/reading-can-bus-from-pixhawk-can-port-to-rpi/631/7 "2019-10-02T19:17:28Z")

</div>

> [@bduva002](#):
>
> The problem is I am only seeing one node id: 1001550A go by at about one Hz.

This is not a node-ID. This is a NodeStatus message from a node whose node-ID is 10 (0x0A).

> [@bduva002](#):
>
> Should I be seeing more then one [message] if other sensors are publishing to the bus?

Yes. Apparently, the autopilot is not publishing the data you need. I suggest you read the user manual or ask the maintainers why the data you are after is not being published and how to enable it.

> [@bduva002](#):
>
> Would i have to use this to see other nodes on the bus?

No, this is a unit test.

---

<div class="post-metadata">

**Author:** ![bduva002](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/bduva002/32/337_2.png) [@bduva002](https://forum.opencyphal.org/u/bduva002)\
**Post date:** [October 2, 2019, 9:00pm UTC](https://forum.opencyphal.org/t/reading-can-bus-from-pixhawk-can-port-to-rpi/631/8 "2019-10-02T21:00:56Z")

</div>

Thanks again,  
This helps a lot. Looks like I have my work cut out for me. I was thinking the pixhawk was already doing this and the dsdl definitions were directly usable.

Dose the NodeStatus message have anything to do with the UAVCAN DSDL messages?

---

<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:** [October 3, 2019, 8:07am UTC](https://forum.opencyphal.org/t/reading-can-bus-from-pixhawk-can-port-to-rpi/631/9 "2019-10-03T08:07:24Z")

</div>

> [@bduva002](#):
>
> I was thinking the pixhawk was already doing this and the dsdl definitions were directly usable.

The software is not publishing the data you are looking for.

_(there is a terminology issue: when you say “Pixhawk”, you are referring to the hardware, which is not really what you should be talking about; instead, you should be referring to the software stack running on that hardware, such as ArduPilot or PX4; the same stack can be used with other hardware platforms but its feature set is largely invariant to the type of the underlying hardware)._

> [@bduva002](#):
>
> Dose the NodeStatus message have anything to do with the UAVCAN DSDL messages?

Of course. It’s a standard message type defined by the Specification. It is available in the stable version of UAVCAN as well, but under a different name `uavcan.node.Heartbeat.1.0`.
