can-utils | Linux-CAN / SocketCAN user space applications | Automation library

 by   linux-can C Version: v2023.03 License: No License

kandi X-RAY | can-utils Summary

kandi X-RAY | can-utils Summary

can-utils is a C library typically used in Automation applications. can-utils has no bugs, it has no vulnerabilities and it has medium support. You can download it from GitHub.

Linux-CAN / SocketCAN user space applications
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              can-utils has a medium active ecosystem.
              It has 1906 star(s) with 642 fork(s). There are 123 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 44 open issues and 163 have been closed. On average issues are closed in 44 days. There are 9 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of can-utils is v2023.03

            kandi-Quality Quality

              can-utils has no bugs reported.

            kandi-Security Security

              can-utils has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              can-utils does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              can-utils releases are available to install and integrate.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of can-utils
            Get all kandi verified functions for this library.

            can-utils Key Features

            No Key Features are available at this moment for can-utils.

            can-utils Examples and Code Snippets

            No Code Snippets are available at this moment for can-utils.

            Community Discussions

            QUESTION

            Linux SocketCAN behaviour of recvmsg
            Asked 2020-Nov-03 at 14:22

            I'm writing a CAN logger program. The way I log the data is similar to the way the candump-tool is doing it when invoking candump like candump any: https://github.com/linux-can/can-utils/blob/master/candump.c

            candump any makes candump bind to any device, i.e. addr.can_ifindex = 0; then it uses recvmsg to obtain a CAN frame, then it gets the on the struct msghdr msg; attached timestamp to write it into the log file or onto the screen.

            My question here is, does the kernel ensures that the following assert is always valid?

            ...

            ANSWER

            Answered 2020-Oct-23 at 18:14

            The short answer is yes, unless your driver does something very weird. CAN uses the same netif subsystem that other network devices use. There are a few ways that the SKB gets a timestamp.

            HW Timestamps:

            If your driver uses hardware time stamps, then time stamps are based on whatever the hardware provides.

            SW Timestamps:

            If netdev_tstamp_prequeue is enabled then a timestamp is soon after your driver submits the skb to netif_receive_skb

            https://elixir.bootlin.com/linux/v4.14.202/source/net/core/dev.c#L4554

            If netdev_tstamp_prequeue is not enabled then the timestamp is applied after a bit more processing but still in the same NAPI receive thread.

            https://elixir.bootlin.com/linux/v4.14.202/source/net/core/dev.c#L4352

            Here is the fuzzy part:

            There are special modes (RSP/RFP) that allow the kernel to load balance skb processing with SMP. Instead of processing the skb in the napi receive thread, the kernel puts the skb in a per cpu queue. Now if netdev_tstamp_prequeue is not enabled, the timestamp is added when it comes off the per cpu queue some time later. However, the documentation says the receive ordering is not modified so time stamps should remain in order as well.

            Source https://stackoverflow.com/questions/63266390

            QUESTION

            Why isn't j1939.h include in the Ubuntu 18.04 Linux Kernel?
            Asked 2020-Oct-28 at 21:57

            I am trying to use CAN J1939 standard on an embedded Linux system running Ubuntu 18.04, kernel 5.4.0-52-generic.

            This elinux page indicates that j1939.h "got in the mainline kernel since v5.4". And kernel.org's documentation for j1939 implies that it is in the main kernel.

            Lastly, I do have can-utils installed.

            When I compile a cpp file with #include , I get a no such file or directory error.

            I've gone through linux/can directory to confirm and j1939.h is not there. Is there any reason why my v5.4 kernel wouldn't have j1939.h? How can I best use j1939.h in my program?

            ...

            ANSWER

            Answered 2020-Oct-28 at 21:55

            You need development packages for these headers. You can search for which package you need on the Ubuntu Packages site. I.e. in this case packages containing j1939.h. You're probably looking for linux-libc-dev or linux-headers-5.4.0-26.

            Source https://stackoverflow.com/questions/64581838

            QUESTION

            Candump - candumpanalyzer : command not found
            Asked 2020-Aug-15 at 10:35

            Operating System: Rasbian

            I am trying to follow this https://www.npmjs.com/package/@canboat/canboatjsto to use the following command : candump can0 | candumpanalyzer. However, after trying all these commands:

            ...

            ANSWER

            Answered 2020-Aug-15 at 10:35

            If you go to your node_modules directory and run the following command:

            find -name "candump*"

            You will get the following result:

            Source https://stackoverflow.com/questions/63424518

            QUESTION

            Linking issue using the Yocto SDK (undefined reference to `_rtld_global_ro')
            Asked 2020-Jul-15 at 16:39

            I'm trying to build an application using the Yocto SDK. The compilation worked well, but when it comes to linking, following linker errors occurs:

            ...

            ANSWER

            Answered 2020-Jul-15 at 16:39

            This is an issue in the upstream glibc sources: The ARM assembler version of setcontext assumes that all PIC code is dynamic linked, which means that static linking fails if glibc was built in static PIE mode (because that actives PIC without providing the dynamic linker code).

            You either need to build glibc without static PIE support (I did not even know this was a supported configuration for 32-bit ARM), or replace the PIC macro with SHARED in sysdeps/unix/sysv/linux/arm/setcontext.S.

            Source https://stackoverflow.com/questions/62896208

            QUESTION

            candump utility not printing leading zeros for data length on non-FD frames?
            Asked 2019-Aug-26 at 08:11

            I'm writing a CAN driver and want to set up some tests for it. I have a simple echo program (accepts a can frame and echoes it back). I'm using can-utils for this and would use cangen to generate random data, log it, then make sure the frames were received and echoed back.

            Everything seems to be working but there is some annoying behavior from candump. When sending non-FD frames, it does not print a leading zero for the DLC. See here (messages are sent, and then the echoed message - yes I'm aware it shouldn't use the same node id to echo back this is just for testing purposes):

            ...

            ANSWER

            Answered 2019-Aug-26 at 08:11

            No this is intentional to distinguish Classic CAN [x] from CAN FD [xx] frames in the human readable output. It is not the question whether the DLC (4 bit on the physical layer) to be the same, as we always operate with the real length information and not with the DLC on socket level. And when both are 5 bytes you wont be able to distinguish them.

            Btw. your CAN driver seems to have an issue, when the echo'ed frame is always a CAN FD type - no matter what has been sent (Classic CAN / CAN FD) ...

            Source https://stackoverflow.com/questions/57630731

            QUESTION

            How to get CANbus working on beaglebone green
            Asked 2019-Aug-05 at 01:40

            I am having trouble getting CAN working on my beaglebone green using can-utils. I have a bitscope hooked up to the CAN pins but I'm not seeing any output..

            Beaglebone version: ...

            ANSWER

            Answered 2019-Aug-05 at 01:40

            Thanks to Benoît for the suggestion:

            I had to terminate pins p9.24 and p9.26 with a 120 Ohm resistor In order to get any messages to display on my bitscope.

            If the canbus is not terminated, the can interface will fail and any messages transmits will not work. The can interface will need to be set down and up again to be able to try sending another message.

            Source https://stackoverflow.com/questions/57320542

            QUESTION

            Is it possible to imitate arbitration on CAN bus?
            Asked 2019-Aug-01 at 00:35
            Setup

            I have two nodes connected to one CAN bus. The first node is a black-box, controlled by some real-time hardware. The second node is a Linux machine with attached PEAK-USB CAN controller:

            ...

            ANSWER

            Answered 2019-Jul-19 at 08:32

            From the documentation subsection 4.1.2 RAW socket option CAN_RAW_ERR_FILTER, it says that the errors are by default not activated which is why the lost arbitration field in ip was not increasing.

            In order to toggle on all the errors, you need to add those two lines :

            Source https://stackoverflow.com/questions/57089352

            QUESTION

            Problems with sending EFF 29bit ID message over socketCAN
            Asked 2019-Apr-03 at 16:11

            I am trying to send 29bit EFF CAN messages over socket can, but for some reason it sends them with 11bit identifier cutting off 5 bytes from ID. Using loopback mode, through candump i can see that messages are received as 11bit.

            I get no errors, nothing, thats why i am confused

            I am using raspberry pi 3b+ if that makes any difference. And Can-utils library.

            ...

            ANSWER

            Answered 2019-Apr-03 at 16:11

            You need to add correct flag after setting can_id:

            Source https://stackoverflow.com/questions/55499470

            QUESTION

            How to write a parent program that is using other C programs?
            Asked 2019-Jan-25 at 13:01

            I am making a can-bus network that will survey some sensors to gather data in order to have better understanding of an environment that we want to analyse and control. In order to do so we use candump to monitor traffic and can send to sen information (from CAN-BUS files that can be find in this address: https://github.com/linux-can/can-utils.git). I modified some of the codes and they compile well, now what I want to do is to make a parent code that can orchestrate this C programs in order to control the environment. I want to use python or c++ to do this.

            Example Algorithm

            ...

            ANSWER

            Answered 2019-Jan-25 at 13:01

            You can use std::system to run the other programs.

            Something like:

            Source https://stackoverflow.com/questions/54365522

            QUESTION

            How to connect two VCAN ports in Linux?
            Asked 2019-Jan-22 at 08:58

            I have set up two vcan devices and I want to treat them as if they were connected together. I want to be able to use can-utils candump to listen on one line, and send can messages from the other. How can I do that without a physical device?

            For clarification, I am writing software to communicate over CAN which I am already capable of, but to facilitate the actual data gathering and further development, I need two can enabled devices to communicate with each other. While a simple solution in the real world, solved by physically connecting devices together, I need a programmatic solution that will work on the computer.

            ...

            ANSWER

            Answered 2019-Jan-22 at 08:58

            Add the can gateway kernel module:

            Source https://stackoverflow.com/questions/54296852

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install can-utils

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/linux-can/can-utils.git

          • CLI

            gh repo clone linux-can/can-utils

          • sshUrl

            git@github.com:linux-can/can-utils.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link