i perfomred the change you suggsted but still ip address is 0.0.0.0
something else is if i put pin 16 as high output the lights of the eth connectors lights up but i get the bootloader setup instead of the the serial print i defined:
okay so i succsceeded in seting a static ip address
my overall issues were :
i connected the 3.3volts power from my usb (the voltage was actuly 2.9 so it wasnt working well )
2.i didnt disconnect the i00 from ground, which didnt enable my code to run.
the enable needed to get gnd after each new code iteration.
i didn't send the proper parameters to ETH.BEGIN.
i am attaching the working code :
#include <ETH.h>
IPAddress local_IP(192, 168, 1, 50); // Static IP Address
IPAddress gateway(192, 168, 1, 1); // Gateway
IPAddress subnet(255, 255, 255, 0); // Subnet Mask
IPAddress primaryDNS(8, 8, 8, 8); // Primary DNS
IPAddress secondaryDNS(8, 8, 4, 4); // Secondary DNS
#define ETH_PHY_TYPE ETH_PHY_LAN8720
//#define ETH_PHY_ADDR 0 // commented out
//eth_phy_type_t ETH_PHY_LAN8720;
#define ETH_ADDR 1
#define ETH_POWER_PIN 16
// Pin# of the I²C clock signal for the Ethernet PHY
#define ETH_MDC_PIN 23
#define ETH_TYPE ETH_PHY_LAN8720
// Pin# of the I²C IO signal for the Ethernet PHY
#define ETH_MDIO_PIN 18
//#define ETH_PHY_POWER -1 // commented out
#define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT
uint8_t mac[] = {0xDE, 0xAD, 0xBE, 0xEE, 0xFE, 0xEE}; // use any MAC
void setup() {
Serial.begin(9600);
delay(1000);
// pinMode(16, OUTPUT); // set pin to output
//digitalWrite(16, HIGH); // turn on power
ETH.begin(ETH_PHY_TYPE,ETH_ADDR,ETH_MDC_PIN,ETH_MDIO_PIN,ETH_POWER_PIN,ETH_CLK_MODE);
ETH.macAddress(mac);
delay(100);
ETH.begin(); // Start Ethernet
ETH.config(local_IP, gateway, subnet, primaryDNS);;
}
void loop() {
Serial.print("IP Address: ");
Serial.println(ETH.localIP());
delay(5000);
}