Good idea. I’m adding a sketch with following and I see some changes…
SYSTEM_MODE(SEMI_AUTOMATIC);
void setup(){
// Make sure your Serial Terminal app is closed before powering your device
Serial.begin(9600);
WiFi.connect();
for(int i=0;i<10;i++){
Serial.println("waiting " + String(10-i) + " seconds before we...");
delay(1000);
}
Serial.println(WiFi.localIP());
Serial.println(WiFi.subnetMask());
Serial.println(WiFi.gatewayIP());
Serial.println("SSID:" + String(WiFi.SSID()));
}
void loop(){
}
And I’m getting 0.0.0.0 for localIP, subnetMask and gateway. Also SSID is blank. I forced to get a static IP adding the following before WiFi.connect():
IPAddress myAddress(192,168,1,70);
IPAddress netmask(255,255,255,0);
IPAddress gateway(192,168,1,1);
IPAddress dns(192,168,1,1);
WiFi.setStaticIP(myAddress, netmask, gateway, dns);
// now let's use the configured IP
WiFi.useStaticIP();
Now photon get those IP parameters, but en both cases there is the same result, now the led is green and blink slowly, What this means? now is in the network but is not trying to reach the particle cloud.
So next test has been try to get something out there:
SYSTEM_MODE(SEMI_AUTOMATIC);
TCPClient client;
void setup(){
Serial.begin(9600);
IPAddress myAddress(192,168,1,70);
IPAddress netmask(255,255,255,0);
IPAddress gateway(192,168,1,1);
IPAddress dns(192,168,1,1);
WiFi.setStaticIP(myAddress, netmask, gateway, dns);
WiFi.connect();
for(int i=0;i<10;i++){
Serial.println("waiting " + String(10-i) + " seconds before we...");
delay(1000);
}
Serial.println(WiFi.localIP());
Serial.println(WiFi.subnetMask());
Serial.println(WiFi.gatewayIP());
Serial.println("SSID:" + String(WiFi.SSID()));
if (client.connect("google.com", 80))
{
Serial.println("connected");
client.println("GET /search?q=unicorn HTTP/1.0");
client.println("Host: www.google.com");
client.println("Content-Length: 0");
client.println();
}
else
{
Serial.println("connection failed");
}
}
void loop(){
if (client.available())
{
char c = client.read();
Serial.print(c);
}
if (!client.connected())
{
Serial.println();
Serial.println("disconnecting.");
client.stop();
for(;;);
}
}
and the response was:
Opening serial monitor for com port: "/dev/cu.usbmodem1411"
waiting 9 seconds before we...
waiting 8 seconds before we...
waiting 7 seconds before we...
waiting 6 seconds before we...
waiting 5 seconds before we...
waiting 4 seconds before we...
waiting 3 seconds before we...
waiting 2 seconds before we...
waiting 1 seconds before we...
192.168.1.70
255.255.255.0
192.168.1.1
SSID:MOVISTAR_1218
connected
HTTP/1.0 302 Found
Location: http://www.google.es/search?q=unicorn&gws_rd=cr&ei=XBZLV-vCEMj6UMnKjsgK
Cache-Control: private
Content-Type: text/html; charset=UTF-8
P3P: CP="This is not a P3P policy! See https://www.google.com/support/accounts/answer/151657?hl=en for more info."
Date: Sun, 29 May 2016 16:18:36 GMT
Server: gws
Content-Length: 276
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Set-Cookie: NID=79=CK-fCT5QU1IEYli4u8KEAOzKQ4TLHSzL1BtqYWDYVxKyMFD9YmWcFF2EuBt1l_F_-RskrgFxd7M-PKDyEgaV26eVM-Lazl2YnQjOp220J4qG3gkhm3I1M6ZdSl10GhCn; expires=Mon, 28-Nov-2016 16:18:36 GMT; path=/; domain=.google.com; HttpOnly
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="http://www.google.es/search?q=unicorn&gws_rd=cr&ei=XBZLV-vCEMj6UMnKjsgK">here</A>.
</BODY></HTML>
disconnecting.
So, seems that is reaching google.com… why is not connecting to particle cloud??
(two days ago was working properly and nothing was changed on my network settings and also I tried with a tethering with my phone).
Note that this is the same in two of my photon boards working with an updated firmware…
I’m really obfuscated with this issue…