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

feature/ch51186/usb-cloud-connection-status #577

Merged
merged 4 commits into from
Apr 29, 2020

Conversation

busticated
Copy link
Contributor

@busticated busticated commented Apr 25, 2020

Description

Adds particle usb cloud-status <deviceID> command to query the device via USB and return its cloud connection status: unknown, connecting, connected, disconnecting, disconnected (ch)

How to Test

run particle usb cloud-status --help and try out the command and options.

Related Issues / Discussions

particle-iot/particle-usb#24

Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA
  • Problem and solution clearly stated
  • Tests have been provided
  • Docs have been updated
  • CI is passing

@busticated busticated force-pushed the feature/ch51186/usb-cloud-connection-status branch 2 times, most recently from d852cac to 678c38b Compare April 25, 2020 01:58
src/cmd/usb.js Outdated Show resolved Hide resolved
@busticated busticated force-pushed the feature/ch51186/usb-cloud-connection-status branch from 678c38b to f2139fe Compare April 25, 2020 04:16
@busticated
Copy link
Contributor Author

@sergeuz i don't think it's related to my changes as this isn't new behavior (though perhaps my updates make it worse) but i get IN control transfer failed: LIBUSB_TRANSFER_TIMED_OUT from time to time as well as IN control transfer failed: LIBUSB_TRANSFER_STALL - any ideas what might be going on?

@busticated
Copy link
Contributor Author

i get IN control transfer failed: LIBUSB_TRANSFER_TIMED_OUT from time to time

i can reproduce this 100% of the time by connecting my device, letting my computer go to sleep, waking it, and running any usb command. unplugging and plugging back in gets things back to working.

@busticated
Copy link
Contributor Author

@sergeuz can you think of a way to trigger "disconnecting" and / or "disconnected" states in these e2e tests? i haven't been able to observe a device reporting "disconnecting" for example.

@sergeuz
Copy link
Member

sergeuz commented Apr 27, 2020

can you think of a way to trigger "disconnecting" and / or "disconnected" states in these e2e tests? i haven't been able to observe a device reporting "disconnecting" for example.

It can be due to a transition from "disconnecting" to "disconnected" happening almost immediately, or do you mean you don't ever get "disconnected" as well?

@busticated
Copy link
Contributor Author

@sergeuz

do you mean you don't ever get "disconnected" as well?

correct - i never see "disconnecting" or "disconnected" just "unknown", "connecting", and "connected"

@sergeuz
Copy link
Member

sergeuz commented Apr 27, 2020

i don't think it's related to my changes as this isn't new behavior (though perhaps my updates make it worse) but i get IN control transfer failed: LIBUSB_TRANSFER_TIMED_OUT from time to time as well as IN control transfer failed: LIBUSB_TRANSFER_STALL - any ideas what might be going on?

No idea, unfortunately. There seems to be some issue in the USB HAL implementation and, possibly, particle-usb as well. @technobly Is this something your team is currently looking into?

@sergeuz
Copy link
Member

sergeuz commented Apr 27, 2020

i never see "disconnecting" or "disconnected"

@busticated Even if the device is indeed disconnected?

@busticated
Copy link
Contributor Author

@sergeuz

Even if the device is indeed disconnected?

yes? i tried putting the device into listening mode and then querying but in that case it returns unknown. polling after issuing a reset reports unknown -> connecting -> connected

@sergeuz
Copy link
Member

sergeuz commented Apr 27, 2020

i tried putting the device into listening mode and then querying but in that case it returns unknown. polling after issuing a reset reports unknown -> connecting -> connected

That's weird. I'm not sure why "unknown" is reported, it looks like a parsing error somewhere in fromProtobufEnum(). I'll take a look.

src/cmd/usb.js Show resolved Hide resolved
src/cmd/usb.js Outdated Show resolved Hide resolved
@busticated busticated force-pushed the feature/ch51186/usb-cloud-connection-status branch from f2139fe to 5ac886e Compare April 27, 2020 18:40
@busticated busticated force-pushed the feature/ch51186/usb-cloud-connection-status branch from 5ac886e to 10d2dd0 Compare April 29, 2020 19:41
@busticated
Copy link
Contributor Author

self-review :shipit:

@busticated busticated merged commit 2fa44e8 into master Apr 29, 2020
@busticated busticated deleted the feature/ch51186/usb-cloud-connection-status branch April 29, 2020 21:19
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.

2 participants