LED Problem

Post questions, comments and feedback to our 3Dconnexion UNIX and Linux Development Team.

Moderator: Moderators

Post Reply
joggl
Posts: 3
Joined: Fri Jun 13, 2008 5:56 am

LED Problem

Post by joggl »

I try to switch on the LED from the SpaceNavigator with sending following hex-string:

Code: Select all

0000 0000 0000 0000 1100 0800 0100 0000
switching off nearly the same:

Code: Select all

0000 0000 0000 0000 1100 0800 0000 0000
My problem is, that this string just puts on/off the LED "sometimes"
Could someone help or explain me how to switch on/off the LED by sending strings to the HID-Device (for example /dev/input/event3)
crobl
Moderator
Moderator
Posts: 138
Joined: Mon Feb 26, 2007 8:34 am
Location: Freiham, Germany

Post by crobl »

Hi joggl,

sorry I don't know how and what you're sending off to our device. Which ioctl() are you using?

From the device node you posted I think you want to use the event interface. A good starting point will be this website.
Example 4 shows you what event types are supported by the SpaceNavigator. The other examples will help you setting those events and dealing with the event interface.
Note: The LEDs may not show explicitly up in the list as LEDs but maybe as misc, unknown, etc. event types.

Regards,

Christian
3Dconnexion
Absum
Posts: 53
Joined: Tue Apr 24, 2007 4:00 am
Location: Sweden
Contact:

Post by Absum »

You aren't making it easy for yourself :P
crobl
Moderator
Moderator
Posts: 138
Joined: Mon Feb 26, 2007 8:34 am
Location: Freiham, Germany

Post by crobl »

Who do you mean? Me, him or us? :shock: :?: :D
joggl
Posts: 3
Joined: Fri Jun 13, 2008 5:56 am

Post by joggl »

[SOLVED]

Ok, i hope i solved the problem with crobels help.

It seems to be a kernel-driver-problem from linux. I tried to switch the LED on kernel 2.6.20 (ok i know, kinda old) with following code:

Code: Select all

struct input_event ev;

fd = open ("/dev/input/event3", O_WRONLY);

ev.code = EV_LED; // = 0x11
ev.code = LED_MISC; // = 0x08
ev.value = 1;// 1=an, 0=aus
write(fd, &ev, sizeof(struct input_event));

close(fd); 
and it did NOT (or sometimes, depends on weather, time, position of mars, ...) work.

after updating the kernel to 2.6.25 the same code works fine without the "random-effect"

therefore it seems to be something in the HID-drivers from older kernels.

greez
/joggl
Post Reply