Photon: problem adding 2nd wifi connection

I know there are similar posts but not like this.
I have 5 Photons and have always managed setup with the iPhone app. But I downloaded a newer version & there was no obvious click to even get to setup (listed my Photon, though). So after teeth gnashing I moved to USB setup. Of course, I had to download particle app. Text copy from Terminal below represents my Nth try (for large N):

$ particle setup (Photon blinking blue)
 _ __             _   _      _        
| '_ \  __ _ _ __| |_(_) ___| | ___ 
| |_) |/ _` | '__| __| |/ __| |/ _ \
|  __/| (_| | |  | |_| | (__| |  __/
|_|    \__,_|_|   \__|_|\___|_|\___|
                 https://particle.io

> Setup is easy! Let's get started...
> It appears as though you are already logged in as ***
? 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 will lose your connection to the internet periodically.

? Found "Photon-***". 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.

! You are still connected to your Photon's Wi-Fi network. Please reconnect to a Wi-Fi network with internet access.

? Have you reconnected to the internet? Yes
> Obtained magical secure claim code.

> Hey! We successfully connected to Photon-***

> Now to configure our precious Photon-***

! PROTIP: If you want to skip scanning, or your network is configured as a
! PROTIP: non-broadcast network, please enter manual mode to proceed...

? Would you like to manually enter your Wi-Fi network configuration? No
â–„ Asking the Photon to scan for nearby Wi-Fi networks...events.js:161
      throw er; // Unhandled 'error' event
      ^

Error: connect ECONNREFUSED 192.168.0.1:****
    at Object.exports._errnoException (util.js:1023:11)
    at exports._exceptionWithHostPort (util.js:1046:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1090:14)
=============

So this ends with an error message & dumps me back in the Shell. But perversely, my Photon went to breathing cyan. Why?

Why not try the less automatic but more reliable all manual way :wink:

particle serial wifi

And refuse all automagic help thereafter

1 Like

This may be a useful work-around (Hack) but not an answer to my question. However, it worked the first time:

$ particle serial wifi
? Should I scan for nearby Wi-Fi networks? Yes
? Select the Wi-Fi network with which you wish to connect your device: RAS HOME
? Should I try to auto-detect the wireless security type? Yes
> Detected WPA2(PSK/AES/AES) security
? Wi-Fi Password *****
Done! Your device should now restart.

========

P.S.: “automagic”? It’s a good thing that the Photon is a great product. Otherwise, [throat-cutting-noise]! Core was an almost, Electron (for me) was a waste of $ and time.

That little + icon in the top right corner:

It's most certainly no hack. It's a perfectly valid method to configure credentials, and since it's not susceptible to any wifi-related issues, it's also more reliable. Not wanting to indulge in the nitty gritty details, it's hard to make wifi setups work on a fragmented platform like Windows, since there are way too many configurations to comfortably support. That likely the reason why the CLI had some issues. I can imagine it might be a bit less complicated on an apple product for example, since that's less fragmented. (No actual experience on that one, just an expectation)

I was working from Mac Terminal app.

Guess my expectations were wrong, my bad. There’s still truth in the fact that it’s hard to make computer hardware play nice with whatever it is you’re doing. There are occasions where it works, and there are some where it doesn’t, which is why we (@ScruffR and I at least) prefer the Serial method, as it doesn’t have to deal with all of that. And since you’re hooking it up to your computer anyhow, you might as well send that data over that wire.
It’s certainly an area that can be improved upon though, not denying that :wink:

It seems that

particle serial wifi

mostly works but

particle setup

mostly doesn’t. So why doesn’t the former appear in the Docs?