Streaming video from ESP32-CAM over Ethernet via W5500

laukejas
Posts: 7
Joined: Thu Apr 11, 2019 3:28 pm

Streaming video from ESP32-CAM over Ethernet via W5500

Postby laukejas » Sun Oct 13, 2024 10:11 am

Hi, I have a project where I need to stream video from ESP32-CAM directly to a laptop via an Ethernet cable instead of WiFi. I am using W5500 Ethernet controller to facilitate this, and a standard FTDI programmer to upload sketches to ESP. Using Arduino IDE for now, but will switch to Visual Studio Community later. The end goal is to have low-latency (<150ms) live video stream that I could embed on a custom Windows C# application. FTDI will be removed in the final version of course.

I have followed this tutorial to test video streaming over WiFi, and it worked.

Now, I am trying to do the same over W5500 instead of WiFi. This is my wiring:

Image

ESP32-CAM to W5500:
GPIO12 -> MISO
GPIO13 -> MOSI
GPIO14 -> SCLK
GPIO2 -> SCS
GND -> GND
5V -> V

I found this library to get a basic connection over Ethernet, but the example provided there didn't work, so I removed everything to bare bones to identify the issue:

Code: Select all

#include <SPI.h>
#include <EthernetSPI2.h>

byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED}; 
byte ip[] = {192, 168, 1, 15};  
byte gateway[] = {192, 168, 1, 254}; 
byte subnet[] = {255, 255, 255, 0}; 
EthernetServer server(80); 

void setup()
{
  Serial.begin(115200);
  Ethernet.init(2);
  Ethernet.begin(mac, ip, gateway, subnet);  //start Ethernet

  // Check for Ethernet hardware present
  if (Ethernet.hardwareStatus() == EthernetNoHardware) {
    Serial.println("Ethernet shield was not found.  Sorry, can't run without hardware. :(");
    while (true) {
      delay(200);
    }
  }
  while (Ethernet.linkStatus() == LinkOFF) {
    Serial.println("Ethernet cable is NOT connected.");
      delay(500); 
  }

  Serial.println("Ethernet cable is now connected.");

  Serial.print("localIP: ");
  Serial.println(Ethernet.localIP());
  Serial.print("subnetMask: ");
  Serial.println(Ethernet.subnetMask());
  Serial.print("gatewayIP: ");
  Serial.println(Ethernet.gatewayIP());
  Serial.print("dnsServerIP: ");
  Serial.println(Ethernet.dnsServerIP());
}

void loop()
{
}
After uploading the sketch, removing the boot pin jumper and rebooting ESP, I get this on the Serial Monitor:
rst:0x1 (POWERON_RESET),boot:0x1b (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:4832
load:0x40078000,len:16460
load:0x40080400,len:4
load:0x40080404,len:3504
entry 0x400805cc
Ethernet cable is now connected.
localIP: 0.0.0.0
subnetMask: 0.0.0.0
gatewayIP: 0.0.0.0
dnsServerIP: 192.168.2.254
As you can see, the W5500 connection checks passed, but for some reason IP is 0.0.0.0. I googled this and it always seems to be a hardware issue, but in my case I am 100% I wired everything correctly, and I checked with multimeter between ESP and W5500 pins to ensure I have continuity everywhere, no bad pins or anything. I also tried supplying 5V external power from PSU to all devices, but it didn't make any difference. I also tried supplying a different IP (192.168.2.15) so it doesn't clash with my home WiFi that the laptop is connected to, but it didn't help either.

For testing, I tried removing W5500, and then I get "can't run without hardware", and if I unplug the Ethernet cable from the laptop, I get "Ethernet cable is NOT connected"), meaning ESP can see everything up to the laptop, so it shouldn't be a hardware problem.

Can anyone help me solve this issue? And afterwards, when it's solved, how do I adapt the live streaming server sketch (found in Arduino IDE -> File -> Examples -> ESP32 -> Camera -> CameraWebServer) to stream over this Ethernet connection rather than WiFi? Am I even going in the right direction here?

laukejas
Posts: 7
Joined: Thu Apr 11, 2019 3:28 pm

Re: Streaming video from ESP32-CAM over Ethernet via W5500

Postby laukejas » Fri Oct 18, 2024 5:22 pm

Bump. Can anyone help, please? I've been told I have to use a cross-over Ethernet cable here, and that is what I am using (also tried regular one). In both cases, I get IP 0.0.0.0. Really need some help.

nathan.williams2012
Posts: 1
Joined: Tue Oct 22, 2024 5:55 am

Re: Streaming video from ESP32-CAM over Ethernet via W5500

Postby nathan.williams2012 » Tue Oct 22, 2024 6:05 am

I am interested obtaining an answer to this question as well. I have a similar project where I would like to have an ESP32-CAM running underwater powered by POE from the surface and interfacing with another ESP32 to WIFI on the surface. If I can make this happen with the W5500 module I would be very happy. Please share any ideas in getting something like this to work.

aliarifat794
Posts: 200
Joined: Sun Jun 23, 2024 6:18 pm

Re: Streaming video from ESP32-CAM over Ethernet via W5500

Postby aliarifat794 » Tue Oct 22, 2024 9:12 am

The IP address being assigned as 0.0.0.0, typically indicates a failure to obtain an IP address. The static IP you are assigning (192.168.1.15 or 192.168.2.15) should not conflict with another device on your network. Your laptop and router should be on the same subnet as the W5500 (e.g., 192.168.1.x or 192.168.2.x),

If you consider making an ESP32 module with an on-board camera, you can follow this design: https://www.pcbway.com/project/gifts_de ... odule.html

Who is online

Users browsing this forum: MicroController and 59 guests