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

particle subscribe --device <id> fails in v1.29.0 ~ 1.33.0 #409

Closed
technobly opened this issue Apr 3, 2018 · 4 comments
Closed

particle subscribe --device <id> fails in v1.29.0 ~ 1.33.0 #409

technobly opened this issue Apr 3, 2018 · 4 comments

Comments

@technobly
Copy link
Member

Old way: particle subscribe mine 123412341234123412341234 --private
New way: particle subscribe --device 123412341234123412341234

Looks like it fails due to scientific notation conversion

$ particle subscribe mine 123412341234123412341234 --private
Listen to device event stream
Usage: particle subscribe [options] [event...]

Global Options:
  -v, --verbose  Increases how much logging to display                                                                                                                         [count]
  -q, --quiet    Decreases how much logging to display                                                                                                                         [count]

Options:
  --all     Listen to all events instead of just those from my devices                                                                                                       [boolean]
  --device  Listen to events from this device only

Examples:
  particle subscribe             Subscribe to all event published by my devices
  particle subscribe update      Subscribe to events starting with update from my devices
  particle subscribe --device x  Subscribe to all events published by device x
  particle subscribe --all       Subscribe to public events and all events published by my devices

Unknown argument 'private'

$ particle subscribe --device 123412341234123412341234
Subscribing to all events from 2.9004400084737305e+23's stream
Listening to: /v1/devices/2.9004400084737305e+23/events
// terminates

$ particle subscribe --device 123412341234123412341234
Subscribing to all events from 2.9004400084737305e+23's stream
Listening to: /v1/devices/2.9004400084737305e+23/events
// terminates

$ particle --version
1.29.0

$ npm install -g particle-cli@v1.27.0
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
+ particle-cli@1.27.0
added 2 packages from 2 contributors, removed 1 package and updated 5 packages in 43.877s

$ particle subscribe mine 123412341234123412341234 --private
Subscribing to all events from 123412341234123412341234's stream
Listening to: /v1/devices/123412341234123412341234/events
{"name":"spark/status","data":"online","ttl":60,"published_at":"2018-04-03T16:43:23.330Z","coreid":"123412341234123412341234"}
// ... more events follow
@technobly technobly added the bug label Apr 3, 2018
@monkbroc
Copy link
Member

Good one. I thought I had turned off the automatic conversion from string to number for all options but apparently that doesn't work across the board.

@monkbroc monkbroc added the track label Apr 10, 2018
@monkbroc
Copy link
Member

Fixed in 1.31.0. Try it with npm install -g https://github.com/particle-iot/particle-cli/releases/download/v1.31.0-rc.2/particle-cli-1.31.0-rc.2.tgz

@technobly
Copy link
Member Author

It appears this problem was never fixed in 1.31.0 and exists in the latest 1.33.0 as well.

It only surfaces with ID's that contain only digits 0-9.

✏️ As a workaround, you may use the device name instead of the device id.

@technobly technobly reopened this Aug 27, 2018
@technobly technobly changed the title particle subscribe --device <id> fails in v1.29.0 particle subscribe --device <id> fails in v1.29.0 ~ 1.33.0 Aug 27, 2018
@monkbroc
Copy link
Member

monkbroc commented Aug 27, 2018

Sorry about that. #447 fixes this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants