UIPEthernet (Set network address manually)

Just want to share this, maybe this can help other blynkers…

#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <UIPEthernet.h>
#include <BlynkSimpleUIPEthernet.h>

/*
  Arduino Boards   =     ENC28J60  Network Card
   RESET           =     RESET
   3.3V            =     VCC ====== ( take note / take note / take note / take note 3.3v only.)
   GRND            =     GND
   PIN10           =     CS
   PIN11           =     SI
   PIN12           =     SO
   PIN13           =     SCK

Warning:
Using this UIPEthernet Memory utilization is too high. it consume around 70% of your memory program storage.
*/

// You should get Auth Token in the Blynk App.
char auth[] = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx";

// Mac address should be different for each device in your LAN
//byte arduino_mac[] = { 0xDE, 0xED, 0xBA, 0xFE, 0xFE, 0xED };   //Original mac address
byte mac[] = { 0xDE, 0xED, 0xBA, 0xFE, 0xAA, 0xA1 };             // modify the last 2 colomn hexa dicimal only ex.. (0xAA, 0xA1 };)
)
IPAddress localip ( 192, 168,   254,  150);       // your arduino i.p address, through ENC28J60
IPAddress mydns ( 192, 168,   254,  1);
IPAddress gateway ( 192, 168,   254,   1);
IPAddress subnet  (255, 255, 255, 0);
IPAddress serverip (192, 168, 254, 50);           // your local server i.p address

void setup()
{
  Serial.begin(9600);
  //Blynk.begin(auth);
  // You can also specify server.
  // For more options, see BoardsAndShields/Arduino_Ethernet_Manual example
  Blynk.begin(auth, serverip, 8442, localip, mydns, gateway, subnet, mac);
}

{
  Blynk.run();
}

1 Like