Difference between revisions of "CANbus Module"
Jump to navigation
Jump to search
| (5 intermediate revisions by the same user not shown) | |||
| Line 3: | Line 3: | ||
<!-- --> | <!-- --> | ||
<div style="float:right">__TOC__</div> | <div style="float:right">__TOC__</div> | ||
| − | |||
| − | |||
'''''Input:''''' None<br /> | '''''Input:''''' None<br /> | ||
'''''Output:''''' Device driver is available | '''''Output:''''' Device driver is available | ||
| + | |||
| + | [[File:CANbus.png|500px]] | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
root@imx8mq-voipac:~# ip addr show dev can0 | root@imx8mq-voipac:~# ip addr show dev can0 | ||
| − | + | 1: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN group default qlen 10 | |
| − | link/can | + | link/can |
| − | + | </syntaxhighlight> | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | </syntaxhighlight | ||
| − | + | To setup can interface to 500kB bitrate use following command: | |
| − | + | <syntaxhighlight lang="bash"> | |
| + | ip link set can0 up type can bitrate 500000 | ||
| + | </syntaxhighlight> | ||
| − | + | To test send data use following command: | |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
| − | + | cansend can0 365#AA.11.11 | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
</syntaxhighlight> | </syntaxhighlight> | ||
| − | + | To test receiving data use following command: | |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
| − | + | candump can0 | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
</syntaxhighlight> | </syntaxhighlight> | ||
| + | |||
| + | [[File:CANbus log.png]] | ||
Latest revision as of 21:12, 11 February 2025
Input: None
Output: Device driver is available
root@imx8mq-voipac:~# ip addr show dev can0
1: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN group default qlen 10
link/can
To setup can interface to 500kB bitrate use following command:
ip link set can0 up type can bitrate 500000
To test send data use following command:
cansend can0 365#AA.11.11
To test receiving data use following command:
candump can0
