LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
LinkBack Search this Thread
Old 12-29-2012, 09:55 AM   #1
aurium
LQ Newbie
 
Registered: Dec 2009
Distribution: Debian
Posts: 7

Rep: Reputation: 0
Question How to control LEDs from USB Webcam?


I have a new chinese webcam plugable by USB, with 6 LEDs to help night talks. However the lights do not turn on. Never! The cam has no buttons and the box says that is compatible with Linux.

I try the cam with Cheese and GUVCViewer. The cam works with no changes on LEDs and the mic do not works. (forgot the mic by now...)

Code:
$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
...
Bus 001 Device 009: ID 0c45:62c0 Microdia Sonix USB 2.0 Camera
Looks ok.

As i know, we can directly change some hardware configurations, writing on /sys, so first i found camera path:
Code:
# dmesg | grep -i camera
...
[66449.007123] input: USB 2.0 Camera as /devices/pci0000:00/0000:00:1d.7/usb1/1-3/1-3:1.0/input/input14
Second, search for *led*:
Code:
# ls /sys/devices/pci0000\:00/0000\:00\:1d.7/usb1/1-3/1-3\:1.0/input/input14
capabilities  device  event10  id  modalias  name  phys  power	properties  subsystem  uevent  uniq
# ls /sys/devices/pci0000\:00/0000\:00\:1d.7/usb1/1-3/1-3\:1.0/input/input14/capabilities/
abs  ev  ff  key  led  msc  rel  snd  sw
Found!

Code:
# cat /sys/devices/pci0000\:00/0000\:00\:1d.7/usb1/1-3/1-3\:1.0/input/input14/capabilities/led
0
hummm... may changing to 1 that will turn on.

Code:
# ls -l /sys/devices/pci0000\:00/0000\:00\:1d.7/usb1/1-3/1-3\:1.0/input/input14/capabilities/led
-r--r--r-- 1 root root 4096 Dez 29 12:34 /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-3/1-3:1.0/input/input14/capabilities/led
Code:
# chmod +w /sys/devices/pci0000\:00/0000\:00\:1d.7/usb1/1-3/1-3\:1.0/input/input14/capabilities/led
Ok! That is -rw-r--r-- now.

Code:
# echo 1 > /sys/devices/pci0000\:00/0000\:00\:1d.7/usb1/1-3/1-3\:1.0/input/input14/capabilities/led
-bash: echo: write error: Input/output error
WTF?

Trying another way... The uevent special file looks promising:
Code:
# cat /sys/devices/pci0000\:00/0000\:00\:1d.7/usb1/1-3/1-3\:1.0/input/input14/uevent 
PRODUCT=3/c45/62c0/100
NAME="USB 2.0 Camera"
PHYS="usb-0000:00:1d.7-3/button"
PROP=0
EV=3
KEY=100000 0 0 0 0 0 0
MODALIAS=input:b0003v0C45p62C0e0100-e0,1,kD4,ramlsfw
Code:
# echo LED=1 >> /sys/devices/pci0000\:00/0000\:00\:1d.7/usb1/1-3/1-3\:1.0/input/input14/uevent
No fail!

Code:
# cat /sys/devices/pci0000\:00/0000\:00\:1d.7/usb1/1-3/1-3\:1.0/input/input14/uevent 
PRODUCT=3/c45/62c0/100
NAME="USB 2.0 Camera"
PHYS="usb-0000:00:1d.7-3/button"
PROP=0
EV=3
KEY=100000 0 0 0 0 0 0
MODALIAS=input:b0003v0C45p62C0e0100-e0,1,kD4,ramlsfw
But no change too.

That is wrong? There is another way?
I only want to turn on the webcam lights.
 
Old 01-03-2013, 06:41 AM   #2
roreilly
Member
 
Registered: Aug 2006
Location: Canada
Distribution: Debian, Slackware
Posts: 105

Rep: Reputation: 28
What model of camera? Do you have a link to the product page?

Any chance those led's are infrared? If so, you won't see when they are on, but the camera's sensors
will be able to.
 
Old 01-03-2013, 07:31 PM   #3
aurium
LQ Newbie
 
Registered: Dec 2009
Distribution: Debian
Posts: 7

Original Poster
Rep: Reputation: 0
The cam looks exactly like that: http://sell.lulusoso.com/selling-lea...mera-k038.html ... but that is a common design for webcams.

The box has no reference to the manufacturer or any product detail. The only useful thing on the box is: "driveless camera" and "Support Windows, MacOS and Linux". The cam itself has no number, code or anything written on that.

The LEDs are not infrared. That was my first try.
 
  


Reply

Tags
led, sys, webcam


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
webcam control abhikohokade Programming 1 01-06-2012 09:26 AM
Contract and Bightness control OR iris control for Logitech Communicate STX webcam nicsmr Linux - Hardware 0 03-13-2008 10:35 AM
MSI StarCam Clip Webcam - problem activating IR LEDs alexandre_fs Linux - Hardware 4 01-30-2007 11:09 AM
How To Install A Usb Webcam [Genius WebCam on Suse 9.1 Personal] ofvergara Suse/Novell 4 11-29-2006 12:09 PM
Why is my USB Keyboard LEDs are not Glowing? pmrseshu Linux - Hardware 0 05-24-2005 01:15 AM


All times are GMT -5. The time now is 11:57 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration