Войти

Connecting an Ordinary Logitech Webcam to the Creality Ender-3 V3 KE – Part 1: Getting the Camera Working

B Автор Bisonar Team · 11 min · 2026-11-04

Connecting an Ordinary Logitech Webcam to the Creality Ender-3 V3 KE – Part 1: Getting the Camera Working

Türkçe versiyonu

Creality sells an official camera for the Ender-3 V3 KE, the Nebula Camera. You plug it into USB and it works. What I had in a drawer was an 8-year-old Logitech webcam. My question was simple: can this ordinary webcam replace Creality's own camera?

I couldn't find a clear source that confirmed it. There were KE owners asking the same question on the Creality forum, but I didn't see an answer. So I tried it myself. This post is the story of that trip: from plug and play, into the Linux system inside the printer, through Creality's camera scripts, and finally down to the bytes of a JPEG file.

Short answer: Yes, it works. The camera now starts with the printer's own camera service and shows a live picture in the browser and in OrcaSlicer's Device tab. But I had to get past two obstacles, and neither was where I expected it.

What I have

  • Printer: Creality Ender-3 V3 KE, Klipper-based Creality OS V1.1.0.15
  • Webcam: a Logitech webcam I bought about 8 years ago, so no extra cost for this project. I thought it was a C505E, but it turned out to be a C310 (more on that below).
  • Computer: a Mac (for SSH, Creality Print, Creality Cloud and OrcaSlicer)

Logitech webcam

To see where the camera could go, I first held it in front of the bed. A proper mount is the next job.

Webcam in front of the bed, a possible position

The plan

  1. Plug and play first: plug the webcam into the printer's USB port and check for a picture in Creality Print.
  2. If that fails, root: use SSH to see whether the system sees the camera at all.
  3. Get the picture onto the computer somehow.

First try: plug and play

I plugged the webcam into the printer's USB port and opened the Device tab in Creality Print on the Mac. The printer showed up on the network with temperatures and axis controls. The camera area had no picture, only this warning: "Please check Does the printer camera device work properly."

Creality Print: no camera picture

Maybe it only looks for a camera at boot, so I restarted the printer with the webcam plugged in. Same result.

To find out whether the system didn't see the camera at all, or saw it but Creality's software didn't use it, I had to look inside the printer. Creality offers official root access on this printer (Settings > Root account information). Root may affect the warranty. Mine had already expired, so I had nothing to lose.

Looking inside with root

I enabled root and connected from the Mac over SSH. Inside the printer runs a small computer with a MIPS CPU and a Linux 4.4 kernel:

Linux Ender3V3KE-XXXX 4.4.94 #7 SMP PREEMPT Tue Aug 6 09:11:30 CST 2024 mips GNU/Linux

The first surprise came from lsusb:

Bus 001 Device 006: ID 046d:081b Logitech, Inc. Webcam C310

My camera wasn't a C505E but a Logitech C310. They look almost the same and both are 720p. What matters to the printer is that the camera supports the UVC standard.

The kernel log (dmesg) had good news. The UVC driver had recognized the camera:

uvcvideo: Found UVC 1.00 device <unnamed> (046d:081b)
auto_uvc.sh (952): drop_caches: 3

At boot the camera connected and dropped a few times, and once the driver failed to start it (error -71, usually USB power or cable). On the last attempt it was recognized properly and /dev/video4 appeared. The other video devices are the printer chip's own internal units:

/sys/class/video4linux/video0: ingenic-rot
/sys/class/video4linux/video1: helix-venc
/sys/class/video4linux/video2: felix-vdec
/sys/class/video4linux/video3: Dummy video device (0x0000)
/sys/class/video4linux/video4: UVC Camera (046d:081b)

So the hardware and driver side worked. The problem was that Creality's software didn't use the camera. The script that runs when a camera is plugged in was right there in dmesg: auto_uvc.sh.

What does auto_uvc.sh do?

The script lives at /usr/bin/auto_uvc.sh, with the original in the read-only /rom partition. There is no brand or model check in it. In short it does this:

  1. If the camera appears under /dev/v4l/by-id/ as main-video…, it carries on.
  2. If the camera doesn't support MJPG, it stops.
  3. It starts Creality's cam_app program, which always asks for 1920×1080 at 15 fps.
  4. It streams the picture with mjpg_streamer on port 8080.

    MAIN_PIC_WIDTH=1920 MAIN_PIC_HEIGHT=1080 MAIN_PIC_FPS=15

