Prompts are not allowed in non-interactive mode

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
? 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

I think this is two separate problems.

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:

  • The Web-based configure Wi-Fi. If that also fails, it's something on the device.
  • Try flashing Tinker to the device in case user firmware is interfering with Wi-Fi configuration.

@rickkas7 Thank you for your help. I was able to get it fixed. But for others (given that we have had multiple devices have the issue) a few things:

  • Flashing Tinker did not help
  • When I tried the Web-based Config WiFi, I got into some loop for it asking me to go into DFU mode and then back to Listen.
  • I ran the Web -based Device Doctor and then back to Web-based Config WiFi and that did the trick.

@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.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.