Equivalent tool to cansend for python-can

44 views
Skip to first unread message

R. Diez

unread,
Jun 22, 2021, 9:01:53 AM6/22/21
to python-can
Hi all:

I am new to python-can and not really fit in Python at all.

I have been using Linux' SocketCAN, and I normally just need to send the odd test CAN message. I am used to typing something like this on the command line:

cansend slcan0 123#DEADBEEF01020304

Is there an equivalent command-line tool for python-can? This way, I could write a Bash script and automate some testing, without having to learn Python.

Thanks in advance,
  rdiez

Felix Divo

unread,
Jun 22, 2021, 2:06:46 PM6/22/21
to python-can
Hey!

I am afraid that there is not such tool. The existing scripts can be found here: https://python-can.readthedocs.io/en/develop/scripts.html.

However, you could invoke a very simple Python snippet, e.g. via >> python -c "print('hi')" << or >> python path/to/helper_script.py <<. Python isn't exactly one of the hardest languages to get started with, so something like https://github.com/hardbyte/python-can/blob/develop/examples/send_one.py should be quite easily adaptable to your needs.

Best
Felix D.

Reply all
Reply to author
Forward
0 new messages