25.08.2017

CAN:

image

Ford Fusion CAN.

: Ariel Nuñez
Ford Fusion CAN.

1: ?
Voyage Ford Fusion. Voyage . : , . Voyage , , .
CAN
, - -. , , , ( ), , , , , . . . 1983 Bosch CAN (Controller Area Network; ) .
, CAN , . , , .

2: CAN 1988 8
CAN
, , CAN . ? , , , .
CAN, , . , , , .

3: LIDAR ( )
LIDAR (light detecting and ranging; ) . CAN , .
. Voyage Ford Fusion ( ).
CAN Ford Fusion
Ford Fusion The Car Hackers Handbook. 2, : , CAN CAN-.
CAN
CAN 1994 2008 ( 2001 ). : CAN high (CANH) CAN low (CANL). CAN , , , . , , , .

4: CAN,
, , CAN, . 4 :

  • ID (ArbitrationID) , , . ID. CAN-, , ID.
  • (Identifierextension; IDE) CAN 0.
  • (Datalengthcode; DLC) , 0 8 .
  • . , CAN, 8 . 8 .


5: CAN-
CAN
/ CAN ( ). Ford Fusion 4 . 3 500 / (High Speed CAN; HS) 1 125 / (Medium Speed CAN; MS).
OBD-II HS1 HS2, , . Voyage OBD-II (HS1, HS2, HS3 MS). OBD-II (Gateway Module).

6: Homer Voyage
- (SYNC), (MS).
CAN- SocketCAN, Volkswagen Linux.
(GND, MSCANH, MSCANL) Kvaser Leaf Light HSv2 ( 300$ ) CANable ( 25$ Tindie) Linux- CAN .

modprobe can
modprobe kvaser_usb
ip link set can0 type can bitrate 1250000
ifconfig can0 up

candump can0 :

can0 33A [8] 00 00 00 00 00 00 00 00 can0 415 [8] 00 00 C4 FB 0F FE 0F FE can0 346 [8] 00 00 00 03 03 00 C0 00 can0 348 [8] 00 00 00 00 00 00 00 00 can0 167 [8] 72 7F FF 10 00 19 F8 00 can0 3E0 [8] 00 00 00 00 80 00 00 00 can0 167 [8] 72 7F FF 10 00 19 F7 00 can0 34E [8] 00 00 00 00 00 00 00 00 can0 358 [8] 00 00 00 00 00 00 00 00 can0 3A4 [8] 00 00 00 00 00 00 00 00 can0 216 [8] 00 00 00 00 82 00 00 00 can0 3AC [8] FF FF FF FF FF FF FF FF can0 415 [8] 00 00 C8 FA 0F FE 0F FE can0 083 [8] 00 00 00 00 00 01 7E F4 can0 2FD [8] D4 00 E3 C1 08 52 00 00 can0 3BC [8] 0C 00 08 96 01 BB 27 00 can0 167 [8] 72 7F FF 10 00 19 F7 00 can0 3BE [8] 00 20 AE EC D2 03 54 00 can0 333 [8] 00 00 00 00 00 00 00 00 can0 42A [8] D6 5B 70 E0 00 00 00 00 can0 42C [8] 05 51 54 00 90 46 A4 00 can0 33B [8] 00 00 00 00 00 00 00 00 can0 42E [8] 93 00 00 E1 78 03 CD 40 can0 42F [8] 7D 04 00 2E 66 04 01 77 can0 167 [8] 72 7F FF 10 00 19 F7 00 can0 3E7 [8] 00 00 00 00 00 00 00 00 can0 216 [8] 00 00 00 00 82 00 00 00 can0 415 [8] 00 00 CC F9 0F FE 0F FE can0 3A5 [8] 00 00 00 00 00 00 00 00 can0 3AD [8] FF FF FF FF FF FF FF FF can0 50B [8] 1E 12 00 00 00 00 00 00

, , , , - . , cansniffer. Cansniffer CAN-. , ID, .
, cansniffer MS. , 355, 356 358. , , 001C00000000.

7: MS, cansniffer
, . ROS (Robot Operating System; ). SocketCAN, socketcan_bridge CAN- , ROS.
:

if frame.id == 0x356:
raw_data = unpack('BBBBBBBB', frame.data)
fan_speed = raw_data[1] / 4
driver_temp = parse_temperature(raw_data[2:4])
passenger_temp = parse_temperature(raw_data[4:6])

CelsiusReport.msg:

bool auto
bool system_on
bool unit_on
bool dual
bool max_cool
bool max_defrost
bool recirculation
bool head_fan
bool feet_fan
bool front_defrost
bool rear_defrost
string driver_temp
string passenger_temp

, :

CONTROL_CODES = {
'ac_toggle': 0x5C,
'ac_unit_toggle': 0x14,
'max_ac_toggle': 0x38,
'recirculation_toggle': 0x3C,
'dual_temperature_toggle': 0x18,
'passenger_temp_up': 0x24,
'passenger_temp_down': 0x28,
'driver_temp_up': 0x1C,
'driver_temp_down': 0x20,
'auto': 0x34,
'wheel_heat_toggle': 0x78,
'defrost_max_toggle': 0x64,
'defrost_toggle': 0x4C,
'rear_defrost_toggle': 0x58,
'body_fan_toggle': 0x04,
'feet_fan_toggle': 0x0C,
'fan_up': 0x2C,
'fan_down': 0x30,
}

ROS , :

rostopic pub /celsius_control celsius/CelsiusControl ac_toggle


CAN, , , , .

8:
Voyage. . , Voyage.

comments powered by Disqus