GithubHelp home page GithubHelp logo

Comments (7)

daniel-santos avatar daniel-santos commented on August 16, 2024 1

@Jochen0x90h I think I answered before fully reading yourn question. :) Your answer is mostly in the packed structs. gs_device_config sends the capabilities of the device to the host, and the host keeps GS_MAX_RX_URBS (30) bulk IN URB requests outstanding at a time.

I'm planning on submitting a proposal to extend this driver to support CAN FD and also to make it more efficient for CAN and CAN FD. This discussion will take place on LKML and probably linux-usb and linux-can. When i finally get around to it, I'll announce it here.

from candlelight_fw.

vondraussen avatar vondraussen commented on August 16, 2024

@Jochen0x90h I think the Kernel module source can be a starting point:
https://github.com/torvalds/linux/blob/master/drivers/net/can/usb/gs_usb.c

from candlelight_fw.

daniel-santos avatar daniel-santos commented on August 16, 2024

@Jochen0x90h Yes, I'm afraid that's about it. In general, there is can.rst / can.txt in the kernel Documentation, but that's for the higher-level access to CAN devices in Linux.

To better understand gs_usb.c, you'll need to read it and also understand the various sub-systems it's implementing devices in. I also know that Ethan has some info on OSX here. Sorry I don't have much more for you as I don't use Mac.

from candlelight_fw.

Jochen0x90h avatar Jochen0x90h commented on August 16, 2024

@daniel-santos Thanks. I have to start experimenting with it, but if you know how to fill out gs_device_bittiming to get 500kHz (for OBDII port) this would be a good starting point

from candlelight_fw.

Jochen0x90h avatar Jochen0x90h commented on August 16, 2024

I'm now able to initialize the device and set the bit timing, but simply sending and receiving frames doesn't do the trick yet.

Here's my code, see line 393: https://github.com/Jochen0x90h/candlelight-libusb/blob/master/src/main.cpp

I receive garbage in the frame but I would expect that I receive nothing if nothing is connected to the can bus. When I connect it to the OBD-II Port of a car then I still receive garbage. Is there anything I miss?

from candlelight_fw.

Jochen0x90h avatar Jochen0x90h commented on August 16, 2024

@vondraussen Now I got it to work. These problems I still have with a CANable 0.2 device:

  1. In loopback mode, I get two responses with different timestamps while I would expect only one

  2. Sometimes I can read some or many frames after disable/enable and before a frame was written. Termination is set. this seems to be an issue with the buffer management, maybe the queues are not cleared when the can gets disabled.

  3. Sometimes I don't get a reply to a real OBD-II request to a car on the first try, but on the second.

from candlelight_fw.

fenugrec avatar fenugrec commented on August 16, 2024

Closing this due to inactivity, and because there's not much documentation beyond the linux driver sourcecode. Feel free to reopen

from candlelight_fw.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.