redrathnure / armbian-mkspi

Armbian Linux Build Framework
https://www.armbian.com
GNU General Public License v2.0
80 stars 13 forks source link

CAN support in kernel #16

Closed opiswahn closed 9 months ago

opiswahn commented 9 months ago

Which feature would you like to have?

I tried to use CAN with the current debian image, but it seems it is not compiled into the kernel. Can this be added?

Funding

redrathnure commented 9 months ago

Hi opiswahn, I will look at weekends. However I have no idea how to work with CAN bus support. I would be appreciated for any hints.

opiswahn commented 9 months ago

Hi, i think it actually is ok after all, I tried the newest bleeding version (both Debian and Ubuntu)and it works fine as a module. I'm not sure why it didn't work with the stable version, maybe I did something wrong. So all good I guess : ☺️

opiswahn commented 9 months ago

BTW, thx for your work on those images, whey work really great 👍

fbeltrao-br commented 5 months ago

I've tested CAN BUS on MKS Skipr three months ago, and unfortunately all redrathnure images using kernels 5.15 and 6.1 (I didn't tested 6.6) have issues, something causes disconnections on very early print stages. The same configuration on the garbage EOL 5.16 kernel Armbian compiled by MKS, works without issues.

yammaster commented 5 months ago

Wich image includes the CAN module? I tried the 6.1 curent but I don't see can interface.

redrathnure commented 5 months ago

OK, after a some reading and trails I would say the both images has CAN support. However you should understand how to configure CAN interface, how to flash/configure the both parts and be aware about current limitation: SKIPR CAN will work only when "main board" and "controller part" are connected via USB interface (will not work when you use default UART connection).

I managed to configure MKSPI <--> U2C <--> BTT EBB36 plate and it works on the speeds up to 500 000 bps (Not 1Mibps as stated in documentation). However it requires to flash the BTT EBB36 plate with right parameters and having proper data cables (they must be twisted, even with short cables). I used https://www.klipper3d.org/CANBUS.html + BTT EBB36 docs as entry point. I believe SKIPR configuration should be similar, except you have SKIPR Controller part instead U2C stick.

yammaster commented 5 months ago

Hi redathnure, thanks for your reply and your work! I have another SKIPR with the Makerbase image in use, so I know about the configuration - I think ;-) I've connected the pi part with the mcu over USB cable and I configured the mcu as USB-CAN bridge, like the other SKIPR board. But I don't see a can0 interface on pi site. Do I have to bring up can0 with modrobe or something like this? dmesg tells me, there is no can/CAN interface.

I'll try it again maybe the mcu flashing was wrong ...

yammaster commented 5 months ago

As I'd afraid - the mcu flashing went wrong. Now I have a can0 interface - yeah!

redrathnure commented 5 months ago

Yeah, just wanted to respond you that no any modprobe magic is required, just a proper Klipper configuration of mcu firmware.

BTW, is it working stable in your case? There is a message that a print interrupts for an unknown reason.

yammaster commented 5 months ago

I use it in the moment only for my test environment so I haven't issues with non stabel working .... not yet ;-)

fbeltrao-br commented 5 months ago

OK, after a some reading and trails I would say the both images has CAN support. However you should understand how to configure CAN interface, how to flash/configure the both parts and be aware about current limitation: SKIPR CAN will work only when "main board" and "controller part" are connected via USB interface (will not work when you use default UART connection).

I managed to configure MKSPI <--> U2C <--> BTT EBB36 plate and it works on the speeds up to 500 000 bps (Not 1Mibps as stated in documentation). However it requires to flash the BTT EBB36 plate with right parameters and having proper data cables (they must be twisted, even with short cables). I used https://www.klipper3d.org/CANBUS.html + BTT EBB36 docs as entry point. I believe SKIPR configuration should be similar, except you have SKIPR Controller part instead U2C stick.

I certainly know how to setup a CAN interface. Did you tried to make a real use of the CAN interface? Here it fails randomly, mostly during first home procedure, it's pretty much unreliable.

I have both MKS Skipr with built-in CAN and MKS Pi with BTT EBB36 and U2C, though I tested only with the Skipr.

I use it in the moment only for my test environment so I haven't issues with non stabel working .... not yet ;-)

Are you using MKS image or redrathnure builds?

redrathnure commented 4 months ago

@fbeltrao-br, @yammaster I know it's pretty old discussion, however finally I reach a stage when I can answer "Yes, I use it in real prints, and yes, it works correctly". However interface was semy broken when I had followed official Klipper documentation. So you should double check your configs and adapt them to the used distro. Please check out https://github.com/redrathnure/armbian-mkspi?tab=readme-ov-file#how-to-configure-can-bus for more details, if you are still have interest in CAN bus configuration.

yammaster commented 4 months ago

Yeah, just wanted to respond you that no any modprobe magic is required, just a proper Klipper configuration of mcu firmware.

BTW, is it working stable in your case? There is a message that a print interrupts for an unknown reason.

Hi Alex, I had a issue with timeout while homing, as you asked me but I solved it with this:

https://klipper.discourse.group/t/communication-timeout-during-homing-probe/3559

but out of this it works fine and stable since I have it in use regards René

yammaster commented 4 months ago

Hi Alex,

I use it with CAN bus for real prints without any issues, accept the timeout while homing (as I discribed in your repository).

 

Regards

René

   

Gesendet: Samstag, 16. März 2024 um 16:14 Uhr Von: "Maxim Medvedev" @.> An: "redrathnure/armbian-mkspi" @.> Cc: "yammaster" @.>, "Mention" @.> Betreff: Re: [redrathnure/armbian-mkspi] CAN support in kernel (Issue #16)

 

@fbeltrao-br, @yammaster I know it's pretty old discussion, however finally I reach a stage when I can answer "Yes, I use it in real prints, and yes, it works correctly". However interface was semy broken when I had followed official Klipper documentation. So you should double check your configs and adapt them to the used distro. Please check out https://github.com/redrathnure/armbian-mkspi?tab=readme-ov-file#how-to-configure-can-bus for more details, if you are still have interest in CAN bus configuration.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>