Jump to content


LED message notifier checks twitter, pidgin, email


153 replies to this topic

#1 AlphaCentauri

    Senior Member

  • Members
  • 814 posts

Posted 05 June 2009 - 04:22 PM

Hi all,

I'm currently working on a project that does something useful with those cheap RGB LEDs I like so much. :)
Its a small circuit based on a picaxe 08m that is listening to signals on the serial port of a USB->serial adapter, a rather dumb device that switches output 1 high when a "1" is received, "2" switches output 2 high, "4" means outputs 1 and 2 are high etc. Basically it takes the last (or first? forgot) three bits of the incoming ascii sign and uses it to encode its outputs accordingly..
The software part is a bit more complex and consists of a bunch of python and zenity scripts that listens on the dBus system bus for message alerts issued by pidgin and thunderbird (the latter thanks to" dbus notifications" extensions for thunderbird).
The scripts also check my twitter account for new tweets every minute.

When a new message is received the magic begins: The LED lights up in the corresponding color (see below) and a system notification showing corresponding icon and either the full message (pidgin/twitter) or the message header (for email) is shown for a few seconds in the upper right screen area. Further a system tray icon appears (again showing the type of new message through icon type).
When I have seen the LED, read my mail/messages and have the feeling of being totally connected in and out :-) I can cllick on the tray icon and the LED goes off again.

The whole can be started by clicking on a small "parrot" icon, which causes a "parrot" tray icon to appear. Clicking this icon again closes the whole bunch of scripts (sadly also all other python scripts are closed then too, so this "exit" feature is not implemented very well if you have other python scripts running too)

Anyway I'm lucky since I can see my email inbox from several meters away with eepc lid closed. ha. ;)

Of course I would welcome it if any experienced python wizard would have the pity to write a small GUI using gtk2 or something for this. Thus I've opened a sourceforge account to enable several developers to work on this project at once. Note that this was my first try in python at all(!) so almost everyone with some experience will probably help alot here.
Devs are welcome!


Plans are to etch a very tiny PCB and fit this thingie into my eee1000h. I feel the message notifier makes more sense than this ambilight adventure I once started a while ago.. ;)


You can have a look at some pics and read more about the details on my blog, btw.
The sourcecode in form of a tarball can be accessed here: http://sourceforge.n...s/dbirdnotifier
(you can also extract inside your home dir, then navigate to the newly created subfolder "/LEDnotifier" and read HowTo.txt
for further instructions on how to make this run - some minor adjustments are probably necessary)

this is how it looks in action (new tweet was just received as I took this pic)
Posted Image
due to problems with BBcode "img" tag here is the same picture as url:
http://4.bp.blogspot...-h/IMG_2222.JPG

cheers

Edited by AlphaCentauri, 05 June 2009 - 09:50 PM.

eeePC 1000H Mods: stripped down again to: 3G HSDPA / R-SMA antenna connector / flashlight LED (back to basics!)
O/S: removed all in favor of Windows 7 Ultimate (RTM + language pack)
check out my Blog!

#2 m.klinge

    Senior Member

  • Members
  • 185 posts

Posted 05 June 2009 - 04:36 PM

I love the idea :)

If you would be able to fit it nicely inside the screen bezel it would be cool :)

Perhaps even two - one on each side - so that you can see it when the computer is on but the lid is closed :)

//M

#3 gtisingh

    EEEmazing User

  • Members
  • 5,766 posts
  • LocationUK

Posted 05 June 2009 - 05:21 PM

Wow ... this sounds clever !
Will we be able to change what we want to be notified about ?
e.g. Just Twitter and Hotmail
Just Twitter
-(2G Surf-450mb Nlited XP Pro SP2-571mhz-512mb RAM-7'' Touchscreen)-|
|Mods : Internal Hub\Touchscreen\4GB Class6 Flash Drive\Bluetooth|
-Gti- Cheap LED's with FREE Resistors - £2.49
-Singh-

#4 RandyLude92

    EEEmazing User

  • Members
  • 5,107 posts

Posted 05 June 2009 - 05:34 PM

what's up with the three AA batteries?

