Hello with the help of Deva_Rishi we manage to get the ESP32 working with the Wiznet 5500 module to pull up a webpage. However i got a new problem I'm trying to do pinging a couple of local ip addresses.
This is the sketch we got working.
#include <SPI.h>
#include <Ethernet.h>
#define LED_YELLOW 2
#define VSPI_SCK 18
#define VSPI_MISO 19
#define VSPI_MOSI 23
#define W5500_CS 5
#define SPI_FRQ 32000000
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(192,168,1,177);
//SPIClass * vspi = NULL;
void setup() {
Serial.begin(115200);
pinMode(LED_YELLOW, OUTPUT);
digitalWrite(LED_YELLOW, LOW); // active LOW
//vspi = new SPIClass(VSPI);
//vspi->begin(VSPI_SCK, VSPI_MISO, VSPI_MOSI, W5500_CS);
//vspi->setFrequency(SPI_FRQ);
SPI.setFrequency(SPI_FRQ);
Serial.println("Starting ethernet");
Ethernet.init(W5500_CS); // set the CS pin
Ethernet.begin(mac,ip);
delay(1000);
Serial.println(Ethernet.localIP());
}
void loop() {
}
I'm able to see in serial monitor the ip address.
I have added #include <ESP32Ping.h> to the sketch and
if (digitalRead(BUTTON_PIN) == HIGH) {
bool success = Ping.ping("8.8.8.8", 3);
if(!success){
Serial.println("Ping remote failed");
return;
}
Serial.println("Ping remote host succesful.");
To the Setup for the ping. After compiling and uploading I get this from serial monitor.
Starting ethernet
192.168.1.177
assert failed: tcpip_send_msg_wait_sem IDF/components/lwip/lwip/src/api/tcpip.c:455 (Invalid mbox)
Backtrace: 0x400834a9:0x3ffb1ed0 0x400882a5:0x3ffb1ef0 0x4008d545:0x3ffb1f10 0x400df6b2:0x3ffb2040 0x400eb479:0x3ffb2070 0x400eb4d8:0x3ffb2090 0x400df529:0x3ffb20e0 0x400d286f:0x3ffb2100 0x400d2bfd:0x3ffb21f0 0x400d27ee:0x3ffb2220 0x400d2825:0x3ffb2240 0x400d1eab:0x3ffb2270 0x400d4325:0x3ffb2290
ELF file SHA256: 39405d7cb7f80d33
Rebooting...
ets Jul 29 2019 12:21:46
rst:0xc (SW_CPU_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:1
load:0x3fff0030,len:1184
load:0x40078000,len:13260
load:0x40080400,len:3028
entry 0x400805e4
My only guess it keeps rebooting the processor somehow. The code was made for the esp32 on wifi and it does work fine onthat. but not on ethernet. Does anyone know a ping that I can get to work for a esp32 on the wiznet W5500 please?
Joseph