I’ve trying to connect my photon to my router and then internet without doing Particle.connect(). So, I use WiFi.on() and WiFi.connect() as mentioned in this link: Photon operation w/o cloud connection
I did the trick explained in the “Running with Wi-Fi but no cloud” section but so far I was getting the blinking red LED’s after the device went to blinking green (there was no glowing green at all).
After WiFi.connect(), I do have a bunch of processes that needs TCP and internet connection but not necessarily the Photon/Particle cloud.
Anyone has any idea?
P.S. The code works if I do Particle.connect() and then do the rest of the processes.
Thanks for the insight but I am already on semi-automatic mode. Currently, I am controlling the connection through Particle.connect(), but this forces me to connect to the cloud. What I want to do is just WiFi.on() then WiFi.connect(). If I do this and the WiFi actually has internet connection, this should be an acceptable mode of operation for PHOTON right? Basically I want to connect to some cloud but NOT Photon/Particle’s cloud.
Currently I am having the error (LED blinking red) right after connecting to the WiFi and trying to connect to my cloud server.
You didn’t mention it in your OP, but do you wait for WiFi.ready() before you try to use anything that actually requires an readily established connection?
Failing to do so might well explain the SOS panic you describe.
Just as a heads-up, there used to be some race condition between WiFi.ready() reporting true and the local IP actually being set. If you want to be on the safe side, you may also want to check WiFi.localIP() for validity.
Thanks ScruffR and rickkas7! I am using TCPClient and the firmware version is 0.7.0. And SYSTEM_THREAD(ENABLED) is also used. The error is somewhere caused by my code. Bottomline is this does not happen if I use Particle.connect() that gives glowing blue LED, but it happens (SOS code as ScruffR mentioned) when I am just connecting to WiFi that gives glowing green LED.
I will look deeper into my code, but any more insights are appreciated. Thanks everyone!