Once again, random browsing on Taobao brought the need for me to shop for random crap^Hstuff.
This time, I bought a USB eBuddy (for a grand total of 60RMB including shipping)
The eBuddy is a small MSN / QQ physical avatar that performs certain actions based on its software – e.g. flashing lights, moving its wings, shaking left or right etc.
It looks like a little white angel with MSN color wings.
For a cheap toy, its actually quite cool. Cute too, but cool also.
Out of the box, its aimed squarely at Windows users. As I don’t actually run the devil’s OS, I hooked it up to a Debian box instead.
I was hoping for a little bit of fun integrating it with things, but that was not to be.
There is already a perfectly fine library written in Python that works beautifully to make it dance and sing* here
*Dancing and singing void where prohibited.
The python library is already set to run as a daemon on port 8888, and sits waiting for action out of the box.
The settings below snarfed from the code give an idea of what actions can be given:
Commands:
# GLADNESS = 00 # FEAR = 01 # FIZZ = 02 # PLEASANTSURPRISE =03 # GRIEF = 04 # FURY = 05 # QUELL = 06 # REDHEAD = 07 # GREENHEAD = 08 # BLUEHEAD = 09 # YELLOWHEAD = 10 # BLAME = 11 # BLUEGREENHEAD = 12 # WHITEHEAD = 13 # HEART = 14 # WINGS = 15 # BODY = 16 # NOEFFECT = 17 # ONLINE = 18 # BUSY = 19 # DAZE = 20 # BACKSOON = 21 # AWAY = 22 # PHONE = 23 # LUNCH = 24 # OFFLINE = 25
Mostly they consist of flashing various LED’s within the eBuddy on/off and optionally moving the wings or shaking the eBuddy left right.
Simple, but effective.
I use Zoneminder in the office on my Debian based ZFS NAS (HP Proliant Microserver), so thought one fun way would be to integrate the eBuddy to Zoneminder. This also proved to be too easy sadly.
Zoneminder has a wiki entry which gives 99% of whats needed here
I literally had to write 1 line of code to integrate the eBuddy with Zoneminder.
#!/usr/bin/perl -w use strict; use ZoneMinder; $| = 1; zmDbgInit( "myscript", level=>0, to_log=>0, to_syslog=>0, to_term=>1 ); my $dbh = DBI->connect( "DBI:mysql:database=".ZM_DB_NAME.";host=".ZM_DB_HOST, ZM_DB_USER, ZM_DB_PASS ); my $sql = "select M.*, max(E.Id) as LastEventId from Monitors as M left join Events as E on M.Id = E.MonitorId where M.Function != 'None' group by (M.Id)"; my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); my $res = $sth->execute() or die( "Can't execute '$sql': ".$sth->errstr() ); my @monitors; while ( my $monitor = $sth->fetchrow_hashref() ) { push( @monitors, $monitor ); } while( 1 ) { foreach my $monitor ( @monitors ) { next if ( !zmMemVerify( $monitor ) ); if ( my $last_event_id = zmHasAlarmed( $monitor, $monitor->{LastEventId} ) ) { $monitor->{LastEventId} = $last_event_id; print( "Monitor ".$monitor->{Name}." has alarmed\n" ); #The Single Line of Code - it sends a flash green signal to the Python Daemon system ("echo 8 | nc -q0 -u localhost 8888"); # # Do your stuff here # } } sleep( 1 ); }
I think I’ll be getting a couple more of these, as the integration is easy.
Next up, server load monitoring – I can have a couple of these on the top of my desk for each server, and hopefully address each one separately for load purposes – e.g. flash yellow, red on load average, and shake if queue’s are large.
Gimmicky, but useful.
Here are a couple of shots of the current incumbent in situ –
…and one of it actually working.
(It flashes green if someone comes up the stairs and zone minder triggers.)
I’m quite happy I spent the 60rmb, although I would have enjoyed more hacking. I literally spent 5 minutes getting things running.
Thats not a bad thing, but I was hoping for something a little deeper!
Going to order a few more now.
I got mine here – http://item.taobao.com/item.htm?id=1799393549
Recommended.
Archives
- November 2024
- November 2019
- October 2019
- August 2019
- April 2019
- February 2017
- September 2016
- June 2016
- May 2016
- September 2015
- August 2015
- June 2015
- April 2015
- December 2014
- October 2014
- September 2014
- July 2014
- June 2014
- April 2014
- October 2013
- July 2013
- May 2013
- April 2013
- March 2013
- January 2013
- December 2012
- October 2012
- August 2012
- July 2012
- June 2012
- May 2012
- April 2012
- March 2012
- December 2011
- November 2011
- October 2011
- September 2011
- July 2011
- May 2011
- April 2011
- March 2011
- February 2011
- January 2011
- December 2010
- November 2010
- October 2010
- September 2010
- August 2010
- July 2010
- June 2010
- May 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
Categories
- Apple
- Arcade Machines
- Badges
- BMW
- China Related
- Cool Hunting
- Exploits
- Firmware
- Food
- General Talk
- government
- IP Cam
- iPhone
- Lasers
- legislation
- MODx
- MySQL
- notice
- qmail
- requirements
- Reviews
- Service Issues
- Tao Bao
- Technical Mumbo Jumbo
- Things that will get me censored
- Travel
- Uncategorized
- Useful Info