Skip to content

jmz3/EndoscopeCamera

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cost-effective USB endoscope

Cheap endoscope cameras can be used for soft robot, surgical robot, or any application needing a small camera. You can get one for around $20 on Amazon.

External and Endo (2 Cam) demos

Technical information

‘Geek szitman supercamera’ is a camera chip using the com.useeplus.protocol (officially only working on iOS/Android apps like ‘Usee Plus’). Only firmware version 1.00 has been tested. USB descriptors can be found in file the descriptors folder.

Contrary to the advertised specification, the camera resolution is 640×480.

Prerequisite (simple Ubuntu setup)

First install the required packages:

sudo apt-get update
sudo apt-get install -y \
    libusb-1.0-0-dev \
    pkg-config \
    build-essential \
    cmake \
    libopencv-dev \
    python3-pip

Create the USB rule file so the USB device can be accessed by all users

echo 'SUBSYSTEMS=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="2ce3", ATTRS{idProduct}=="3828", MODE="0666"' | sudo tee /etc/udev/rules.d/99-supercamera.rules

Then reload and trigger the rules:

sudo udevadm control --reload-rules
sudo udevadm trigger

Important: disconnect and reconnect the USB cable so udev applies new permissions.

Verify permissions:

lsusb | grep 2ce3:3828
# Expected: Bus 001 Device 009: ID 2ce3:3828

ls -l /dev/bus/usb/001/009
# Expected: crw-rw-rw- ... /dev/bus/usb/001/009

The bus/device numbers (001/009 above) must match your actual lsusb output.

Build

Build with CMake under the root directory of the repo:

cmake -S . -B build
cmake --build build -j

Legacy Makefile build is still available:

make

Please follow USAGE.md for usage instructions.

Troubleshooting

Feel free to open an issue. Please recompile with VERBOSE = 3 and include full logs.

If your hardware is different, do include its USB descriptors:

lsusb -vd $(lsusb | grep Geek | awk '{print $6}')

Additional udev rule for alternate VID/PID

Some devices enumerate as 0329:2022. Add this rule if needed:

echo 'SUBSYSTEMS=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="0329", ATTRS{idProduct}=="2022", MODE="0666"' | sudo tee -a /etc/udev/rules.d/99-supercamera.rules

Known issues:

  • fatal: usb device not found: check your device is properly plugged in. Check you have added udev rules properly. Try to run the program with root privileges: sudo ./out.

Aknowledgements

This repo is made possible thanks to @hbens for reverse engineering the USB protocol and sharing the details in his repo, which made this project possible.

About

c++ and python visualize & streaming interface for super cheap endoscope cameras

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages