====== Caring Caribou ====== [[https://github.com/CaringCaribou/caringcaribou|Caring Caribou auf Github]] Vorrausetzung für den Raspi sind: * CAN-Interfaces funktionieren * python3 * python-can * sonstiges kann auch nicht schaden: * python -m pip install --upgrade setuptools * python -m pip install --upgrade python-can * DoIP Note: This module requires the packages doipclient and udsoncan, which only support Python 3.6+. These can be installed through $ pip install doipclient udsoncan. If your system uses Python 2 as default python interpreter, you may have to use $ pip3 install doipclient udsoncan or $ python3 -m pip install doipclient udsoncan (and make sure to run Caring Caribou through python3) instead. ===== Installation ===== - git clone https://github.com/CaringCaribou/caringcaribou.git - CAN-Hardware zum Laufen bringen (s. [[:pi3_tipps|Raspi 3 - MCP-2515 - (SPI) CAN Support]]) - python3 installieren (sollte eigentlich auch mit 2 gehen. Ich habe nur 3 probiert) - python-can installieren pip3 install python-can - Default Konfiguration für Python-CAN anlegen. cat ~/.canrc [default] interface = socketcan_native // Achtung in neuere Socketcan 2.2 (python-can 4.1) wieder ohne native!!!! channel = can0 Nach der erfolgreichen Installation kann man es Testen, in dem man in das "Tool" Verzeichnis von Caring Caribou wechselt und cd /home/pi/dev/caringcaribou/tool python3 cc.py dump ------------------- CARING CARIBOU v0.3 ------------------- Loaded module 'dump' Dumping CAN traffic (press Ctrl+C to exit) Timestamp: 1549719604.410814 ID: 0221 S DLC: 5 12 34 56 78 87 Channel: can0 Timestamp: 1549719604.910661 ID: 0221 S DLC: 5 12 34 56 78 87 Channel: can0 eingibt. Wenn jetzt CAN-Botschaften angezeigt werden, ist alles in Ordnung. ===== Tipps / Beispiele ===== ==== OBD-Scanning ==== python3 cc.py dcm discovery -min 0x700 -nostop # versucht ab 0x700..0x7FF eine Diagnositzung zu öffenen danach kann man dan veruchen welche Service unterstützt werden:python3 cc.py dcm services 0x773 0x7DD - besser wäre hier aber die Broadcast 7DF bzw Motor-ECU 7E0 mit response ID 7E8 oder mit uds_fuzz arbeiten. python3 cc.py uds_fuzz delay_fuzzer 100311022701 0x03 0x773 0x7DD #1003, 1102, 2701 Request senden Eigenes Python Skript um alle Anfrage zu senden:cat obd_pid_scan_andi.py #!/usr/bin/python3 import can import time # wenn man zyklish was senen will # scand PIDs ohne die Support Adressen bus = can.interface.Bus(bustype='socketcan', channel='can0', bitrate=500000) msg = can.Message(arbitration_id=0x7E0, data=[2, 1, 0, 0, 0, 0, 0, 0], extended_id=False) bus.send(msg) for i in range(256): if ( ((i%0x20)==0)): print ( "ID: 0x%03X not send (supported IDs)" % (i)) continue msg.data[2]=i bus.send(msg) print(msg) time.sleep(0.1) print("fertig") Dies Skript starten und schauen was candump: candump -L can0,7E8:7FF anzeigt.\\ Hinweis die Anfrage nach den Supported IDs wird unterdrückt. DCM ist veraltet, dafür gibt es jetzt die UDS-Module: * UDS: * ./cc.py uds discovery # über alle Ids probieren eine Diagnosesitzung zu öffnen => xxx | 02 10 01 00 00 00 00 00 ........ * ./cc.py uds services 0x7E0 0x7E8 # alle möglichen Service IDs scannen * UDS_FUZZ VIN anfordern entweder über Service 09 oder über UDS-Anfrage: 03 22 F1 91 (Pam America) ==== Links ==== Hmm, warum ist es jetzt hier auch: [[https://githubmemory.com/index.php/repo/CaringCaribou/caringcaribou]]