In my Internet of Things class, we recently started seeing an issue with particle serial wifi
It seems to only be on Windows machines.
NOTE: The below is all down on a Photon 2 running Device OS 5.7.0 in Listening Mode.
We are getting an error when trying the command using git bash as the shell:
$ particle serial wifi
Prompts are not allowed in non-interactive mode
When we try it from PowerShell, we get a slightly different problem.
PS C:\Users\ddcio> particle serial wifi
? Would you like to scan for Wi-Fi networks? No
? SSID DDCIOT
? Wi-Fi Password
Unable to join Wi-Fi network: Invalid state
Other serial commands seem to work, for instance:
$ particle serial identify
Your device id is 0a10aced202194944a0443cc
Your system firmware version is 5.7.0
For some reason, you're not getting your bash terminal set up as an interactive ptty when it's launched. Using powershell is a reasonable alternative until a solution is found. This will only apply to Particle CLI commands that take interactive input, like particle serial wifi; commands that only output data like particle serial identify work with a non-interactive terminal.
I think the Invalid state error is because of an error returned by the device, not a CLI issue. It's not clear what is causing that, so I would try:
@rickkas7 Is there a chance that something changed in the particle CLI for windows? I just took another Photon2 directly out of the box. I did a particle update to get it up to 5.7.0. And then had the same error again using particle serial wifi. Rather than go the Web-based Config WiFi, I took it over to a M2 Mac and had zero issue setting up wifi with the CLI.