According to v4l2-ctl --list-formats-ext, the C310 supports MJPG but tops out at 1280×960 and 1280×720. 1920×1080 is not on the list. And ps showed neither cam_app nor mjpg_streamer. That was my first suspicion: cam_app asks for a resolution the camera can't give and exits.

The real culprit: /tmp/.cam_version

I started cam_app by hand at 1280×720. It still exited within seconds, so my suspicion was wrong. cam_app doesn't print errors to the screen. It writes them to its own log (/usr/data/creality/userdata/log/cam_app.log), which had the same lines for every attempt:

[INFO]-[ingenic_video.c](569) realpath: /dev/video4
[ERROR]-[ingenic_video.c](450) open file /tmp/.cam_version failed!
[INFO]-[ingenic_video.c](1075) service will exit, ret = -1

cam_app looks for /tmp/.cam_version at startup and exits when it isn't there. That file is written by the fw_info function in auto_uvc.sh, but only if cam_util can read a firmware version from the camera. On the C310, cam_util replied:

Could not find/open sonix device
Device /dev/v4l/by-id/main-video-4 opened: UVC Camera (046d:081b).
ioctl(UVCIOC_CTRL_SET) FAILED (-1)
Get uvc extend unit id fail

cam_util tries to talk to a Sonix chip in the camera over a vendor-specific UVC "extension unit". Creality's camera answers there. The Logitech doesn't. So the version file never gets written and cam_app never starts. There is no explicit brand lock in the software, but there is an indirect one.

I wrote the file by hand, in the format the script uses, with "Logitech" as the manufacturer. cam_app read it but still exited:

[INFO]-[ingenic_video.c](455) fw_info json file: { "main_cam": { ... "manufactory": "Logitech", ... } }
[INFO]-[ingenic_video.c](1075) service will exit, ret = -1

The script mentions two manufacturer names, STsmart_- and STJC-000I, which are the names in Creality cameras' firmware. I replaced "Logitech" with STsmart_- and tried again:

/usr/bin/cam_app -i /dev/v4l/by-id/main-video-4 -t 0 -w 1280 -h 720 -f 15 -c
/usr/bin/mjpg_streamer -i input_memfd.so -t 0 -o output_http.so -w /usr/share/mjpg-streamer/www/ -p 8080

This time both stayed up, and at http://<printer-ip>:8080/?action=stream in the browser the first picture appeared:

First picture from the Logitech C310, through the printer's own mjpg_streamer

A few minutes later the picture went completely black. I was about to start debugging a dead camera when I realized I had switched off the room light. With the light back on, the picture came back:

The printer frame and Z screw seen by the camera

A permanent patch

The file I wrote by hand was in /tmp and would be gone after a reboot. So I made a patched copy of auto_uvc.sh (code/auto_uvc.sh). It differs from the original in two ways:

  1. If cam_util can't read firmware info from the camera, the script writes /tmp/.cam_version itself with STsmart_- as the manufacturer. It keeps updates switched off (can_update: false), so the printer never tries to flash Creality camera firmware onto the Logitech.
  2. If the camera has no 1920×1080 MJPG mode, it uses 1280×720. Creality's own camera still gets 1080p.

Installing it takes two commands:

scp -O code/auto_uvc.sh root@<printer-ip>:/tmp/auto_uvc.sh
ssh root@<printer-ip> "sh -n /tmp/auto_uvc.sh && cp /tmp/auto_uvc.sh /usr/bin/auto_uvc.sh && chmod +x /usr/bin/auto_uvc.sh"

sh -n checks the syntax first, and nothing is copied if it fails. Going back is one command too, because the original stays in /rom:

ssh root@<printer-ip> "cp /rom/usr/bin/auto_uvc.sh /usr/bin/auto_uvc.sh"

After a reboot the camera came up on its own without any commands. The printer's main service now sees it too:

pack_camera_status: {"cameras":{"camera_main":{"online":1},"camera_sub":{"online":0}}}
[Heartbeat] udisk0 = 0, ethernet = 0, camera0 = 1

Creality Print and Creality Cloud

The browser had a picture, but Creality Print still didn't. That's because Creality's apps don't use port 8080. They use a separate webrtc service, which takes H.264 video from cam_app and sets up the connection through Creality's cloud (api.crealitycloud.com), not over the local network. There is no local WebRTC port open on the printer.

Creality Print never started a connection. In the Creality Cloud desktop app, though, a ▶ button appeared in the camera area, so the cloud does see the camera. Pressing it set up a connection:

"pcPool": [{ "iceState": "connected", ... }]

But the screen stayed grey:

Creality Cloud: connection set up but the picture is grey