shouldn't the USB port have enough juice to power the RS-232 adapter and the LED?
maybe just split the power lead from the cable you're using and bypass the RS-232 with one?

looks really neat though. good work :)
"modding is for fun and learning, i've learned to have lots of fun"
Parts for sale!

#5 AlphaCentauri

    Senior Member

  • Members
  • 814 posts

Posted 05 June 2009 - 06:51 PM

Quote

so that you can see it when the computer is on but the lid is closed
exactly thats the intention - being able to see new mails arrive even with lid closed. I'd go for something positioned at the edge. Or maybe I'll use my bottom LEDs for this (they reflect the light indirectly, so the eee 'almost' glows from below..) Basically you can place the LED wherever you'd like it to be..
The LED itself will fit into the screen area definitely. The LED controller and RS232/USB adapter not sure. I would place them inside, below the MoBo, and have some thin stranded wire connect to the LED, that's doable.

Quote

Will we be able to change what we want to be notified about ?
Sure. Only twitter cannot be turned off without changing the code, its part of the script, the basic application so to speak. Instant messaging via Pidgin and email/RSS feeds are checked not by the script itself but by pidgin or thunderbird, respectively.
So yes, if you don't start thunderbird you won't be notified about email and if you don't have pidgin running you get no updates on ICQ- or other instant messages.

OTOH if you don't have a twitter account the script polls the public timeline (all twitter posts from everyone registered with their service, worlwide!) and displays that. You can be SURE you'll get "new tweet" notifications every minute then! In other words, twitter cannot be turned off. You can register with twitter and leave your homepage there blank if you don't like to be informed about twitter.(?)

For different email accounts, you can configure thunderbird to forward only certain account's incoming/new mail to your local inbox, same goes for RSS feeds. If you're behind a restrictive proxy with only http://port80 enabled you could also have thunderbird read an atom feed of your gmail account's inbox every few minutes and forward that to your local inbox. This way your local inbox will only receive the new mails you get (and your RSS feed updates maybe). If you change the filter/forwarding settings you can adjust which account's email to notify about...

pff that was longg-winded. sorry

For pidgin, you can edit the script and insert your own buddie's ICQ/AIM numbers (and maybe a certain "from:" domain if you desire) and then your buddies will be shown as green notification light and the domain member's messages will cause a red(or blue?) light notifiication.

Lastly, you can configure it to check different twitter timelines on a regular basis (if you like to do that).

Hope I could clear at least some unclearliness.

Edited by AlphaCentauri, 05 June 2009 - 09:36 PM.

eeePC 1000H Mods: stripped down again to: 3G HSDPA / R-SMA antenna connector / flashlight LED (back to basics!)
O/S: removed all in favor of Windows 7 Ultimate (RTM + language pack)
check out my Blog!

#6 AlphaCentauri

    Senior Member

  • Members
  • 814 posts

Posted 05 June 2009 - 06:53 PM

RandyLude92: yes in the meantime I've hardwired the thing and the batteries are gone. Also added a much nicer light diffusor made from sand-brushed glass (salvaged from an old 12V halogen desk lamp). Picture to follow ASAI have rechaged my camera's battery...
eeePC 1000H Mods: stripped down again to: 3G HSDPA / R-SMA antenna connector / flashlight LED (back to basics!)
O/S: removed all in favor of Windows 7 Ultimate (RTM + language pack)
check out my Blog!

#7 AlphaCentauri

    Senior Member

  • Members
  • 814 posts

Posted 05 June 2009 - 07:58 PM

http://yfrog.com/b8img2225oj
The new external version with milky glass light diffuser, today's fashion color: green! :D

http://yfrog.com/20img2232j
closeup (hardware part IS simple as you can see here)

http://yfrog.com/0dimg2234xj
doesn't it look nice when a message arrives?
eeePC 1000H Mods: stripped down again to: 3G HSDPA / R-SMA antenna connector / flashlight LED (back to basics!)
O/S: removed all in favor of Windows 7 Ultimate (RTM + language pack)
check out my Blog!

#8 AlphaCentauri

    Senior Member

  • Members
  • 814 posts

Posted 05 June 2009 - 07:59 PM

