facebookresearch / digit-design

Design files for the DIGIT tactile sensor
Other
148 stars 25 forks source link

Cannot set serial correctly #11

Closed callmeray closed 4 years ago

callmeray commented 4 years ago

Hi,

Thank you for your great work.

I tried to flash the firmware with a serial number following https://github.com/facebookresearch/digit-design/blob/master/firmware/digit-programmer/README.md but got "DXXXXX" when connected it using https://github.com/facebookresearch/digit-interface

AlphaBetaPhi commented 4 years ago

Hi @callmeray,

Thank you for your interest!

Can you provide the command you used to flash the firmware?

callmeray commented 4 years ago

Thank you for your reply.

The command was python3 flash.py digit.serial=45. I think it is more like the interface issue, since I could generate the temporary firmware.

AlphaBetaPhi commented 4 years ago

Hi @callmeray, can you run lsusb -v and see if it reports the correct serial number there?

callmeray commented 4 years ago

The result is

Bus 003 Device 021: ID 2833:0209
Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 239 Miscellaneous Device bDeviceSubClass 2 ? bDeviceProtocol 1 Interface Association bMaxPacketSize0 64 idVendor 0x2833 idProduct 0x0209 bcdDevice 1.01 iManufacturer 1 Facebook iProduct 2 DIGIT iSerial 3 DXXXXX bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 220 bNumInterfaces 2 bConfigurationValue 1 iConfiguration 0 bmAttributes 0x80 (Bus Powered) MaxPower 500mA Interface Association: bLength 8 bDescriptorType 11 bFirstInterface 0 bInterfaceCount 2 bFunctionClass 14 Video bFunctionSubClass 3 Video Interface Collection bFunctionProtocol 0 iFunction 2 DIGIT Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 14 Video bInterfaceSubClass 1 Video Control bInterfaceProtocol 0 iInterface 2 DIGIT

AlphaBetaPhi commented 4 years ago

@callmeray,

Thank you, looks like the serial is reported as iSerial 3 DXXXXX.

Can you git pull from the repo and then run this command,

python3 flash.py digit.firmware="../digit-2020-1b.bin" digit.serial=45

callmeray commented 4 years ago

I got the same result.

idVendor 0x2833 idProduct 0x0209 bcdDevice 1.01 iManufacturer 1 Facebook iProduct 2 DIGIT iSerial 3 DXXXXX

Does it require a specified python version? I'm using Python 3.7.7.

AlphaBetaPhi commented 4 years ago

@callmeray,

May you post the output of flash.py?

Steps I have taken:

I cannot reproduce this locally,

digit-programmer git:(master) ✗ python flash.py digit.firmware="../digit-2020-1b.bin" digit.serial=1234
DIGIT programmer config:
digit:
  firmware: ../digit-2020-1b.bin
  serial: 1234
usb:
  idProduct: 521
  idVendor: 10291

INFO:DigitProgrammer:Attempting to find DIGIT serial mask in ../digit-2020-1b.bin binary.
INFO:DigitProgrammer:Found serial pattern...
INFO:DigitProgrammer:Serial number written to new firmware binary.
INFO:DigitProgrammer:Flashing DIGIT firmware...
Unplug and plug DIGIT into usb then press ENTER...
dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Opening DFU capable USB device...
ID 0403:0fde
Run-time device DFU version 0110
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 0110
Device returned transfer size 256
Copying data from PC to DFU device
Download    [=========================] 100%        44496 bytes
Download done.
Sent a total of 44496 bytes
state(6) = dfuMANIFEST-SYNC, status(0) = No error condition is present
dfu-util: unable to read DFU status after completion
dfu-util: can't detach
Resetting USB to switch back to runtime mode
dfu-util: error resetting after download
INFO:DigitProgrammer:Finished flashing firmware to DIGIT!

Verifying serial number,

In [1]: from digit_interface import DigitHandler
In [2]: DigitHandler.list_digits()
Out[2]:
[{'dev_name': '/dev/video0',
  'manufacturer': 'Facebook',
  'model': 'DIGIT',
  'revision': '0101',
  'serial': 'D01234'}]
callmeray commented 4 years ago

Thanks. It works this time. The reason I failed was that DIGIT was plugged when I run flash.py.

robertocalandra commented 4 years ago

Glad to hear that this fixed the problem. I am closing the issue; feel free to reopen if you encounter more problems.