Access CAN-Bus from Windows-Build

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
EqBooster
Posts: 9
Joined: Mon Jul 16, 2018 11:21 am

Access CAN-Bus from Windows-Build

Post by EqBooster » Mon Jul 23, 2018 1:36 pm

Hello guys,

Does someone know if it is possible to use the CAN bus with a USB adapter from micropython when building for Windows?
I saw a thread from python-can (https://github.com/hardbyte/python-can/issues/93) and there was a discussion about this, but couldn't find anything else about this.

Does anyone know if there exists something like this, or does anyone have some suggestions how i could implement it the best myself?

Many thanks
Stefan

jickster
Posts: 629
Joined: Thu Sep 07, 2017 8:57 pm

Re: Access CAN-Bus from Windows-Build

Post by jickster » Mon Jul 23, 2018 4:38 pm

What level of detail are you looking for?

Basically you need the .dll for your specific USB-drivers.


EqBooster
Posts: 9
Joined: Mon Jul 16, 2018 11:21 am

Re: Access CAN-Bus from Windows-Build

Post by EqBooster » Mon Jul 23, 2018 9:41 pm

So i make build a dll of the usb-driver and wrap it to a micropython module on my own?
I was asking if there is something existing like this because there were already some requests for this.

jickster
Posts: 629
Joined: Thu Sep 07, 2017 8:57 pm

Re: Access CAN-Bus from Windows-Build

Post by jickster » Mon Jul 23, 2018 9:48 pm

EqBooster wrote:So i make build a dll of the usb-driver and wrap it to a micropython module on my own?
I was asking if there is something existing like this because there were already some requests for this.
If you have the code for the driver, you could build the .obj and link the .obj directly into your micropython build so everything is contained in one file.

I use Kvaser and Vector USB-CAN dongles and they don’t give you the source code but they do give you both the .dll and .lib so you can choose between dll, to have ability to upgrade driver separately from your code, or .lib so you can create only one binary file.

I don’t know what you mean by “something like this exists”. Each dongle manufacturer is gonna have a different API. Since there are not that many USB-CAN manufacturers I guess we could create a “port” for each one.

Is that what you want?

EqBooster
Posts: 9
Joined: Mon Jul 16, 2018 11:21 am

Re: Access CAN-Bus from Windows-Build

Post by EqBooster » Tue Jul 24, 2018 6:25 am

I just asked because there was a discussion already about this specific usb-can driver, but i didn't find anything so i guess it doesn't exist.

So have you successfully used Kvaser or Vector with micropython? If yes, can you probably share your implementation so references? I guess i need to extend the micropython firmware with a custom module that wraps the python functions to the LIB/DLL.
Is there something existing like this already for some other modules?

Thank you for taking your time and your help.

Post Reply