Hey! What am I doin wrong? (img)url.of.picture(/img)
eeePC 1000H Mods: stripped down again to: 3G HSDPA / R-SMA antenna connector / flashlight LED (back to basics!)
O/S: removed all in favor of Windows 7 Ultimate (RTM + language pack)
check out my Blog!

#9 Engineer

    ExtrEmE User

  • Moderators
  • 1,193 posts
  • LocationGermany

Posted 05 June 2009 - 08:27 PM

AlphaCentauri, you could do without the USB_Serial converter and connect an
IO expander to the SMBus on the eeePCs mainboard.

That has enough pins for your LEDs, and the software already exists, see:
http://forum.eeeuser...pic.php?id=3735
The three most dangerous things in the world are a programmer with a soldering iron,
a hardware type with a program patch and a user with an idea --computer saying / R. Cook

#10 RandyLude92

    EEEmazing User

  • Members
  • 5,107 posts

Posted 05 June 2009 - 08:41 PM

not to speak out of turn or put words in the OPs mouth but i would think doing it via USB makes it more of a universal tool that would portable/applicable from one system to another with the supporting apps in tow. and this way it doesn't require "hard" modding.
"modding is for fun and learning, i've learned to have lots of fun"
Parts for sale!

#11 RandyLude92

    EEEmazing User

  • Members
  • 5,107 posts

Posted 05 June 2009 - 09:00 PM

Quote

Hey! What am I doin wrong? (img)url.of.picture(/img)
it seems that the hosting service you've chosen doesn't like external linking unless it's with one of the "endorsed" forms they give you in the "share" option.

i played around with it a bit and got this:
Posted Image
"modding is for fun and learning, i've learned to have lots of fun"
Parts for sale!

#12 AlphaCentauri

    Senior Member

  • Members
  • 814 posts

Posted 05 June 2009 - 09:22 PM

Hm, i'd love to tap into my eee's SMBus but since Asus doesn't like to see me overclocking things like mad, this dang smb lus is "hidden" on my system. Whatever this means actually, at least all software that relies on tweaking i2c or smbus parameters has so far failed on my eee.

And RandyLude is right USB is just so versatile, and makes it a *real* device not just an add-on hack to an existing electronic machinery. Well, erhm -sorta at least.

ok it is an add-on hack.

@RandyL92 could you maybe do that with the other two pictures too, pleeeese? ;)

Edited by AlphaCentauri, 05 June 2009 - 09:23 PM.

eeePC 1000H Mods: stripped down again to: 3G HSDPA / R-SMA antenna connector / flashlight LED (back to basics!)
O/S: removed all in favor of Windows 7 Ultimate (RTM + language pack)
check out my Blog!

#13 RandyLude92

    EEEmazing User

  • Members
  • 5,107 posts

Posted 05 June 2009 - 09:31 PM

:lol: sure... give me a sec and i'll track em' down.
"modding is for fun and learning, i've learned to have lots of fun"
Parts for sale!

#14 RandyLude92

    EEEmazing User

  • Members
  • 5,107 posts

Posted 05 June 2009 - 09:33 PM

Posted Image
Posted Image
"modding is for fun and learning, i've learned to have lots of fun"
Parts for sale!

#15 AlphaCentauri

    Senior Member

  • Members
  • 814 posts

Posted 05 June 2009 - 09:39 PM

Big Thx!
eeePC 1000H Mods: stripped down again to: 3G HSDPA / R-SMA antenna connector / flashlight LED (back to basics!)
O/S: removed all in favor of Windows 7 Ultimate (RTM + language pack)
check out my Blog!

#16 m.klinge

    Senior Member

  • Members
  • 185 posts

Posted 05 June 2009 - 09:40 PM

Quote

Quote

so that you can see it when the computer is on but the lid is closed
exactly thats the intention - being able to see new mails arrive even with lid closed. I'd go for something positioned at the edge. Or maybe I'll use my bottom LEDs for this (they reflect the light indirectly, so the eee 'almost' glows from below..) Basically you can place the LED wherever you'd like it to be..
The LED itself will fit into the screen area definitely. The LED controller and RS232/USB adapter not sure. I would place them inside, below the MoBo, and have some thin stranded wire connect to the LED, that's doable.
Well keep us posted :)

