Corrections in BlinkOnEthernetProps.ino and BlinkOnWifiProps.ino

Change MAC address in BlinkOnEthernetProps.ino and remove IP address to enable DHCP. Fix static Ip in BlinkOnWifiProps.ino
This commit is contained in:
fauresystems
2019-11-13 16:24:45 +01:00
parent 886c35a2a5
commit 8caeb00eb3
3 changed files with 8 additions and 8 deletions
BIN
View File
Binary file not shown.
@@ -14,8 +14,8 @@
#include <IPAddress.h>
#include "ArduinoProps.h"
byte mac[] = { 0xFC, 0xFA, 0xEA, 0x00, 0x00, 0x02 }; //<<< MAKE SURE IT'S UNIQUE IN YOUR NETWORK!!!
String ip = "192.168.1.19"; //<<< ENTER YOUR IP ADDRESS HERE ("" for DHCP)
byte mac[] = { 0x46, 0x4F, 0xEA, 0x10, 0x20, 0x02 }; //<<< MAKE SURE IT'S UNIQUE IN YOUR NETWORK!!! and not a reserved MAC
String ip = ""; //<<< ENTER YOUR IP ADDRESS HERE ("" for DHCP)
// Builtin led is not available with the shield
#undef LED_BUILTIN
@@ -53,7 +53,7 @@ void setup()
delay(1500); // time for shield stuff
// can do more static IP configuration
// can do more static IP configuration, must be called after Ethernet.begin()
//Ethernet.setSubnetMask(IPAddress(255, 255, 255, 0));
//Ethernet.setGatewayIP(IPAddress(192, 168, 1, 1));
//Ethernet.setDnsServerIP(IPAddress(192, 168, 1, 1));
@@ -40,11 +40,6 @@ bool wifiBegun(false);
void setup()
{
// can do more static IP configuration
//WiFi.config(IPAddress(), IPAddress(), IPAddress());
//WiFi.config(IPAddress(), IPAddress());
//WiFi.config(IPAddress());
props.addData(&clignoter);
props.addData(&led);
@@ -59,6 +54,11 @@ 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
delay(250); // acceptable freeze for this props (otherwise use PropsAction for async-like behavior)
if (WiFi.status() == WL_CONNECTED) {
wifiBegun = true;