Add WiFiNINA firmware update in docu.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user