alexmohr / usb-can

USB-CAN Analyzer Linux Support
GNU General Public License v2.0
36 stars 13 forks source link

Module #39

Closed bloddy closed 2 years ago

bloddy commented 2 years ago

Hi there, I'm trying to use this on a raspberryPI with venus-OS .. I've build the module and the user app ... but I don't see any receiving traffic when I try to dump the can.

Kernel: 4.19.81-v7

[ 174.179626] hlcan: QinHeng serial line CAN interface driver [ 174.185297] hlcan: 10 dynamic interface channels. [ 212.996757] hlcan: Serial device not ready

[ 258.921044] IPv6: ADDRCONF(NETDEV_UP): can0: link is not ready [ 258.927127] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready [ 264.221411] can: controller area network core (rev 20170425 abi 9) [ 264.227991] NET: Registered protocol family 29 [ 264.242511] can: raw protocol (rev 20170425)

Verified on the windows app that the device is working .. but in linux still having issue .. I've tested another thing to see .. I've downloaded the canusb.c from kobolt and I can see communication on that .. https://raw.githubusercontent.com/kobolt/usb-can/master/canusb.c

Any idea ? Or a direction to see why not I can't see any traffic ...

bloddy commented 2 years ago

Managed to receive data, but I can't send extended frame.. tested on the windows app works, testing in linux does not work ..

alexmohr commented 2 years ago
  1. Please describe what you have to done to get receive to work to help others which may have the same issue
  2. Sending extended frames might be broken. I'll take a look at it in next week or so. It might take a bit because I'm on vacation at the moment
bloddy commented 2 years ago

The issue for myself it was that Venus-OS was trying to catch the can port and reinitialize it.. even if I disabled the function from it .. after I debugged the dbus system I've seen that .. and made it stop ..

And I got some issue when I had to do the cross-compile .. but that's another thing that is not a problem for people who compile locally.

The problem with the extended frame you may have any idea from where it comes ? Or a hint :)

Thank you.

alexmohr commented 2 years ago

Thanks, extended frame may be broken in the implementation itself and has nothing to do with your hardware. I'll have to take a look myself. You can try if it's running with commit 0421931fc1e4cd3943e1765de276958e8bc7bc3b because after that I've changed some macros. https://github.com/alexmohr/usb-can/commit/d43cfdd5eb20d5361d27eab44c90e8ca8438d025 is probably the commit which broke remote frames.

bloddy commented 2 years ago

I've tried it .. nope does not work .. problem is that I don't have a secondary can to see what really is sent ...

alexmohr commented 2 years ago

Thanks for trying. I'll take a look next week or so. I will update this as soon as i have new information

alexmohr commented 2 years ago

So it turns out that next week or so actually means 4 weeks. Sorry for the delay I'm pretty busy at the moment. I finally found a bit of time to sink into this project. https://github.com/alexmohr/usb-can/pull/40 should fix your issue

$ candump any 
  can1  511   [2]  00 11
  can0  511   [2]  00 11
  can0  0000EB00   [2]  00 11
  can1  0000EB00   [2]  00 11
  can0  0000EB00   [0]  remote request
  can1  0000EB00   [0]  remote request

Please resolve this issue if the PR actually fixes it. If you are using the 5.13 kernel than you'll have to cherry pick the commit. Let me know if the issue persists or you have trouble verifying it.

bloddy commented 2 years ago

Thx gonna check it .. I changed to other canbus hw ... but when I get back .. I will try it and atleast feedback.

Thank you.