I like the pictures - though i think its kinda too flashe for my taste with all the white going on :D

//M

#17 Engineer

    ExtrEmE User

  • Moderators
  • 1,193 posts
  • LocationGermany

Posted 05 June 2009 - 09:52 PM

Quote

Hm, i'd love to tap into my eee's SMBus but since Asus doesn't like to see me overclocking things like mad, this dang smb lus is "hidden" on my system. Whatever this means actually, at least all software that relies on tweaking i2c or smbus parameters has so far failed on my eee.

And RandyLude is right USB is just so versatile, and makes it a *real* device not just an add-on hack to an existing electronic machinery. Well, erhm -sorta at least.

ok it is an add-on hack.
Of course, with USB connection, you can connect it anywhere. But the SMBus variant could be fitted inside the EEE.

Tristand got access to the SMBus using the original Xandros OS:

Quote

. . .
I compiled the PCF8574 module from the ASUS source tree and installed it. I needed these modules:

modprobe i2c-dev
modprobe i2c_i801
modprobe pcf8574
Now, to control the LED I wrote this script:

/usr/bin/kblighttoggle:

#!/bin/sh
LIGHTSTATE=`cat /sys/bus/i2c/drivers/pcf8574/0-0027/read`

if [ $LIGHTSTATE = "255" ]; then
echo 239 > /sys/bus/i2c/drivers/pcf8574/0-0027/write
else
echo 255 > /sys/bus/i2c/drivers/pcf8574/0-0027/write
fi
Each time it is run it toggles the state of the LED.

I have bound it the the key combination Ctrl-Alt-L by adding this to my ~/.icewm/keys file:

key "Alt+Ctrl+l"                sudo kblighttoggle
So now when I hit ctrl-alt-L the light comes on or goes off.

Done!

The three most dangerous things in the world are a programmer with a soldering iron,
a hardware type with a program patch and a user with an idea --computer saying / R. Cook

#18 RandyLude92

    EEEmazing User

  • Members
  • 5,107 posts

Posted 05 June 2009 - 09:53 PM

Quote

Big Thx!
when you view the pic after you upload it just click the "full size" link and copy the URL from the address bar.
that should do the trick from now on ;)
"modding is for fun and learning, i've learned to have lots of fun"
Parts for sale!

#19 AlphaCentauri

    Senior Member

  • Members
  • 814 posts

Posted 05 June 2009 - 09:56 PM

Quote

I like the pictures - though i think its kinda too flashe for my taste with all the white going on big_smile
thats just the camera. In real life you can easily look directly at it no prob. With the first prototype shown in my 1st post above, this was different, now with the milky glass its ok. (I also stuffed some opaque plastic foil into the milky glass tube, around the LED. Gives nice effect and makes for evener(?) light distribution)

With bare LED it was really bad!
eeePC 1000H Mods: stripped down again to: 3G HSDPA / R-SMA antenna connector / flashlight LED (back to basics!)
O/S: removed all in favor of Windows 7 Ultimate (RTM + language pack)
check out my Blog!

#20 AlphaCentauri

    Senior Member

  • Members
  • 814 posts

Posted 05 June 2009 - 10:04 PM

module i2c_801 cannot be loaded at boot time on my eeepc. Its something encountered with only part of all eeepc1000H AFAIK. I've been unlucky and got such a model. I must admit that the 1line instruction for sending via i2c is shorter than the three lines I need for sending via serial. But with python three lines more or less don't improve your situation.. ;)

Still, nice code. Thanks, I'll keep it in memory (or bookmarked?) and might well use it for smth else someday!

@RandyLude: Again big thankx!! In the meantime I figured I could copy the "url for forums(1)" and then remove the ".th." part from the filename manually. :)


Doesn't anyone want to write some nice gtk2.0 additions for the script, by any chance? ;)
eeePC 1000H Mods: stripped down again to: 3G HSDPA / R-SMA antenna connector / flashlight LED (back to basics!)
O/S: removed all in favor of Windows 7 Ultimate (RTM + language pack)
check out my Blog!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users