Skip to content

Commit

Permalink
Switch to our new USB VID (#2112)
Browse files Browse the repository at this point in the history
Co-authored-by: Comma Device <[email protected]>
  • Loading branch information
adeebshihadeh and Comma Device authored Dec 16, 2024
1 parent 12ca145 commit dd76e66
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ And to send one on bus 0:
Note that you may have to setup [udev rules](https://github.com/commaai/panda/tree/master/drivers/linux) for Linux, such as
``` bash
sudo tee /etc/udev/rules.d/11-panda.rules <<EOF
SUBSYSTEM=="usb", ATTRS{idVendor}=="bbaa", ATTRS{idProduct}=="ddcc", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="bbaa", ATTRS{idProduct}=="ddee", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="3801", ATTRS{idProduct}=="ddcc", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="3801", ATTRS{idProduct}=="ddee", MODE="0666"
EOF
sudo udevadm control --reload-rules && sudo udevadm trigger
```
Expand Down
2 changes: 1 addition & 1 deletion board/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#define MAX_CAN_MSGS_PER_SPI_BULK_TRANSFER 170U

// USB definitions
#define USB_VID 0xBBAAU
#define USB_VID 0x3801U

#ifdef PANDA_JUNGLE
#ifdef BOOTSTUB
Expand Down
4 changes: 2 additions & 2 deletions board/jungle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ To make the jungle usable without root permissions, you might need to setup udev
On ubuntu, this should do the trick:
``` bash
sudo tee /etc/udev/rules.d/12-panda_jungle.rules <<EOF
SUBSYSTEM=="usb", ATTRS{idVendor}=="bbaa", ATTRS{idProduct}=="ddcf", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="bbaa", ATTRS{idProduct}=="ddef", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="3801", ATTRS{idProduct}=="ddcf", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="3801", ATTRS{idProduct}=="ddef", MODE="0666"
EOF
sudo udevadm control --reload-rules && sudo udevadm trigger
```
Expand Down
4 changes: 2 additions & 2 deletions drivers/linux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ You will need to bring it up using `sudo ifconfig can0 up` or
Note that you may have to setup udev rules for Linux
``` bash
sudo tee /etc/udev/rules.d/11-panda.rules <<EOF
SUBSYSTEM=="usb", ATTRS{idVendor}=="bbaa", ATTRS{idProduct}=="ddcc", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="bbaa", ATTRS{idProduct}=="ddee", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="3801", ATTRS{idProduct}=="ddcc", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="3801", ATTRS{idProduct}=="ddee", MODE="0666"
EOF
sudo udevadm control --reload-rules && sudo udevadm trigger
```
2 changes: 1 addition & 1 deletion drivers/linux/panda.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

/* vendor and product id */
#define PANDA_MODULE_NAME "panda"
#define PANDA_VENDOR_ID 0XBBAA
#define PANDA_VENDOR_ID 0X3801
#define PANDA_PRODUCT_ID 0XDDCC

#define PANDA_MAX_TX_URBS 20
Expand Down
5 changes: 3 additions & 2 deletions python/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ class Panda:
SERIAL_LIN2 = 3
SERIAL_SOM_DEBUG = 4

USB_VIDS = (0xbbaa, 0x3801) # 0x3801 is comma's registered VID
USB_PIDS = (0xddee, 0xddcc)
REQUEST_IN = usb1.ENDPOINT_IN | usb1.TYPE_VENDOR | usb1.RECIPIENT_DEVICE
REQUEST_OUT = usb1.ENDPOINT_OUT | usb1.TYPE_VENDOR | usb1.RECIPIENT_DEVICE
Expand Down Expand Up @@ -385,7 +386,7 @@ def usb_connect(cls, serial, claim=True, no_error=False):
context.open()
try:
for device in context.getDeviceList(skip_on_error=True):
if device.getVendorID() == 0xbbaa and device.getProductID() in cls.USB_PIDS:
if device.getVendorID() in cls.USB_VIDS and device.getProductID() in cls.USB_PIDS:
try:
this_serial = device.getSerialNumber()
except Exception:
Expand Down Expand Up @@ -441,7 +442,7 @@ def usb_list(cls):
try:
with usb1.USBContext() as context:
for device in context.getDeviceList(skip_on_error=True):
if device.getVendorID() == 0xbbaa and device.getProductID() in cls.USB_PIDS:
if device.getVendorID() in cls.USB_VIDS and device.getProductID() in cls.USB_PIDS:
try:
serial = device.getSerialNumber()
if len(serial) == 24:
Expand Down

0 comments on commit dd76e66

Please sign in to comment.