What is the problem?
Octoprint detects and uses C270 webcam if only webcam plugged in, but when another usb cable plugged in (such as to 3d printer main board itself) and the 2nd usb cable isn't connected to anything, just the moment the 2nd usb cable is plugged in, octoprint suddenly stop detecting the webcam (webcam green light disappears) What did you already try to solve it?
reflash/reinstalled Octoprint on sd card, also played with camera settings in octopi.txt, tried different power supplies
Additional information about your setup (OctoPrint version, OctoPi version, printer, firmware, octoprint.log, serial.log or output on terminal tab, ...)
Here is the weird thing though, I tried another one of my extra raspberry pi's with another octoprint installed on it (for a future 3d printer), and same problem?
all using the newest Octopi 1.3.8
Printer is Tronxy X5s but using another board (MKS gen 1.4)
Not sure if it's octoprint or the raspberry pi, I've tried 3 different pis same issue
On my Cr-10 with Octopi 1.3.5 it works perfectly fine (also using a C270)
You might try running sudo dmesg before and after plugging in the second USB. The C270 might normally show up as /dev/video0.
Is this a Raspberry Pi 3B or something else?
It's interesting that the 1.3.5 works and 1.3.8 doesn't.
What's also interesting is that when you plug in a serial USB device, you lose the webcam. The webcam can't use a UART on the Raspi, can it? But then again, the S in USB is "serial" so, yeah. There are two UARTs in the Raspi and only one of them is awesome.
Try disabling Bluetooth and removing the ability of the console to happen over serial (sudo raspi-config). Not sure if that could help but it won't hurt unless you're using a Bluetooth keyboard/mouse or similar.
Thanks for the advice , I did the dmesg, and it gave this, it's long but if you scroll down it says stuff like over current change? it's too strong? lol. I don't know how to disable bluetooth but I disabled the happen over serial on rasp-config and still the same thing.
Yes it's a Raspberry pi 3B (NOt the newest + version)
New USB device found, idVendor=046d, idProduct=0825
[ 2.416339] usb 1-1.2: New USB device strings: Mfr=0, Product=0, SerialNumber =2
[ 2.419154] usb 1-1.2: SerialNumber: D2992660
[ 2.733467] systemd[1]: Listening on Journal Socket (/dev/log).
[ 2.740350] systemd[1]: Created slice User and Session Slice.
[ 2.746561] systemd[1]: Started Forward Password Requests to Wall Directory W atch.
[ 2.755915] systemd[1]: Set up automount Arbitrary Executable File Formats Fi le System Automount Point.
[ 2.765350] systemd[1]: Listening on Journal Socket.
[ 2.771751] systemd[1]: Listening on udev Kernel Socket.
[ 2.778064] systemd[1]: Listening on udev Control Socket.
[ 3.264574] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[ 3.362567] systemd-journald[104]: Received request to flush runtime journal from PID 1
[ 3.829304] snd_bcm2835: module is from the staging directory, the quality is unknown, you have been warned.
[ 3.835152] bcm2835_alsa bcm2835_alsa: card created with 8 channels
[ 3.954499] brcmfmac: F1 signature read @0x18000000=0x1541a9a6
[ 3.962324] brcmfmac: brcmf_fw_map_chip_to_name: using brcm/brcmfmac43430-sdi o.bin for chip 0x00a9a6(43430) rev 0x000001
[ 3.962629] usbcore: registered new interface driver brcmfmac
[ 4.062831] media: Linux media interface: v0.10
[ 4.107610] Linux video capture interface: v2.00
[ 4.198769] brcmfmac: brcmf_c_preinit_dcmds: Firmware version = wl0: Oct 23 2 017 03:55:53 version 7.45.98.38 (r674442 CY) FWID 01-e58d219f
[ 4.199715] brcmfmac: brcmf_c_preinit_dcmds: CLM version = API: 12.2 Data: 7. 11.15 Compiler: 1.24.2 ClmImport: 1.24.1 Creation: 2014-05-26 10:53:55 Inc Data: 9.10.39 Inc Compiler: 1.29.4 Inc ClmImport: 1.36.3 Creation: 2017-10-23 03:47:1 4
[ 5.071143] uart-pl011 3f201000.serial: no DMA platform data
[ 5.538855] usb 1-1.2: set resolution quirk: cval->res = 384
[ 5.540223] usbcore: registered new interface driver snd-usb-audio
[ 5.540276] uvcvideo: Found UVC 1.00 device (046d:0825)
[ 5.555809] uvcvideo 1-1.2:1.0: Entity type for entity Extension 4 was not in itialized!
[ 5.555826] uvcvideo 1-1.2:1.0: Entity type for entity Extension 6 was not in itialized!
[ 5.555838] uvcvideo 1-1.2:1.0: Entity type for entity Extension 7 was not in itialized!
[ 5.555845] uvcvideo 1-1.2:1.0: Entity type for entity Processing 2 was not i nitialized!
[ 5.555859] uvcvideo 1-1.2:1.0: Entity type for entity Extension 3 was not in itialized!
[ 5.555869] uvcvideo 1-1.2:1.0: Entity type for entity Camera 1 was not initi alized!
[ 5.557074] input: UVC Camera (046d:0825) as /devices/platform/soc/3f980000.u sb/usb1/1-1/1-1.2/1-1.2:1.0/input/input0
[ 5.557246] usbcore: registered new interface driver uvcvideo
[ 5.557251] USB Video Class driver (1.1.1)
[ 5.597517] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 5.597531] brcmfmac: power management disabled
[ 5.716604] Adding 102396k swap on /var/swap. Priority:-2 extents:1 across:1 02396k SSFS
[ 5.832853] random: crng init done
[ 6.023304] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[ 6.023539] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 6.559740] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[ 9.580455] Bluetooth: Core ver 2.22
[ 9.580498] NET: Registered protocol family 31
[ 9.580501] Bluetooth: HCI device and connection manager initialized
[ 9.580515] Bluetooth: HCI socket layer initialized
[ 9.580523] Bluetooth: L2CAP socket layer initialized
[ 9.580541] Bluetooth: SCO socket layer initialized
[ 9.591790] Bluetooth: HCI UART driver ver 2.3
[ 9.591800] Bluetooth: HCI UART protocol H4 registered
[ 9.591803] Bluetooth: HCI UART protocol Three-wire (H5) registered
[ 9.591919] Bluetooth: HCI UART protocol Broadcom registered
[ 9.740697] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 9.740707] Bluetooth: BNEP filters: protocol multicast
[ 9.740724] Bluetooth: BNEP socket layer initialized
[ 842.091637] usb 1-1-port2: over-current change
[ 842.630805] usb 1-1.5: new full-speed USB device number 5 using dwc_otg
[ 842.788288] usb 1-1.5: New USB device found, idVendor=0403, idProduct=6001
[ 842.788301] usb 1-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber =3
[ 842.788310] usb 1-1.5: Product: FT232R USB UART
[ 842.788318] usb 1-1.5: Manufacturer: FTDI
[ 842.788326] usb 1-1.5: SerialNumber: A10664GX
[ 842.797140] usb 1-1-port2: over-current change
[ 842.836962] usbcore: registered new interface driver usbserial
[ 842.837042] usbcore: registered new interface driver usbserial_generic
[ 842.837099] usbserial: USB Serial support registered for generic
[ 842.849183] usbcore: registered new interface driver ftdi_sio
[ 842.849260] usbserial: USB Serial support registered for FTDI USB Serial Devi ce
[ 842.849882] ftdi_sio 1-1.5:1.0: FTDI USB Serial Device converter detected
[ 842.850018] usb 1-1.5: Detected FT232RL
[ 842.850995] usb 1-1.5: FTDI USB Serial Device converter now attached to ttyUS B0
[ 843.115622] usb 1-1-port2: over-current change
[ 843.371609] usb 1-1-port2: over-current change
[ 843.627597] usb 1-1-port2: over-current change
[ 843.883602] usb 1-1-port2: over-current change
[ 844.139600] usb 1-1-port2: over-current change
[ 844.395611] usb 1-1-port2: over-current change
[ 844.651611] usb 1-1-port2: over-current change
[ 844.907598] usb 1-1-port2: over-current change
[ 845.163603] usb 1-1-port2: over-current change
[ 845.419599] usb 1-1-port2: over-current change
[ 845.675612] usb 1-1-port2: over-current change
[ 845.931605] usb 1-1-port2: over-current change
[ 846.187607] usb 1-1-port2: over-current change
[ 846.443601] usb 1-1-port2: over-current change
[ 846.699601] usb 1-1-port2: over-current change
[ 846.955600] usb 1-1-port2: over-current change
[ 847.211608] usb 1-1-port2: over-current change
[ 847.467606] usb 1-1-port2: over-current change
[ 847.723606] usb 1-1-port2: over-current change
[ 847.979600] usb 1-1-port2: over-current change
[ 848.235603] usb 1-1-port2: over-current change
[ 848.491600] usb 1-1-port2: over-current change
[ 848.747601] usb 1-1-port2: over-current change
[ 849.003601] usb 1-1-port2: over-current change
[ 849.259600] usb 1-1-port2: over-current change
[ 849.515604] usb 1-1-port2: over-current change
[ 849.771611] usb 1-1-port2: over-current change
[ 850.027603] usb 1-1-port2: over-current change
[ 850.283612] usb 1-1-port2: over-current change
[ 850.539602] usb 1-1-port2: over-current change
[ 850.795609] usb 1-1-port2: over-current change
[ 851.051613] usb 1-1-port2: over-current change
[ 851.307608] usb 1-1-port2: over-current change
[ 851.563609] usb 1-1-port2: over-current change
[ 851.819610] usb 1-1-port2: over-current change
[ 852.075612] usb 1-1-port2: over-current change
[ 852.331623] usb 1-1-port2: over-current change
[ 852.587685] usb 1-1-port2: over-current change
Ah. Is it possible that your Raspi is getting powered by both the 5V adapter and the controller board as well?
Some people use tape inside the USB cable that connects over to the controller board (RAMPS) to prevent it from supplying 5V as well. There may be a jumper on your RAMPS board to tell it to not do that.
Omg my goodness, it worked! I have to make it clear though, the 2nd USB plug did not have to be connected to the MKS gen, just the moment I plug that 2nd USB in, camera shuts off. The tape over the + pin over the 2nd usb cable did the trick though! It seems like the raspberry pis I have might not have enough power supply (even though the power is 5V at 2.5 Amps) and can't provide to both. But the tape method worked! Thank you so very much! So people should be known that this just doesn't happen to RAMPS board, but also MKS gen and also some raspberry pis (my earlier ones didn't have this problem)