Dear all,
I have no clue what is going on with my photon.
My photon was running perfectly fine : running simple web server just before I insert code to establish static IP.
I wanted to run the web server at same IP regardless of the wifi networks that it is connected.
The code I inserted is like this.
In fact, I obtained this piece of code from this link here.
void setup() {
//Turn off wifi so we can set up our static ip
WiFi.off();
//Set static ip info
IPAddress myAddress(192,168,1,100);
IPAddress netmask(255,255,255,0);
IPAddress gateway(192,168,11,1);
IPAddress dns(192,168,11,1);
//Actually set the static ip
WiFi.setStaticIP(myAddress, netmask, gateway, dns);
//Tell the photon to use the static ip
WiFi.useStaticIP();
//Reconnect to wifi
WiFi.on();
WiFi.connect();
.........
}
It successfully flashed and uploaded to photo.
After importing that, my photon lost internet connection.
When I logged into my router site, it is showing that IP address that I set.
But it keeps flashing cyan.
I spent for about 8 hours… tried to reset, go into safe mode, upload the firmware again…
But I still couldn’t get it right.
After that, I try to download the original working code which is firmware.bin and upload via dfu.
Photon doesn’t seem to be accepting any code imported with dfu.
I tried to set up with iOS app but when it reaches the stage of connecting to wifi network, it is flashing cyan forever.
I followed the troubleshooting guide and searched every single topic related to my problem in google… but could not find any working solution.
I am losing hope.
WiFi.useStaticIP() is a sticky setting. If you want to revert to dynamic IP you’d need to actuvely set that via WiFi.useDynamicIP().
And you are using 192.168.11.x and 192.168.1.x with subnet mask 255.255.255.0 so you are dealing with two seperate subnets.
How does your device behave when you have the Photon in the same subnet as its gateway?
I could not think much about the subnet mask because it is my first photon project.
It lost connection to wifi and was flashing cyan forever.
Hence, I cannot upload the code to photon from both web and desktop IDE.
Yeah I flashed firmware.bin via dfu_util. Although it showed successful flashing… the code doesn’t seem to be updated at all.
Cyan is always flashing and still cannot connect to wifi.
I will try with CLI method. Thank you.
You can compile via CLI.
Put the sketch into a text file, rename it to something.ino and do
particle compile photon something.ino
then you should get a .bin file to flash via CLI
particle flash --usb your.bin
You usually don’t need to remove or unclaim devices from your list - not even if things go wrong. There usually are other causes that can fixed otherwise.
Appreciate for clear and straight forward instruction.
I thought restarting everything from step 1 such as removing from the list could help… end up causing me to get headache.
I was able to flash your code via cli.
Now, photon is flashing in such a way that cyan is blinking periodically … then suddenly blinking very fast in cyan followed by red light… and then repeats.
Any idea, Sir?
It was very short burst of orange.
Thank you, Sir. Thank you very much.
You have helped me within a couple of hours to solve the problem which I have been struggling for 8 hours.
It worked like a charm.
I was looking through this thread.
I typed these in terminal provided in the above thread.
particle keys server cloud_public.der
particle keys new photon
particle keys load photon.der
particle keys send photon.pub.pem
No 4. command did not work in Terminal.
At the moment, I saw your reply.
Then I typed in command you provided.
< particle keys doctor myDeviceID >
Magically, I see cyan breathing on photon.
Photon is connected to wifi and my web server works like it did before.
Again, thank you very much, Sir.
It means a lot to me.