Andrew de Quincey's livejournal

Previous Entry Share Next Entry
Joggler/openpeak backlight and light sensor code
OKdoke, some more joggler code ready. If you look here, you'll find:

  • A patch to add the joggler's backlight control to the proper kernel backlight framework
  • A userspace program to read the light sensor value over the i2c bus.
  • Oh, the sound patch is on v2 now 'cos I'd accidentally left some cruft in.

  • 1
err, what distro are you currently on?

I'm using arch linux right now. But people have Mer running on it..

Hi adq,

do you have a working kernel config for that kernel version, you applied the patches to?
I'd like to give it a try...

thank you!

Sure, just uploaded it to

Its just the default arch linux 2.6.33 config with the necessary joggler bits changed; my 2.6.32 patches applied to 2.6.33 fine.

i2c bus

I have played with various Linux routers and use the i2c bus in them to control my greenhouse etc.

Do you know where the bus lines are in the Joggler - I guess they will be 1.8 volt logic (?)

And while we are talking GPIO - do you know if there is a rs232 available?

rs232 isn't on there.

However, the i2c bus will be present on the connector on the board which is marked "XDB", which is an Intel standard-ish - it has i2c and JTAG and a few other things on the same port.

I don't know which lines they are though; I'd use a multimeter in "beep mode" to test which are connected to a known i2c device.

Re: i2c bus

I wonder if you mean XDP not XDB? I have searched for lines from the C8051F311 chip to the J1 socket (your XDB?) but can't sort it yet.

Wish I could find a plug for it and bring the wires out.

Hmm, could very well be; unfortunately I don't have one open just now so I can't confirm.

backlight as userland add on?

Could the backlight control be added as c program to a running Ubuntu Joggler?

I have run the light detector in my Ubuntu Joggler and it runs OK - I need the same for the back light

Re: backlight as userland add on?

I can see where you're coming from, but you unfortunately will need to patch the kernel with the backlight driver.

The light sensor is on the i2c bus which is easily accessible from userspace as you can see.

Unfortunately the backlight is a memory mapped address on the video card's PCI space, and so needs a kernel driver to provide support.

However, once you have a kernel with that patch in it running, you can control it from userspace by writing numbers from 0->32 into the /sys/class/backlight/openframe-bl/brightness file.

Crackle on external audio

using ubuntu kernel 2.6.31-20 and alsa 1.0.20 there is speaker crackle when using the external audio jack. Can you give me point me roughly in the right direction as to where that problem lies. I've tried compiling against a more recent alsa but that makes no difference so I'm wondering if its possible there is something missing in your kernel patch?

The joggler itself was built against alsa 1.0.15 not sure what relevance that has.

(I'm disca on forums).

touch screen

I wonder if you could point me to any info on how to write scripts/C code to determine when and where the touch screen has been pressed?

Thanks for the i2c and back-light info - I have got control from a web page working.

Will put up some notes soon at

(Newish Linux user)

Re: touch screen

I think the touchscreen just appears as a normal linux "input device framework" mouse - the devices for those are in /dev/input. If you 'cat /dev/input/mice' and touch the touchscreen you get stuff back. If you're just looking for a "has someone touched the touchscreen" to unblank the screen that might do!"

There must be a standard library or something for reading from those as well.

i2c c code

Many thanks for readlightsensor.c

I am trying to compile c code to read and write to i2c devices such as PCF8574.

My code works on Sweex (Openwrt), Slug NSLU2 (Debian) and Bifferboard (Debian) which is also i386.

But not on the Joggler! It compiles and runs but will not give a valid read on the PCF8574 nor will it switch the LEDs on the 8 GPIO of my PCF8574.

Could you perhaps see what is wrong? I want to do similar things with my PIC as i2c slave that also worked on my other boxes.

I use the code here on my site -

i2cset and i2cget work fine on my Joggler i2c bus extension

I will publish when it works!

I am "lesson 2" in c . . . .

i2c c code

(Seems my first attempt did not get through - sorry if this is a repeat.)

My connection to the Joggler i2c bus is recorded here -

I can use i2cset etc with my external i2c devices but the c code that I used for NSLU2/Slug, Bifferboard and Sweex router will not run on the Joggler. It compiles and seems to run but the 'scope shows no activity on the bus.

Since I believe you wrote readlightsensor.c I would very much appreciate your opinion of what is different in the Joggler!

It is published for NSLU2/Slug Debian here -

Hi, sorry its taken me a while to get back to you; did you have any success in the meantime?

  • 1

Log in