INNO USB-CAN MODULE User manual

Design Service,Production Service
www.inno-maker.com
Support: support@inno-maker.com www.inno-maker.com/wiki
Bulk Price: sales@inno-maker.com
2
General Description:
USB-CAN module is a “plug and play ” and bi-directional port powered USB to CAN converter
which realizes long-distance communication between your Raspberry Pi and other devices stably
though CAN- Bus connection.
With small size and convenient operation, It’s a cost-effective solution that are safe and reliable
for all your data-conversion / device-protection applications for any experienced engineer
interfacing to expensive industrial equipment yet simple enough for home use by an amateur
hobbyist.
Features:
1. Compatible with Raspberry Pi Zero/Zero W/2B/3B/3B+.
2. Full support for CAN bus 2.0A and 2.0B specification.
3. Elimination the need for software drivers when you run Debian9 system of Raspberry Pi.
4. Comes with demos of Socket CAN, save your development time.
5. “plug and play” (hot-pluggable) USB device ,no external power required.
6. On board high-speed STM32 microcontroller, stronger data processing ability and lower power
consumption.
6.Wider CAN baud rate, 20Kbps----1Mpbs can be programmed arbitrarily.
7. Power supply and signal isolation ,Built-in surge and static protection.
8. 120 Ohm selectable jumper feature.

Design Service,Production Service
www.inno-maker.com
Support: support@inno-maker.com www.inno-maker.com/wiki
Bulk Price: sales@inno-maker.com
4
Software Description
1. CAN Communication Test Demo
Run demo for two Raspberry Pi:
(1) Prepare two USB-CAN module and two Raspberry Pi board. Connect the H and L port of
USB-CAN module to other’s port, and then insert into the USB Host of Raspberry PI board.
(2) Down the the demo image from INNO wiki page:
http://www.inno-maker.com/wiki/doku.php?id=usb_can
Or http://www.inno-maker.com/wiki/
Note :You must use a TF card at least than 16Gb, Otherwise it will write failed.
(3) Execute commands to visited the test demo.
(4) Execute following commands in serial terminal. You should see the “can 0” socket can device.
ifconfig –a
(5) Set one Pi as receiver, execute following commands in serial terminal. Now this Raspberry pi
is blocked.
./can0_receive

Design Service,Production Service
www.inno-maker.com
Support: support@inno-maker.com www.inno-maker.com/wiki
Bulk Price: sales@inno-maker.com
6
Run demo for only one Raspberry Pi:
In this case, you also can insert two USB-CAN module into a Raspberry PI board to test. You
should see two can socket “can 0” and “can 1” devices. So notice that you need to modify the
code to change “can 0” to “can 1” when you use “can 1” device.

Design Service,Production Service
www.inno-maker.com
Support: support@inno-maker.com www.inno-maker.com/wiki
Bulk Price: sales@inno-maker.com
7
2. Linux C Programing
Now with previous demo’s code to show you how to program socket can in linux. The socket
can is an implementation of CAN protocols(Controller Area Network) for Linux. CAN is a
networking technology which has widespread use in automation, embedded devices, and
automotive fields. While there have been other CAN implementations for Linux based on
character devices, Socket CAN uses the Berkeley socket API, the Linux network stack and
implements the CAN device drivers as network interfaces. The CAN socket API has been designed
as similar as possible to the TCP/IP protocols to allow programmers, familiar with network
programming, to easily learn how to use CAN sockets.
(1) Preparations:
Elimination the need for software drivers when you run Debian9 system of Raspberry
Pi.(2018-06-27-raspbian-stretch.img is validated already)or later.
If you meet problems in other system, You need to reconfigure the kernel drivers. Enable
gs_usb can and install gs_usb.ko into system. So notice that if you only compile this drivers, It
may fail to load in system. At this time, compile fully with new configure.
The compiled firmware with LINUX -4.14.50 version is available from our wiki link as below:
http://www.inno-maker.com/wiki/doku.php?id=usb_can
Or http://www.inno-maker.com/wiki/
Note :You must use a TF card at least than 16Gb, Otherwise it will write failed.
(2) For Sender’s code:
Step 1: Create the socket, If an error occurs then the return result is -1.

Design Service,Production Service
www.inno-maker.com
Support: support@inno-maker.com www.inno-maker.com/wiki
Bulk Price: sales@inno-maker.com
8
Step 2: Locate the interface to “can0” or other name you wish to use. The name will show when
you execute “./ifconfig –a”.
Step 3: Bind the socket to “can0”.
Step 4: Disable sender’s filtering rules,this program only send message do not receive packets.
Step 5: Assembly data to send.

Design Service,Production Service
www.inno-maker.com
Support: support@inno-maker.com www.inno-maker.com/wiki
Bulk Price: sales@inno-maker.com
9
Step 6: Send message to the can bus.You can use the return value of write() to check whether all
data has been sent successfully .
Step 7: Close can0 device and disable socket.
(3) For Receiver’code:
step 1 and step 2 is same as Sender’s code.
step 3:It’s different from Sender’s.

Design Service,Production Service
www.inno-maker.com
Support: support@inno-maker.com www.inno-maker.com/wiki
Bulk Price: sales@inno-maker.com
10
Step 4:Define receive filter rules,we can set more than one filters rule。
Step 5: Read data back from can bus.
For more Socket CAN detail please refer to below link:
https://www.kernel.org/doc/Documentation/networking/can.txt
Version Descriptions
Version
Description
Author
Date
E-mail
V1.0.0.0
First edition
Calvin
2019.01.015
calvin@inno-maker.com
If you have any suggestions,ideas, codes and tools please feel free to email to me. I will update
the user manual and record your name and E-mail in list. Look forward to your letter and kindly
share.
Table of contents
Popular Control Unit manuals by other brands

Rasmussen
Rasmussen RPK1-N Assembly, installation and operation instructions

Val-Matic
Val-Matic 48A Operation, maintenance and installation manual

VIPA
VIPA SLIO System FM 050-1BA10 manual

Sierra Wireless
Sierra Wireless AirPrime AR7594 Hardware integration guide

c.a.p.t.
c.a.p.t. 1.12.310 instructions

Vega
Vega VEGABAR series 80 operating instructions

White Rodgers
White Rodgers 50T35-743 installation instructions

Redpine Signals
Redpine Signals RS9113DB user manual

Hirschmann
Hirschmann PRS 80 Operators & service manual

Yoshitake
Yoshitake GP-1000 Installation & operation manual

Growatt
Growatt ShineWiFi-X Configuration guide

M-system
M-system R3-NF2 instruction manual