Author Topic: digispark vendor/product ids  (Read 8462 times)

PatrickBateman

  • Newbie
  • *
  • Posts: 1
digispark vendor/product ids
« on: June 13, 2013, 07:27:57 pm »
hi there.


having an issue getting digiusb to communicate with my digispark on my raspberry pi and mbp 2012. I know there is a conflict for the mbp, so i don't expect it to work on that, though it is able to program the digispark just fine using a usb extension cord.


I'm not sure about this, but the digiusb examples show one product/vendor id set while my 3 digisparks are reporting a different set. so I readjust the python code for the values my sparks have. Tried both sets of codes but no communication.


also, i am noticing on my pi a very high rate of dmesg spam from the digispark (below).


I gather that I might be ignorant on something here; thoughts?


Code: [Select]
...
[265481.726182] usb 1-1.2: USB disconnect, device number 51
[265482.727089] usb 1-1.2: new low-speed USB device number 52 using dwc_otg
[265482.830133] usb 1-1.2: New USB device found, idVendor=16d0, idProduct=0753
[265482.830164] usb 1-1.2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[265487.614981] usb 1-1.2: USB disconnect, device number 52
[265488.617253] usb 1-1.2: new low-speed USB device number 53 using dwc_otg
[265488.720656] usb 1-1.2: New USB device found, idVendor=16d0, idProduct=0753
[265488.720686] usb 1-1.2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[265493.503779] usb 1-1.2: USB disconnect, device number 53
[265494.507553] usb 1-1.2: new low-speed USB device number 54 using dwc_otg
[265494.610459] usb 1-1.2: New USB device found, idVendor=16d0, idProduct=0753
[265494.610489] usb 1-1.2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
...




receive.py
Code: [Select]
#/usr/bin/python


#
# Written for PyUSB 1.0 (w/libusb 1.0.3)
#




import usb # 1.0 not 0.4




import sys
sys.path.append("..")


from arduino.usbdevice import ArduinoUsbDevice




if __name__ == "__main__":
    try:
        theDevice = ArduinoUsbDevice(idVendor=0x16d0, idProduct=0x0753)
    except:
        sys.exit("No DigiUSB Device Found")








    import sys
    import time


    while 1 == 1:
        try:
            lastChar = chr(theDevice.read())
            if(lastChar == "\n"):
                break
            sys.stdout.write(lastChar)
            sys.stdout.flush()




        except:
            # TODO: Check for exception properly
            time.sleep(0.1)






« Last Edit: June 13, 2013, 07:30:51 pm by PatrickBateman »

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: digispark vendor/product ids
« Reply #1 on: June 13, 2013, 08:10:01 pm »
The Digispark Bootloader - which the Digispark identifies itself as for the first 5 seconds after connection has a vid/pid that Digistump purchased and has donated to the open source community for use with the bootloader.


The DigiUSB library uses an open source VID/PID pair that is different and licensed to the community by the folks behind the vusb project.


So your python code should look for the Digispark more than 5 seconds after it is connected using the VID/PID in the DigiUSB library.

Embedded-Creations

  • Newbie
  • *
  • Posts: 9
Re: digispark vendor/product ids
« Reply #2 on: June 20, 2013, 12:03:57 am »
Adding to what Erik said, it looks like your Digispark doesn't have an application loaded.  It is just repeatedly running the boot loader every 5 seconds.