Read bus voltage from PDP over CAN with MCP2515 Python and Raspberry

Hi everybody,

We want to read out the PDP bus voltage over CAN by using Python and the MCP2515 CAN to SPI converter board (eventually we would like to read out everything like current per channel etc.)

There is a python library for the MCP2515 (Simple test — Adafruit MCP2515 Library 1.0 documentation) our question is where do we start?

Can we just connect the MCP to the PDP and listen on the bus? and then send and receive data? We assume we need a can message format that is suitable for the PDP and then it will return it data? or is it continuously sending and can we just receive everything.

We only have the PDP, MCP2515 and a Raspberry PI 3

All suggestions are welcome.

Thank you in advance.


Are you running your robot code on a roboRIO connected by CAN?

1 Like

I’m not aware of a public spec to point to easily. Some parts of the addressing are documented, but it might be faster to reach out to CTRE to see if they could provide the technical details?

Another option, aligned with what Amicus1 might be asking - write some robot code that does nothing other than read the voltage off the PDP, and capture the packets. Sweep the voltage at the PDP up and down in a known pattern. Analyze the packet capture to see if you can determine the startup messages and how the voltage increases/decreases.

1 Like

Theres no “public” spec, but the code to read the packets is all open source in the wpilib repo.

It continuously sends at intervals, and doesn’t require any sends to do so. So you just have to construct the CAN ID’s, which you can construct from the FRC can spec.


No, we don’t have a roboRIO at the moment, we are trying it with only the MCP, PDP, Raspberry and a logic analyzer.

Thank you for the suggestion, going to reach out to CTRE.
I found the link of the addressing earlier. Going to try your idea to sweep the voltage on the bus!

Going to check this! Good to know that it just start sending at intervals on the bus. Going to connect the PDP directly to the MCP and try some things with ID’s and probably also connected a logic analyzer.