0

I trying to interface ethernet module with esp32.My connections are as follows:

SO--> MOSI pin 23 SI--> MISO pin 19 CS--> CS pin 5 SCK-->CLK pin18

output data is:

rst:0x1 (POWERON_RESET),boot:0x13
(SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2 load:0x3fff0018,len:4 load:0x3fff001c,len:1044
load:0x40078000,len:10124 load:0x40080400,len:5828 entry 0x400806a8
Local IP : 0.0.0.0 Subnet Mask : 0.0.0.0 Gateway IP : 0.0.0.0 DNS
Server : 0.0.0.0 Ethernet Successfully Initialized

I cant able to connect to ethernet I don't know how to over come this.

     
    #include <utility/logging.h>

    EthernetClient ethClient;
                                                                                 
    uint8_t macaddress[6] = {0x1,0x2,0x3,0x4,0x5,0x6};

    void setup() {
  

    Serial.begin(115200);
    //Ethernet.init(5);
    Ethernet.begin(macaddress); // Dynamic IP setup 

    delay(5000);

    Serial.print("Local IP : ");
    Serial.println(Ethernet.localIP());
    Serial.print("Subnet Mask : ");
    Serial.println(Ethernet.subnetMask());
    Serial.print("Gateway IP : ");
    Serial.println(Ethernet.gatewayIP());
    Serial.print("DNS Server : ");
    Serial.println(Ethernet.dnsServerIP());
    Serial.println("Ethernet Successfully Initialized");
    }

    void loop()
    {

     
    }
Anurag Dabas
  • 23,866
  • 9
  • 21
  • 41
Rajkumar
  • 9
  • 1
  • 3
  • 1
    which library? Ethernet.begin(mac) returns false if it can't get an IP address by DHCP – Juraj Mar 30 '21 at 07:03
  • #include the library which i used. – Rajkumar Mar 31 '21 at 05:35
  • use EthernetENC library for new projects with enc28j60. see the Arduino Ethernet library WebClient example on how to use Ethernet.begin() and diagnose it. only change the include to EthernetENC.h and use Ethernet.init to set the CS pin. – Juraj Mar 31 '21 at 09:22

0 Answers0