Only this pageAll pages
Powered by GitBook
1 of 3

ReXgen SocketCAN Driver

Loading...

Loading...

Loading...

SocketCAN Installation on Ubuntu

  1. Install git

  1. Clone the repository https://github.com/InfluxTechnology/rexgen-socketcan.git

    git clone https://github.com/InfluxTechnology/rexgen-socketcan.git

  2. Install gcc

  1. Install make

  1. Install can-utils

    This will install the necessary tools to acquire CAN data using SocketCAN

  1. Open the rexgen-socketcan folder

  2. Load the can-dev module

  1. Run the do_make.sh script

  1. Ignore any Warnings

  2. Plugin the ReXgen Device

  3. Reboot the device

Using SocketCAN

  1. Before you can send and receive data, you need to configure the interface. To do this, you can use the 'ip' tool. For example, if you want to set the bitrate of 500Kbit (500000 bit) to the can0 interface, you can do this with

    "sudo ip link set can0 type can bitrate 500000"

    If you need to set CAN FD with a bitrate of 500Kbit and a data bitrate of 8Mbit

    "sudo ip link set can0 type can bitrate 500000 dbitrate 8000000 fd on"

    We support loopback mode and listen-only mode. Typical socket can syntax is

    "sudo ip link set can0 type can bitrate 500000 dbitrate 8000000 fd on loopback on|off"

    "sudo ip link set can0 type can bitrate 500000 dbitrate 8000000 fd on listen-only on|off"

sudo apt-get install git
We also support CANFD non-ISO mode via fd-non-iso on|off
  • Now the bitrate is set, and you can start the interface by typing

    "sudo ip link set can0 up"

  • After this, you can send and receive data on CAN0. At the beginning, you may want to check some small communications. To do this, you could use the tools from "can-utils". For example, you could try to send data with

    "cansend can0 123#112233" - Simple CAN message

    "cansend can0 00000123#112233" - CAN message with ID Extended (IDE)

    "cansend can0 123##0112233" - Simple CANFD message

    "cansend can0 123##1112233" - CANFD message (EDL) with BRS flag

    "cansend can0 00000123##1112233" - CANFD message (EDL) with BRS flag and IDE

    and receive it with

    "candump can0"

    or

    "candump can0 -x" for extra details

    A prerequisite for this is a connected and properly configured bus with at least two communication partners.

  • sudo apt-get install gcc
    sudo apt-get install make    
    sudo apt-get install can-utils
    sudo modprobe can-dev
    sudo ./do_make.sh

    SocketCAN Installation on Raspberry PI OS

    1. Clone the repository

    git clone

    1. Install raspberrypi-kernal-headers

    Install can-utils

    This will install the necessary tools to acquire CAN data using SocketCAN

    1. Open the rexgen-socketcan folder

    2. Load the can-dev module

    1. Run the do_make.sh script

    1. Ignore any Warnings

    2. Plugin the ReXgen Device

    3. Reboot the device

    Using Socket CAN

    1. Before you can send and receive data, you need to configure the interface. To do this, you can use the 'ip' tool. For example, if you want to set the bitrate of 500Kbit (500000 bit) to the can0 interface, you can do this with

      "sudo ip link set can0 type can bitrate 500000"

      If you need to set CAN FD with a bitrate of 500Kbit and data bitrate of 8Mbit

      "sudo ip link set can0 type can bitrate 500000 dbitrate 8000000 fd on"

      We support loopback mode and listen-only mode. Typical socket can syntax is

      "sudo ip link set can0 type can bitrate 500000 dbitrate 8000000 fd on loopback on|off"

      "sudo ip link set can0 type can bitrate 500000 dbitrate 8000000 fd on listen-only on|off"

      We also support CANFD non-ISO mode via fd-non-iso on|off

    2. Now the bitrate is set, and you can start the interface by typing

      "sudo ip link set can0 up"

    3. After this, you can send and receive data on CAN0. At the beginning, you may want to check some small communications. To do this, you could use the tools from "can-utils". For example, you could try to send data with

      "cansend can0 123#112233" - Simple CAN message

      "cansend can0 00000123#112233" - CAN message with ID Extended (IDE)

      "cansend can0 123##0112233" - Simple CANFD message

      "cansend can0 123##1112233" - CANFD message (EDL) with BRS flag

      "cansend can0 00000123##1112233" - CANFD message (EDL) with BRS flag and IDE

      and receive it with

      "candump can0"

    https://github.com/InfluxTechnology/rexgen-socketcan.git
    https://github.com/InfluxTechnology/rexgen-socketcan.git

    Influx Technology LTD - ReXgen SocketCAN Driver for linux

    About SocketCAN Driver

    The SocketCAN driver allows you to use ReXgen devices as CAN interfaces within your socketCAN-based applications. For further information on SocketCAN, see https://www.kernel.org/doc/Documentation/networking/can.txt

    Getting started

    Prerequisites: Make sure the following is installed before proceeding:

    1. make

    2. gcc

    3. can-utils is required to use commands like candump/cansend etc

    Make sure the can-dev module is loaded properly. You can check this with "lsmod | grep can-dev." If it is not loaded yet, you can do this with

    "sudo modprobe can-dev"

    Building and installing the driver while starting the script

    "sudo ./do_make.sh"

    Using SocketCAN

    1. Before you can send and receive data, you need to configure the interface. To do this, you can use the 'ip' tool. For example, if you want to set the bitrate of 500Kbit (500000 bit) to the can0 interface, you can do this with "sudo ip link set can0 type can bitrate 500000"

      If you need to set CAN FD with a bitrate of 500Kbit and data bitrate of 8Mbit "sudo ip link set can0 type can bitrate 500000 dbitrate 8000000 fd on"

      We support loopback mode and listen-only mode. Typical socket can syntax is "sudo ip link set can0 type can bitrate 500000 dbitrate 8000000 fd on loopback on|off" "sudo ip link set can0 type can bitrate 500000 dbitrate 8000000 fd on listen-only on|off"

      We also support CANFD non-ISO mode via fd-non-iso on|off

    2. Now the bitrate is set, and you can start the interface by typing

    For more details, visit our .

    sudo apt-get install raspberrypi-kernel-headers
    sudo apt-get install can-utils
    sudo modprobe can-dev
    sudo ./do_make.sh
    or

    "candump can0 -x" for extra details

    As a prerequisite for this is a connected and properly configured bus with at least two communication partners

    "sudo ip link set can0 up"
  • After this, you can send and receive data on CAN0. At the beginning, you may want to check some small communications. To do this, you could use the tools from "can-utils". For example, you could try to send data with

    "cansend can0 123#112233" - Simple CAN message "cansend can0 00000123#112233" - CAN message with ID Extended (IDE) "cansend can0 123##0112233" - Simple CANFD message "cansend can0 123##1112233" - CANFD message (EDL) with BRS flag "cansend can0 00000123##1112233" - CANFD message (EDL) with BRS flag and IDE

    and receive it with

    "candump can0" or "candump can0 -x" for extra details

    A prerequisite for this is a connected and properly configured bus with at least two communication partners.

  • GitHub