Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the device ID as the USB serial number for Core #1367

Merged
merged 2 commits into from Feb 5, 2018

Conversation

@monkbroc
Copy link
Member

commented Aug 15, 2017

Problem

When connecting a Core to USB, the serial number reported is a strange number instead of the device ID. The Photon and Electron report their device ID.

$ lsusb -v | grep Particle -A 2
  iManufacturer           1 Particle          
  iProduct                2 Spark Core with WiFi    
  iSerial                 3 6D75569D4957

This is blocking the CLI from using the USB serial number to detect the device ID of any connected device.

Solution

Port USB serial number code from Photon/Electron to Core.

Note: DFU mode still reports the original serial number instead of the device ID. I'm not sure how to recompile and flash the piece of software that contains DFU to a Core. It would be good to update in the long run, but it's not crucial to do it right away.

Steps to Test

Connect Core to USB, flash system firmware from PR.

$ lsusb -v | grep Particle -A 2
  iManufacturer           1 Particle          
  iProduct                2 Spark Core with WiFi    
  iSerial                 3 54FF72011111111111111111

Completeness

  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • Added documentation
  • Added to CHANGELOG.md after merging (add links to docs and issues)

@monkbroc monkbroc requested a review from avtolstoy Aug 15, 2017

@monkbroc monkbroc force-pushed the feature/core-usb-deviceid branch from b079059 to 21b5e12 Aug 15, 2017

@avtolstoy
Copy link
Member

left a comment

Works as expected.

Should we also fix Core bootloader same way? There is the same magic IntToUnicode device id manipulation in dfu_usb.c

@monkbroc

This comment has been minimized.

Copy link
Member Author

commented Aug 17, 2017

@monkbroc

This comment has been minimized.

Copy link
Member Author

commented Aug 17, 2017

Reading this back it didn't sound clear. I think fixing the bootloader code now is fine, but if my understanding that actually updating the bootloader on devices out in the wild is difficult this change is not enough to justify asking people to update their bootloader.

@m-mcgowan

This comment has been minimized.

Copy link
Contributor

commented Jan 18, 2018

@avtolstoy - ok to merge this one in 0.8.0-rc.2?

@avtolstoy

This comment has been minimized.

Copy link
Member

commented Jan 18, 2018

@m-mcgowan m-mcgowan added this to the 0.7.0-rc.7 milestone Jan 30, 2018

monkbroc and others added 2 commits Aug 15, 2017
Use the device ID as the USB serial number for Core
Port code from Photon/Electron to Core
Output the device ID as the DFU serial number. This required the seri…
…al number buffer size to be increased (since it's unicode, and was only 26 bytes before.) The device ID requires 50 bytes - 12 bytes, as hex digits (*2) in unicode (*2) with a 0 terminator.

@m-mcgowan m-mcgowan force-pushed the feature/core-usb-deviceid branch from 6b45f6c to 9262140 Jan 31, 2018

@m-mcgowan m-mcgowan merged commit b35150b into develop Feb 5, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@m-mcgowan m-mcgowan deleted the feature/core-usb-deviceid branch Feb 5, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.