I have a Phton and want to connect it to a local WLAN without route to the internet. Additionally I need to use a static IP.
For that goal i installed particle-dev, and particle-cli. I was able to wirte and complie my Code so i got a firmware, which i flashed to the photon via usb.
For the static-IP solution i used this reference from the documentation:
To get my Photon to the WiFi is set the Credentials via:
Also I changed the System-Mode to semi-automatic, to prevent Photon from depending on the Particle-Cloud.
So long: Are my ideas right so far?
I ask because this is where the trouble starts:
The Photon tries to connect to a WiFI (even if i call Wifi.off() in setup) immediately. But this fails, most likely because the Static IP isnt set at this point. My question is how to prevent the Photon from automaticaly search for a network but make him do it once the static IP is configured. I even tried with System mode ‘manual’ but this didn’t work.
What am I doing wrong? I can post my code if this helps, but since ANY code fails as discribed, i doubt this will help.
@traceorm, you will need to use SYSTEM_MODE(MANUAL) to have full control over wifi and cloud connections. Also, be careful setting credentials every time you boot as this will wear the eeprom used for storing those credentials. Up to 5 set of credentials can be stored.
Posting your code may help getting a better understanding of your setup.
In general yes, just some side notes:
Since the device remembers up to five sets of WiFi credentials, you wouldn’t need to set them each time, but only once best from outside via CLI, since this rids you of the need to change the code when changing credentials.
useStaticIP() also only need to be called once and they only take effect after a a reboot.
SYSTEM_MODE(SEMI_AUTOMATIC) should not try to connect to WiFi immediately.
Mine does just go into breathing white which means WiFi module on but not connected. Even wit no WiFi credentials stored my code runs.
As Paul said, show your code and we might be able to assist.
And Paul was quicker again
I reply with my code after my lecture. Thank for the quick reply!