Socketcan api wrapper

59 views
Skip to first unread message

TJ Bruno

unread,
Apr 11, 2020, 2:21:59 PM4/11/20
to python-can
Hi all, I created a minimal python wrapper around socketcan for a small raspberry pi project I'm working on. I tried to make it simple as possible to allow things like

from pi import interface

interface.on()

interface.state
'up'

interface.baud = 250000

interface.baud
'250000'


Right now it only contains the methods I need for my use case, but I would be happy to fork it into it's own repo and develop further if it could be useful to Python-Can. 

Check it out and let me know your thoughts -- https://github.com/Tbruno25/canano/blob/master/canano/pi.py

Travis Travelstead

unread,
Apr 12, 2020, 10:42:25 AM4/12/20
to python-can
I have done similar in the past on an embedded linux project. I think Python-CAN is overall simple but there are some very typical settings combined with the OS specific setup which is the main thing you have taken care of.

Probably the biggest thing missing is a filtering setup. Most people have trouble with the common CAN filtering methods and abstracting that for the general users might be a good thing.

TJ Bruno

unread,
Apr 14, 2020, 10:49:37 PM4/14/20
to python-can
That's a good point, although filters can be set up directly in Python-CAN. I'm just lazy and wanted to be able to change the basic settings in < 3 commands while still in the REPL.

I decided to go ahead an spin it into it's own repo  -- https://github.com/Tbruno25/pysocketcan
Reply all
Reply to author
Forward
0 new messages