CanBusHack / 2017carhackingvillagebadge

Def Con 2017 Car Hacking Village Badge
GNU General Public License v3.0
44 stars 10 forks source link

Is this repo also for the CHV "Small Con" badge? #3

Open pdp7 opened 6 years ago

pdp7 commented 6 years ago

I have the Car Hacking Village "Small Con" badge (QCM-BDG-SMALL-2017). Is this the correct repo to find the source code for that badge?

I would like to be able to change the text that is displayed on the LED matrix.

pdp7 commented 6 years ago

fyi - this the entry from lsusb when I connect the badge:

Bus 001 Device 014: ID 0483:580d STMicroelectronics 
pdp7 commented 6 years ago

I also would like to be able to use the "Small Con" badge as SocketCAN adapter.

I found CHVBadge_16 socketbadge.

I compiled socketbadge and received this runtime error:

pdp7@sp3:~/dev/chv/badge/CHVBadge_16/socketbadge$ sudo ./bin/socketbadge -0 vcan0 -1 vcan1
Attempting to open USB device with VID:PID 0483:580C
libusb_open_device() failed

I noticed the Device ID was different than my "Small Con" 2017 badge. I made this change:

diff --git a/socketbadge/socketbadge.c b/socketbadge/socketbadge.c
index 1fe7e19..adf4174 100644
--- a/socketbadge/socketbadge.c
+++ b/socketbadge/socketbadge.c
@@ -25,7 +25,7 @@

 #define BADGEINTERFACES 2
 #define VID 0x0483
-#define PID 0x580C
+#define PID 0x580D
 #define ENDPOINT_IN 0x81
 #define ENDPOINT_OUT 0x01
 #define BADGE_CMD 0x01

Recompiled:

pdp7@sp3:~/dev/chv/badge/CHVBadge_16/socketbadge$ make
Scanning dependencies of target socketbadge
[ 50%] Building C object CMakeFiles/socketbadge.dir/socketbadge.c.o
[100%] Linking C executable bin/socketbadge
[100%] Built target socketbadge

socketbadge now starts without error:

pdp7@sp3:~/dev/chv/badge/CHVBadge_16/socketbadge$ sudo ./bin/socketbadge -0 vcan0 -1 vcan1
Attempting to open USB device with VID:PID 0483:580D
Entered USB thread

Am I going down the right path?

Thanks!