GithubHelp home page GithubHelp logo

Comments (6)

kasperkarlsson avatar kasperkarlsson commented on June 8, 2024

See response to PR in
#53 (comment)

In general, it is a good idea to discuss things in an issue before sending a PR. I am currently not convinced that completely removing the possibility to specify an interface is the best way to handle this.

from caringcaribou.

bhass1 avatar bhass1 commented on June 8, 2024

Fair point about handling setups with multiple interfaces. That is not my use-case so I hadn't thought about that.

At the root of this issue is a question of how much interface configuration should be handled by Caring Caribou versus python-can. My standard procedure has been to create a ~/can.conf file per python-can recommendation and everything "just-works" with a single interface.

In the meantime, a less intrusive change would be to modify the documentation to make it more clear that -i forces SocketCAN to be used with the specified interface.

from caringcaribou.

kasperkarlsson avatar kasperkarlsson commented on June 8, 2024

Agreed. Let's keep this issue open for brainstorming/suggestions - it would be great to find an interface type agnostic way of handling this!

from caringcaribou.

kasperkarlsson avatar kasperkarlsson commented on June 8, 2024

After going through the python-can documentation, I found that the interface type specifier is now optional. Today I was (finally) able to test this out in a few different live environments, which all seem to work just fine.

@bhass1 It would be great if you could try this out too - it's in the branch https://github.com/CaringCaribou/caringcaribou/tree/interface-agnostic. The code changes were introduced in commit 38b7a8f

If no new problems are found, this will be merged to master shortly.

from caringcaribou.

Epsilon314 avatar Epsilon314 commented on June 8, 2024

When trying out with flag
-i vcan0
a NotImplementedError was raised and it seems that interface = None is passed to python-can instead of 'socketcan'.

After reading that issue, i tried to set default interface for python-can to 'socketcan' in ~/can.conf file and it works then.
Also, instead of configing python-can from file, changing line 216 in can_actions.py to
self.bus = can.Bus(DEFAULT_INTERFACE,bustype="socketcan")
works either.

Is it true that the second parameter in original
self.bus = can.Bus(DEFAULT_INTERFACE,"socketcan")
is not parsed and python-can actually uses file config?

from caringcaribou.

kasperkarlsson avatar kasperkarlsson commented on June 8, 2024

@Epsilon314 Yes. When bustype wasn't present in kwargs, older versions of python-can would fallback to reading the configuration file. In more recent versions, I believe the same thing is controlled through the channel kwarg for can.interface.Bus.

I am closing this issue now - feel free to open a new one if you encounter some unexpected behavior.

from caringcaribou.

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.