Difference between revisions of "AFE-E630 CAN0"

From ESS-WIKI
Jump to: navigation, search
 
Line 17: Line 17:
 
=== '''Send and Receive Data(Please prepare two AFE-E630)''' ===
 
=== '''Send and Receive Data(Please prepare two AFE-E630)''' ===
  
'''Mode of connection:(D+ to D+、D- to D-、GND to GND)'''
+
'''Mode of connection:'''(D+ to D+、D- to D-、GND to GND)
  
[[File:AFE-E630 CAN0 send and receive.png]]
+
[[File:AFE-E630 CAN0 send and receive.png|RTENOTITLE]]
 
 
*
 
=== As receiver ===
 
  
 +
*'''As receiver'''
 
<pre># #---- As receiver ----# #
 
<pre># #---- As receiver ----# #
 
# ip link set can0 down
 
# ip link set can0 down
Line 31: Line 29:
 
</pre>
 
</pre>
  
*As sender  
+
*'''As sender'''
 
<pre># #---- As sender ----# #
 
<pre># #---- As sender ----# #
 
# ip link set can0 down
 
# ip link set can0 down
Line 42: Line 40:
 
</pre>
 
</pre>
  
See more details of the usage of “candump” and “cansend” :
+
See more details of the usage of “candump” and “cansend”&nbsp;:
 
<pre># candump --help  
 
<pre># candump --help  
 
# cansend --help
 
# cansend --help
 
</pre>
 
</pre>
  
[[File:AFE-E630 CAN0 send and receive 1.png]]
+
[[File:AFE-E630 CAN0 send and receive 1.png|RTENOTITLE]]

Latest revision as of 09:38, 17 December 2024

AFE-E630 has one CAN port.

Use the “candump” and “cansend” tools directly to send and receive messages. The tools have been embedded into the system.

RTENOTITLE

# ifconfig -a
......
can0: flags=193<UP,RUNNING,NOARP> mtu 16
      unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC)
      RX packets 0 bytes 0 (0.0 B)
      RX errors 0 dropped 0 overruns 0 frame 0
      TX packets 0 bytes 0 (0.0 B)
      TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
... ...

Send and Receive Data(Please prepare two AFE-E630)

Mode of connection:(D+ to D+、D- to D-、GND to GND)

RTENOTITLE

  • As receiver
# #---- As receiver ----# #
# ip link set can0 down
# ip link set can0 type can bitrate 1000000 dbitrate 2000000 fd on
# ip link set can0 up
# candump can0 &
  • As sender
# #---- As sender ----# #
# ip link set can0 down
# ip link set can0 type can bitrate 1000000 dbitrate 2000000 fd on
# ip link set can0 up
# cansend can0 123##155

# #----If no error, the receiver will receive the following data----# #
Can0 123 [01] 55

See more details of the usage of “candump” and “cansend” :

# candump --help 
# cansend --help

RTENOTITLE