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

@monkbroc monkbroc 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)

Copy link
Member

@avtolstoy avtolstoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member Author

monkbroc commented Aug 17, 2017 via email

@monkbroc
Copy link
Member Author

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
Copy link
Contributor

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

@avtolstoy
Copy link
Member

avtolstoy 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 January 31, 2018 21:17
Port code from Photon/Electron to Core
…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 merged commit b35150b into develop Feb 5, 2018
@m-mcgowan m-mcgowan deleted the feature/core-usb-deviceid branch February 5, 2018 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants