Add WiFiNINA firmware update in docu.

This commit is contained in:
fauresystems
2019-11-13 19:05:42 +01:00
parent 8caeb00eb3
commit ea0a9425d1
16 changed files with 92 additions and 6 deletions
+20 -6
View File
@@ -40,6 +40,8 @@ bool wifiBegun(false);
void setup()
{
Serial.begin(9600);
props.addData(&clignoter);
props.addData(&led);
@@ -54,14 +56,26 @@ void loop()
{
if (!wifiBegun) {
WiFi.begin(ssid, passphrase);
// do static IP configuration disabling the dhcp client, must be called after every WiFi.begin()
//WiFi.config(IPAddress(192, 168, 1, 21), // local_ip
// IPAddress(192, 168, 1, 1), // dns_server
// IPAddress(192, 168, 1, 1), // gateway
// IPAddress(255, 255, 255, 0)); // subnet
Serial.println(WiFi.firmwareVersion());
delay(250); // acceptable freeze for this props (otherwise use PropsAction for async-like behavior)
// do static IP configuration disabling the dhcp client, must be called after every WiFi.begin()
String fv = WiFi.firmwareVersion();
if (fv.startsWith("1.0")) {
Serial.println("Please upgrade the firmware for static IP");
// see https://github.com/fauresystems/ArduinoProps/blob/master/WifiNinaFirmware.md
}
else {
//WiFi.config(IPAddress(192, 168, 1, 21), // local_ip
// IPAddress(192, 168, 1, 1), // dns_server
// IPAddress(192, 168, 1, 1), // gateway
// IPAddress(255, 255, 255, 0)); // subnet
//WiFi.setHostname("wifiprops");
}
if (WiFi.status() == WL_CONNECTED) {
wifiBegun = true;
wifiBegun = true;
Serial.println(WiFi.localIP());
Serial.println(WiFi.subnetMask());
Serial.println(WiFi.gatewayIP());
} else {
WiFi.end();
}