While connected, webrtc used 0% CPU, so it wasn't sending any video. cam_app had opened the chip's H.264 encoder (/dev/video1, helix-venc), but frames didn't seem to reach it. I found out why in the next experiment.

OrcaSlicer, and the real reason: a missing Huffman table

I tried OrcaSlicer. When adding the printer I picked CrealityPrint as the connection type and gave it the printer's IP. The test passed on the first try:

OrcaSlicer: CrealityPrint connection settings

OrcaSlicer: connected successfully

Orca's Device tab shows the "Device UI" address from the connection settings. With the camera address there, the page opened, but there was a broken image icon where the picture should be. Neither the live stream nor a single snapshot (?action=snapshot) opened. The same snapshot URL was broken in Safari too, while Chrome showed it fine.

I downloaded a snapshot and looked inside:

snap.jpg: JPEG image data, baseline, precision 8, 1280x720, components 3
DHT (FFC4): 0   DQT (FFDB): 2   SOF0 (FFC0): 1

The frame has no Huffman table (DHT) at all. This is a known shortcut in MJPEG cameras. The Huffman table is the same in every frame, so the camera leaves it out and expects the decoder to insert the standard one from the JPEG spec (ITU T.81, Annex K.3). Chrome does that. Safari's engine, WebKit, and the macOS image library don't. macOS's sips tool couldn't even read the image size.

As proof, I inserted the standard table (420 bytes) into the same frame right before the FFDA marker (start of scan). macOS opened it immediately:

The frame with the Huffman table inserted

This most likely explains the grey Creality Cloud screen too: the hardware JPEG decoder in the printer's H.264 path probably can't open these table-less frames either. I couldn't confirm it, because cam_app is closed source.

The fix: add the table in the page

My first idea was to take the picture with mjpg_streamer's own input_uvc plugin instead of cam_app, since that plugin inserts the missing table itself. But the plugin didn't start in Creality's build of mjpg_streamer.

So I added the table on the viewing side instead. I wrote a small page, code/kamera.html. It grabs a frame with ?action=snapshot five times a second. If the frame has no FFC4, it inserts the standard Huffman table before FFDA and shows the result as a Blob in an <img>.

I copied the page into the printer's own mjpg_streamer folder. That way it is served from the same address (port 8080) and doesn't run into the browser's cross-origin (CORS) rules:

scp -O code/kamera.html root@<printer-ip>:/usr/share/mjpg-streamer/www/kamera.html

Then in OrcaSlicer I set "Device UI" to http://<printer-ip>:8080/kamera.html. The Logitech picture appeared in the Device tab. The clock in the bottom-left corner updates with each frame:

The Logitech C310 picture in OrcaSlicer's Device tab

The same page works in Safari. The nice part of this approach is that it doesn't touch Creality's cam_app setup at all, so the printer still counts the camera as connected.

Result

  • An ordinary Logitech C310 works with the Ender-3 V3 KE's own camera service. All it takes is a small patch to auto_uvc.sh.
  • The camera starts on its own when the printer boots. In Chrome the picture is at http://<printer-ip>:8080/?action=stream.
  • Safari and OrcaSlicer need the Huffman table added to each frame. kamera.html does that, and Orca's Device tab shows live video.
  • Creality Cloud sees the camera and connects, but no picture arrives. Creality Print doesn't connect at all. If you want to watch in Creality's own apps, Creality's camera is still the easiest way.

A firmware update may remove the auto_uvc.sh patch and kamera.html. If that happens, copy both again with the same commands. If the printer ever offers a camera firmware update, don't accept it.

What I learned

  • The error isn't on the screen, it's in the log. cam_app exited without printing anything. The real reason was in the log under /usr/data/creality/userdata/log/. If a service quietly dies on Creality OS, that's the first place to look.
  • The first suspect can be wrong. The resolution theory looked very convincing and was wrong. Testing it with a single change (only the resolution) showed that within minutes.
  • A "brand lock" isn't always an explicit check. There was no "Creality cameras only" line in the software. But a chain that can't read a firmware version from the camera had the same effect.
  • Working in a browser doesn't mean the file is correct. Chrome quietly fills in the missing Huffman table. Safari, macOS and the printer's hardware decoder don't. When an image opens in one place and not another, look at its bytes.
  • Know your way back before you change things as root. The original script sits in the read-only /rom partition, so every change could be undone with one command. That made it easy to experiment.

What's next

Next up: printing a fixed camera mount and adding the stream to Home Assistant. Both go into the next part.

💻 Code and images on GitHub: https://github.com/justicemilitia/bisonar-ai/tree/main/creality-usb-webcam

AI Automationn8nBusiness
Поделиться:
← Все статьи