Easy IP Camera for Lightburn

Hi Folks.
I have been doing some experiments with ESP32-Cam and an OV5640 camera over Wifi.
And I have had some success. It’s early days however I am posting my notes here. I will publish more in for following weeks (Awaiting parts) but if you are a bit of a hacker then you can get this to work.
I use the Arduino IDE.

Using an ESP32_Cam with an OV5640. Currently I have the AI Thinker ESP32.

Using these headers and libraries. Google for those particular libraries.

#include <WiFi.h>
#include <ESP32-RTSPServer.h>
#include “ESP32_OV5640_AF.h”
#include “esp_camera.h”

You create a RTSP feed. Then using a program called Splitcam you can attach Splitcam to your RTSP feed.
Once you can see the camera’s feed you can start Lightburn and go into the
Laser Tools/Manage Cameras/Add New and select USB
From that dropdown you will see *Splitcam Video Driver

And now Lightburn can see your Wifi ESP32 Camera.

Word of warning - the OV5640 get very hot so use a big heat sink. I am also waiting for a new ESP32S3 that have a OC5640 Auto Focus and hopefully get that to work.

But this is just the start of the project so that others more clever than me have a pathway :slight_smile: :slight_smile:
Enjoy Dave

Thanks Dave!,

Good choice to go with the S3 variant - that will be much better with the OV5640, being faster, and with hopefully more PSRAM.

I’ve got the XIAO_ESP32S3, but it’s looks like there are a bunch of other options with integrated camera support:

// ===================
// Select camera model
// ===================
//#define CAMERA_MODEL_WROVER_KIT // Has PSRAM
//#define CAMERA_MODEL_ESP_EYE  // Has PSRAM
//#define CAMERA_MODEL_ESP32S3_EYE // Has PSRAM
//#define CAMERA_MODEL_M5STACK_PSRAM // Has PSRAM
//#define CAMERA_MODEL_M5STACK_V2_PSRAM // M5Camera version B Has PSRAM
//#define CAMERA_MODEL_M5STACK_WIDE // Has PSRAM
//#define CAMERA_MODEL_M5STACK_ESP32CAM // No PSRAM
//#define CAMERA_MODEL_M5STACK_UNITCAM // No PSRAM
//#define CAMERA_MODEL_M5STACK_CAMS3_UNIT  // Has PSRAM
//#define CAMERA_MODEL_AI_THINKER // Has PSRAM
//#define CAMERA_MODEL_TTGO_T_JOURNAL // No PSRAM
#define CAMERA_MODEL_XIAO_ESP32S3 // Has PSRAM
// ** Espressif Internal Boards **
//#define CAMERA_MODEL_ESP32_CAM_BOARD
//#define CAMERA_MODEL_ESP32S2_CAM_BOARD
//#define CAMERA_MODEL_ESP32S3_CAM_LCD
//#define CAMERA_MODEL_DFRobot_FireBeetle2_ESP32S3 // Has PSRAM
//#define CAMERA_MODEL_DFRobot_Romeo_ESP32S3 // Has PSRAM

In my experience, you shouldn’t need Splitcam or any virtual webcam driver to act as a PC-side client for an RTSP stream since you can instead stream MJPEG over HTTP, and LightBurn will accept that URL directly as you can see in this forum post.

The CameraWebServer example that ships with the Arduino ESP32 board package is a good starting point: File>Examples>ESP32>Camera>CameraWebServer

I did make a couple of changes to the sketch in the Wifi block just before startCameraServer():

I set a static IP so the camera URL in LightBurn never changes after a router reboot;

  // Fixed IP configuration
  IPAddress local_IP(192, 168, 1, 200); //setup your fixed IP here
  IPAddress gateway(192, 168, 1, 1);
  IPAddress subnet(255, 255, 255, 0);
  IPAddress primaryDNS(8, 8, 8, 8);

  if (!WiFi.config(local_IP, gateway, subnet, primaryDNS)) {
    Serial.println("Failed to configure static IP");
  }

  WiFi.begin(ssid, password);
  WiFi.setSleep(false);
  Serial.print("WiFi connecting");
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("");
  Serial.println("WiFi connected");

I also disabled WiFi sleep with ‘WiFi.setSleep(false)’, just so the connection stays super responsive (although I didn’t actually test this).

The sketch streams on port 81 at /stream by default, so based on the configuration above, your LightBurn Network URL would be http://192.168.1.200:81/stream

I’ve got an industrial camera that uses gigE vision protocol.. Do you know if there’s a way to get it working in lightburn? I don’t seem to be able to get the RTSP stream from it..

Yes - that was the next part of what I will be doing is setting a static IP.

With the Xian I understand they have enableds a pin on the camera port so you can use the AutoFocus capabilities of the OV5640-AF. Which could be handy.

Many thanks for the information re the STREAM.. I was tearing out my hair trying to find out why Lightburn would not accept just the http. I will try the stream a little later.

Its so great that Lightburn has enables IP cameras as some of us don’t have the laser right next to us. Mine is about 5 meters way.

Many many thanks for replying and offering your valuable input.
Dave

Hi. This is a strange industrial camera but all is not lost. I googled, splitcam egig camera and it gave me some clues. You might also need to check the manufacturers documentation to see what streams it can provide.

The camera is more designed to give a large flow of frames over UDP - rather than a more sedate TCP system.

If you can tell me your camera’s make and model I can have a look further.

Thate Care
Dave

That’s mighty generous of you, many thanks in advance.

The camera is from Hikvison. Model MV-CU120GM.

Hi.
Found a couple of links for you to look at..

This is your unit.. https://www.maxxvision.com/downloads/Cameras/GigE/Hikrobot/Hikrobot_MV-CU120-10GMGC.pdf

And this might be the software you need to use it. But you will need to register.
https://www.hikrobotics.com/en/machinevision/service/download/?module=0

However I think you need to chat with the company re getting a copy of the software etc…

Wish I could help more :slight_smile: Dave

Yes, I have their software, it works fine, but the video can only be viewed in their software… There doesn’t seem to be a way to make a virtual camera or set up an RSTP stream.

The best solution I found is to use OBS, then set up a screen monitor for the app via a virtual camera, and then send that virtual camera to LightBurn. However, the resolution is horrible if done that way.