Possible (?) Problem with OS X 10.11 (El Capitan)

Hey,

just received my Photon today, after I had (unfortunately) updated my MBP to the Beta 3 of OS X El Capitan.

The particle-cli is working fine and I used brew to install all dependencies. dfu-util can see my Photon in DFU mode, but particle serial list merely says No devices available via serial. Is there anything I can do to debug that?

Cheers!

Is your device in listening mode (blinking blue)?

When I run particle serial list it is.
When I run dfu-util -l it is in DFU mode (blinking yellow).

Ok i like hearing this :smiley: cos i kept holding back not to update to El Capitan.

Let’s debug!

Can you add console.log(ports); to this line: https://github.com/spark/particle-cli/blob/master/commands/SerialCommand.js#L75

You can locate the directory at /usr/local/lib/node_modules/particle-cli

Thanks!

Well at least someone is happy :wink:

Thanks!

And here we have the culprit. The relevant port is this:

[
  ...
  { comName: '/dev/cu.usbmodem1d111000.1',
    manufacturer: '',
    serialNumber: '',
    pnpId: '',
    locationId: '',
    vendorId: '',
    productId: '' } ]

But all ports (iPhone AP + BT Incoming) are listed without manufacturer/vendor/product id. If I manually add the the device to the devices array (with type Photon), the particle serial list command gives me (obviously) this:

~  $  particle serial list
Found 1 device connected via serial:
/dev/cu.usbmodem1d111000.1 - Photon

But the setup still doesn’t work, because the secure WiFi setup fails

 ~  $  particle setup
                  _   _      _        _
 _ __   __ _ _ __| |_(_) ___| | ___  (_) ___
