[SoftAP] configure-ap command fails with code -3

photon
Tags: #<Tag:0x00007f038f9fd280>

#1

I am having a similar issue to this thread, where I am attempting to use a node app running on my laptop to configure the Photon via SoftAP, however I am getting a response of {"r":-3} when I attempt the configure-ap command.

It seems to have no issue with the public-key command, or scan-ap command. As documented in the example here I run rsa.setPublic() on the retrieved public key and then rsa.encrypt() on the entered password for the network.

However when I then send the configure-ap command with data postData = { "idx": 0, "ssid": SSID, "sec": SEC, "ch": CH, "pwd": rsa.encrypt(password) } , I get the response {"r":-3} and am not sure what this means?

The only user application on the Photon is the “Blink an LED” example, so I don’t believe there is any SYSTEM_THREAD enabled. I am running Photon firmware version 0.7.0.

Any suggestions for what I may be doing wrong?


#2

Any suggestions? Or does anyone at least know where I can look up what the configure-ap error code {"r":-3} (or any other configure-ap error code) means?


#3

I would follow the steps here to do it manually using curl, then compare the output piece by piece until you can see what the difference is.

I don’t know what -3 means, other than “an error.”


#4

Hi @rickkas7, thank you for the response. I am really scratching my head on this one…

I followed through the steps in your guide under “Set up Wi-Fi”, but I was still getting the {"r":-3} response to the configure-ap command. This was the case whether I would use my own node app or curl with the wifipass.js node program you created to encrypt the password. I even tried it on multiple Photons running 0.7.0 but all with the same result.

When I send the configure-ap command, I see the blinking blue LED freeze up for a moment, then continue back to blinking once I get the error response.

I then tried downgrading a Photon back to 0.6.3, and this actually gives me {"r":0} !! But, even still I’m not sure it is quite working properly. Despite the success response, the LED would just go back to blinking blue (or breathing dark blue), so it doesn’t seem like the sent credentials are actually sticking.

I then tried upgrading to the brand new 1.0.0 firmware, but it went back to {"r":-3}. And I can confirm downgrading once again returned it to {"r":0} (but Photon still not actually connecting).

The network I am trying to connect to is WPA2 with AES encryption, just a home network. I know the network password and have tried more than enough times to confirm it’s not just a password typo or something.

My POST data for the configure-ap command is:

idx:0 ssid:MY_NETWORK sec:4194308 ch:1 pwd:<encrypted password> , of course with ssid, sec, and ch all pulled in exactly from the scan-ap command.

All other commands (device-id, public-key, scan-ap, connect-ap) are responding with correct {"r":0}.

Running through particle serial wifi seems to work fine and the Photon connects, but my goal is to accomplish the Wi-Fi setup from my own node app.

Does this info give you any ideas?


#5

I tried taking a brand new Photon out of the box, plugged it in so it was blinking blue, connected to the “Photon-XXXX” AP, and attempted curl http://192.168.0.1/device-id but got a “port 80 connection refused” error. Should that command work right out of the box? Or are there some other initial steps that must be done first?