{"id":13741061,"url":"https://github.com/alexmohr/usb-can","last_synced_at":"2025-05-08T21:32:15.142Z","repository":{"id":43070942,"uuid":"163228777","full_name":"alexmohr/usb-can","owner":"alexmohr","description":"USB-CAN Analyzer Linux Support","archived":false,"fork":true,"pushed_at":"2023-05-22T22:45:32.000Z","size":387,"stargazers_count":36,"open_issues_count":10,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-04T04:07:22.900Z","etag":null,"topics":["can","can-bus","canbus","driver","drivers","hl-340","kernel-driver","kernel-module","linux","qinheng-electronics","usb-id-1a86-7523"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"kobolt/usb-can","license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexmohr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-27T00:32:20.000Z","updated_at":"2024-05-19T11:48:06.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/alexmohr/usb-can","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexmohr%2Fusb-can","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexmohr%2Fusb-can/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexmohr%2Fusb-can/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexmohr%2Fusb-can/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexmohr","download_url":"https://codeload.github.com/alexmohr/usb-can/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224774587,"owners_count":17367760,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["can","can-bus","canbus","driver","drivers","hl-340","kernel-driver","kernel-module","linux","qinheng-electronics","usb-id-1a86-7523"],"created_at":"2024-08-03T04:00:55.028Z","updated_at":"2024-11-15T11:30:49.443Z","avatar_url":"https://github.com/alexmohr.png","language":"C","funding_links":[],"categories":["Utils"],"sub_categories":["Other Utils"],"readme":"[![Build Status](https://travis-ci.org/alexmohr/usb-can.svg?branch=master)](https://travis-ci.com/alexmohr/usb-can)\n# USB-CAN Analyzer Linux Support\nThis repository implements a kernel module which adds support for QinHeng Electronics HL-340 USB-Serial adapter\nIt is based on the works https://github.com/kobolt/usb-can and the linux slcan driver.\n\nAdapters like the one below are supported\n\n![alt text](USB-CAN.jpg)\n\nThe adapters can be found everywhere on Ebay nowadays, but there is no official Linux support. Only a Windows binary file [stored directly on GitHub](https://github.com/SeeedDocument/USB-CAN_Analyzer).\n\nWhen plugged in, it will show something like this:\n```\nBus 002 Device 006: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter\n```\nAnd the whole thing is actually a USB to serial converter, for which Linux will provide the 'ch341-uart' driver and create a new /dev/ttyUSB device. So this program simply implements part of that serial protocol.\n\n## Requirements\n* can-utils\n* kernel-headers (i.e. sudo apt install linux-headers-$(uname -r))\n\n**Please note that this module cannot be used together with slcan, make sure the module is not loaded and won't be loaded automatically!**\n\n## Building \u0026 Installation\nTo build the module and the userspace tools run ``make`` in ``src`` and ``src/modules`` or run\n````\n./build.sh\n````\n\nIf you need to sign the module, on Ubuntu machines you can run something like\n\n````\nkmodsign sha512 /var/lib/shim-signed/mok/MOK.priv /var/lib/shim-signed/mok/MOK.der src/module/hlcan.ko\n````\n\nTo install run ``make install`` in the folders listed above or \n\n````\n./build.sh install\n````\n\nor to remove \n````\n./build.sh remove\n````\n\n\n## Usage\nLoad the kernel module \n````\nmodprobe can-dev\ninsmod hlcan.ko\n````\n\nStart hlcand\nListen only \n````\nhlcand -m 2 -s 500000 /dev/ttyUSB0\n````\n\nForeground\n````\nhlcand -F -s 500000 /dev/ttyUSB0\n````\n\nExtended Frames\n````\nhlcand -e -s 500000 /dev/ttyUSB0\n````\n\nEnable the interface\n````\nip link set can0 up\n````\n\nHelp \n````\nUsage: ./hlcand [options] \u003ctty\u003e [canif-name]\n\nOptions: -l         (set transciever to listen mode)\n         -s \u003cspeed\u003e (set CAN speed in bits per second)\n         -S \u003cspeed\u003e (set UART speed in baud)\n         -e         (set interface to extended id mode)\n         -F         (stay in foreground; no daemonize)\n         -m \u003cmode\u003e  (0: normal (default), 1: loopback, 2:silent, 3: loopback silent)\n         -h         (show this help page)\n\nExamples:\nhlcand -m 2 -s 500000 /dev/ttyUSB0\n````\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexmohr%2Fusb-can","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexmohr%2Fusb-can","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexmohr%2Fusb-can/lists"}