| '_ \ / _` | '__| __| |/ __| |/ _ \ | |/ _ \
| |_) | (_| | |  | |_| | (__| |  __/_| | (_) |
| .__/ \__,_|_|   \__|_|\___|_|\___(_)_|\___/
|_|                     https://particle.io/

> Setup is easy! Let`s get started...
> It appears as though you are already logged in as a.graf@aetherworld.org
? Would you like to log in with a different account? No

! PROTIP: Hold the MODE/SETUP button on your device until it blinks blue!
! PROTIP: Please make sure you are connected to the internet.

> I have detected a Photon connected via USB.
? Would you like to continue with this one? Yes
! The Photon supports secure Wi-Fi setup. We`ll try that first.

! PROTIP: Wireless setup of Photons works like a wizard!
! PROTIP: We will automagically change the Wi-Fi network to which your computer is connected.
! PROTIP: You may lose your connection to the internet for a moment.

? Found "Photon-V92J". Would you like to perform setup on this one now? Yes

! PROTIP: You will need to know the password for your Wi-Fi network (if any) to proceed.
! PROTIP: You can press ctrl + C to quit setup at any time.

! Woops. Something went wrong connecting to Photon-V92J. Please manually re-connect to your Wi-Fi network.

Setting the device type to Spark Core allows me to complete the setup.

Since it seems to be a problem with the node-serialport library, I opened a ticket over there:

1 Like

@winternight,

sorry for the lack of activity. Doing lots of offline work and not been watching any threads.

I wonder if it is a El Capitan issue…

What else could it be?

If all the other USB devices like you mentioned did not have the params then it would either be node-serialport having to adapt to the new changes or simply some beta bug?

I tested it with pretty much all USB devices I own (which is a lot) and I’m confident it’s a node-serialport issue. At first I believed it’s a problem with rootless and it very well might be, but it must go deeper than merely not allowing access to /usr.

I might have misunderstood your last post: it definitely is an issue with either El Capitan or node-serialport. The exact same version works fine with Yosemite, and there is no problem enumerating the devices under El Capitan. Merely the PID/Vendor ID is missing.

1 Like

I wish I had read this thread before updating to El Capitan OSX 10.11.

Particle CLI is not seeing the devices on USB serial (Core or Photon) and neither will the iPhone App get through setup for a Photon

Is there a solution to this or should I revert to Yosemite 10.10?

Do sudo npm uninstall -g particle-cli and sudo npm install -g particle-cli

Theoretically, this should also work: sudo npm update -g particle-cli

Also, if you are using homebrew on OSX, and have set the permissions on /usr/local correctly, you shouldn’t need to use sudo. (and in fact, it would be discouraged in this case)

kenneth

I tried the uninstall - worked OK and install. It kicked out 5 warnings - see below. Is this OK?

xs-iMac:~ xs$ sudo npm uninstall -g particle-cli

WARNING: Improper use of the sudo command could lead to data loss
or the deletion of important system files. Please double-check your
typing when using sudo. Type “man sudo” for more information.

To proceed, enter your password, or type Ctrl-C to abort.

Password:
unbuild particle-cli@1.5.11
xs-iMac:~ xs$ sudo npm install particle-cli
Password:

serialport@2.0.1 install /Users/xs/node_modules/particle-cli/node_modules/serialport
node-pre-gyp install --fallback-to-build

child_process: customFds option is deprecated, use stdio instead.
CXX(target) Release/obj.target/serialport/src/serialport.o
CXX(target) Release/obj.target/serialport/src/serialport_unix.o
…/src/serialport_unix.cpp:695:20: warning: comparison of array
’device.locationId’ not equal to a null pointer is always true
[-Wtautological-pointer-compare]
if (device.locationId != NULL) {
~^~~~ ~~~~
…/src/serialport_unix.cpp:698:20: warning: comparison of array
’device.vendorId’ not equal to a null pointer is always true
[-Wtautological-pointer-compare]
if (device.vendorId != NULL) {
~^~ ~~~~
…/src/serialport_unix.cpp:701:20: warning: comparison of array
’device.productId’ not equal to a null pointer is always true
[-Wtautological-pointer-compare]
if (device.productId != NULL) {
~^~~ ~~~~
…/src/serialport_unix.cpp:704:20: warning: comparison of array
’device.manufacturer’ not equal to a null pointer is always true
[-Wtautological-pointer-compare]
if (device.manufacturer != NULL) {
~^~~~~~ ~~~~
…/src/serialport_unix.cpp:707:20: warning: comparison of array
’device.serialNumber’ not equal to a null pointer is always true
[-Wtautological-pointer-compare]
if (device.serialNumber != NULL) {
~^~~~~~ ~~~~
5 warnings generated.
CXX(target) Release/obj.target/serialport/src/serialport_poller.o
SOLINK_MODULE(target) Release/serialport.node
SOLINK_MODULE(target) Release/serialport.node: Finished
COPY /Users/xs/node_modules/particle-cli/node_modules/serialport/build/serialport/v2.0.1/Release/node-v14-darwin-x64/serialport.node
TOUCH Release/obj.target/action_after_build.stamp
particle-cli@1.8.11 node_modules/particle-cli
├── fast-luhn@1.0.2
├── cli-spinner@0.2.1
├── xtend@4.0.0
├── when@3.7.3
├── hogan.js@2.0.0
├── lodash@3.10.1
├── moment@2.10.6
├── cli-table@0.3.1 (colors@1.0.3)
├── chalk@1.1.1 (escape-string-regexp@1.0.3, supports-color@2.0.0, ansi-styles@2.1.0, strip-ansi@3.0.0, has-ansi@2.0.0)
├── node-wifiscanner2@1.1.0 (os-locale@1.4.0)
├── glob@4.5.3 (inherits@2.0.1, once@1.3.2, inflight@1.0.4, minimatch@2.0.10)
├── inquirer@0.8.5 (ansi-regex@1.1.1, figures@1.4.0, cli-width@1.1.0, through@2.3.8, rx@2.5.3, readline2@0.1.1)
├── request@2.65.0 (stringstream@0.0.4, aws-sign2@0.6.0, forever-agent@0.6.1, caseless@0.11.0, oauth-sign@0.8.0, tunnel-agent@0.4.1, isstream@0.1.2, json-stringify-safe@5.0.1, extend@3.0.0, node-uuid@1.4.3, qs@5.2.0, tough-cookie@2.2.0, form-data@1.0.0-rc3, combined-stream@1.0.5, http-signature@0.11.0, mime-types@2.1.7, hawk@3.1.0, bl@1.0.0, har-validator@2.0.2)
├── softap-setup@1.1.4 (node-rsa@0.2.26, nconf@0.7.2)
└── serialport@2.0.1 (bindings@1.2.1, sf@0.1.7, async@0.9.0, nan@2.0.9, debug@2.2.0, optimist@0.6.1)
xs-iMac:~ xs$

Clearly this isn’t OK - now Particle command is not found.

I am logged in as root/admin and npm install -g particle-cli errors with 13 /Eacess.

You forgot the ‘-g’: sudo npm install -g particle-cli

Well, @kennethlimcp forgot it. :smile:

1 Like

Good spot. Just tried that and I got exactly the same result.

What is the result of the following command? echo $PATH | tr ':' '\n'

You should have /usr/local/bin in your path…

If so, then what does this tell you: ls -AFl /usr/local/bin/particle

xs-iMac:~ xs$ echo $path | tr ‘:’ '\n’
xs-iMac:~ xs$
xs-iMac:~ xs$ ls -AFl /usr/local/bin/particle
lrwxr-xr-x 1 root admin 48 19 Oct 19:05 /usr/local/bin/particle@ -> …/lib/node_modules/particle-cli/bin/particle.js

I trust this means something to you?

‘PATH’ has to be all uppercase, exactly as I had it above.

Whoops! Correctly then:

xs-iMac:~ xs$ echo $PATH | tr ‘:’ ‘\n’
/Library/Frameworks/Python.framework/Versions/3.4/bin
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/git/bin
/Applications/DevDesktop/drush
xs-iMac:~ xs$ ls -AFl /usr/local/bin/particle
lrwxr-xr-x 1 root admin 48 19 Oct 19:05 /usr/local/bin/particle@ -> …/lib/node_modules/particle-cli/bin/particle.js