Git Product home page Git Product logo

blinky's Introduction

blinky

blinky helps you see the light

  • plug and play set up for build lights

  • get a build light up and running in a few minutes.

Why blinky?

Setting up a build light on a new project always seems to be more of a hassle than it should be. Somehow it always seems that no one else has ever dealt with the exact combination of OS, CI Server and build light that you have in your sweaty little hands, and you have to write something from scratch. Again.

blinky is an attempt to fix that.

blinky aims to supply plug and play support for all combinations of

  • USB Light Model (or any other USB Device used to indicate build status)

  • Operating System

  • CI Server

Heres blinky running three different lights at once:

How do I use blinky?

Plug in your USB light, and then do something like this

require 'rubygems'
require 'blinky'

light = Blinky.new.light 
light.watch_cctray_server http://your.ci.server/cctray.xml

Or, with basic authentication

light.watch_cctray_server http://your.ci.server/cctray.xml, {:user => 'user', :password => 'password'}

Or, you can just control the light directly

light.success!
light.failure!
light.building!
light.warning!
light.off!

What if I have more than one light?

Want to plug in more than one light on the same machine?

require 'rubygems'
require 'blinky'

blinky = Blinky.new
light_one = blinky.lights[0]
light_two = blinky.lights[1]

Not sure which light is which?

# make light_one flash
light_one.where_are_you?

What is currently supported?

Lights/ Build Indicators

Operating Systems

  • OSX

  • Linux

  • Windows

CI Servers

Any server that supports the cctray xml format, including among others:

How Do I install blinky?

OSX and Linux

Install lib-usb-1.0 with your favourite package manager, and then install the blinky gem

For example, on OSX:

brew install libusb
gem install blinky

on Debian or Ubuntu:

apt-get install libusb-1.0-0-dev
gem install blinky

and so on

Windows

Windows can be a bit fiddly. The following is how I got a Delcomm II light to work on a Windows 7 laptop. Further experience reports/better instructions would be gratefully received.

  • installed Zadig (github.com/pbatard/libwdi/wiki#wiki-Downloads)

  • plugged in the USB light

    • at this point windows ‘helpfully’ installed an incorrect ‘USB Input device’ driver

  • opened Zadig and selected ‘Options -> List All Devices’

  • Selected ‘USB Input Device’ in the Zadig drop-down

  • Clicked on ‘Replace Driver’ and confirmed in the popup dialog

  • installed the blinky gem

Test your installation

Plug in your light and then do this:

require 'rubygems'
require 'blinky'

blinky = Blinky.new
blinky.light.watch_test_server

Watch the pretty lights!

Troubleshooting

check out github.com/perryn/blinky/wiki/Troubleshooting

Blinky doesn’t quite do what I want

The watch_cctray_server method is a very simple approach, but its easy to do something more sophisticated by writing your own plugin - see “How do I contribute support for more ci servers?” below.

Or if you want to get really fancy, take a look at Chicanery and use it to control blinky any way you want.

How do I contribute support for more lights?

Take a look at the classes in lib/device_recipes then write your own!

How do I contribute support for more ci servers?

Take a look at the classes in lib/ci_server plugins then write your own! You will probably find Chicanery very useful when doing this.

Copyright © 2010 Perryn Fowler. See LICENSE for details.

blinky's People

Contributors

perryn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

blinky's Issues

Webmail Notifier knock-off

Hey there. I have a Webmail Notifier that I think might be a knock-off, and I was wondering if you could help me add support for it.

1.9.3-p362 :002 > blinky = Blinky.new
Blinky::NoSupportedDevicesFound: Blinky was unable to find a supported device 
The devices I did find were:
[#<LIBUSB::Device 250/1 05ac:8006 ? ? ? (Hi-speed Hub with single TT)>,
 #<LIBUSB::Device 253/1 05ac:8006 ? ? ? (Hi-speed Hub with single TT)>,
 #<LIBUSB::Device 253/2 0424:2513 ? ? ? (Hi-speed Hub with multiple TTs)>,
 #<LIBUSB::Device 250/2 0424:2513 ? ? ? (Hi-speed Hub with multiple TTs)>,
 #<LIBUSB::Device 250/3 05ac:850a ? ? ? (Interface Association Descriptor)>,
 #<LIBUSB::Device 253/3 05ac:8404 ? ? ? (MassStorage SCSI Bluk-Only)>,
 #<LIBUSB::Device 250/5 05ac:024c Apple Inc. Apple Internal Keyboard / Trackpad ? (HID (01,01), HID (00,00), HID (01,02))>,
 #<LIBUSB::Device 253/4 1294:1320 MAIL MAIL ? (HID (00,00))>]


    from /Users/pete/.rvm/gems/ruby-1.9.3-p362/gems/blinky-0.0.10/lib/blinky/light_factory.rb:14:in `detect_lights'

Had a bit of a poke about:

1.9.3-p362 :007 > mail = USB.devices[7]
 => #<LIBUSB::Device 253/4 1294:1320 MAIL MAIL ? (HID (00,00))> 
1.9.3-p362 :008 > mail.id
mail.idProduct  mail.idVendor 
1.9.3-p362 :008 > mail.idVendor
 => 4756 
1.9.3-p362 :009 > mail.idProduct
 => 4896 

The idVendor and idProduct don't match inside recipes.rb:

recipe DreamCheeky::WebmailNotifier,  {:usb_vendor_id => 0x1d34, 
                                       :usb_product_id => 0x0004, 
                                       :description => "Dream Cheeky Webmail Notifier"}

I don't have any idea how to do this, but I'm willing to invest time to find out how. If you could give me a couple of tips, it would be much appreciated.

Failed to run blinky under Ubuntu 12.04

$ sudo ruby1.9.3 test.rb
/var/lib/gems/1.9.1/gems/libusb-0.2.2/lib/libusb/constants.rb:46:in `raise_error': LIBUSB::ERROR_IO in libusb_submit_transfer (LIBUSB::ERROR_IO)
    from /var/lib/gems/1.9.1/gems/libusb-0.2.2/lib/libusb/transfer.rb:135:in `submit!'
    from /var/lib/gems/1.9.1/gems/libusb-0.2.2/lib/libusb/transfer.rb:162:in `submit_and_wait!'
    from /var/lib/gems/1.9.1/gems/libusb-0.2.2/lib/libusb/dev_handle.rb:390:in `control_transfer'
    from /var/lib/gems/1.9.1/gems/libusb-0.2.2/lib/libusb/compat.rb:316:in `usb_control_msg'
    from /var/lib/gems/1.9.1/gems/blinky-0.0.12/lib/device_recipes/delcom_engineering/visual_indicator_gen_two.rb:35:in `set_colour'
    from /var/lib/gems/1.9.1/gems/blinky-0.0.12/lib/device_recipes/delcom_engineering/visual_indicator_gen_two.rb:27:in `off!'
    from /var/lib/gems/1.9.1/gems/blinky-0.0.12/lib/device_recipes/delcom_engineering/visual_indicator_gen_two.rb:22:in `warning!'
    from test.rb:5:in `<main>'
[  256.978955] usb 2-1.2: usbfs: process 3627 (ruby1.9.3) did not claim interface 0 before use
$ gem list

*** LOCAL GEMS ***

blinky (0.0.12)
chicanery (0.1.5)
ffi (1.9.3)
libusb (0.2.2)
mini_portile (0.5.3)
nokogiri (1.6.1)
$ dpkg -s libusb-1.0-0-dev
Package: libusb-1.0-0-dev
Status: install ok installed
Priority: optional
Section: libdevel
Installed-Size: 898
Maintainer: Ubuntu Developers <[email protected]>
Architecture: amd64
Source: libusb-1.0
Version: 2:1.0.9~rc3-2ubuntu1
Depends: libusb-1.0-0 (= 2:1.0.9~rc3-2ubuntu1), libc6-dev | libc-dev
Description: userspace USB programming library development files
 Library for programming USB applications without the knowledge
 of Linux kernel internals.
Homepage: http://www.linux-usb.org/
Original-Maintainer: Aurelien Jarno <[email protected]>

Not sure what's the cause

Blinkt! only supported on Linux

I'm working on a PR to add Blinkt! support to blinky, but it turns out the blinkt Gem has dependencies that are Linux-only (and very Linux-only, relying on kernel functionality not present in other OSs).

Assuming non-Linux OSs are important targets for blinky (e.g. mention of Windows in the docs), I wonder how to proceed here.

There's an open issue on bundler about supporting OS-specific groups, but no progress as of yet.

I guess I could always maintain a Blinkt!-specific fork, but that feels a bit hacky.

Thoughts?

LIBUSB::ERROR_ACCESS in libusb_open

Hi Perryn,

I have done everything to make this work, but everytime I initialize Blinky, I always got this error message. Can you help me with this?

arvin@arvin-VirtualBox:~$ irb
r2.2.0 :001 > require 'blinky'
=> true
2.2.0 :002 > l = Blinky.new
LIBUSB::ERROR_ACCESS: LIBUSB::ERROR_ACCESS in libusb_open
from /home/arvin/.rvm/gems/ruby-2.2.0/gems/libusb-0.2.2/lib/libusb/constants.rb:46:in raise_error' from /home/arvin/.rvm/gems/ruby-2.2.0/gems/libusb-0.2.2/lib/libusb/device.rb:58:inopen'
from /home/arvin/.rvm/gems/ruby-2.2.0/gems/libusb-0.2.2/lib/libusb/compat.rb:175:in open' from /home/arvin/.rvm/gems/ruby-2.2.0/gems/blinky-0.0.12/lib/blinky/light_factory.rb:11:inblock in detect_lights'
from /home/arvin/.rvm/gems/ruby-2.2.0/gems/blinky-0.0.12/lib/blinky/light_factory.rb:7:in each' from /home/arvin/.rvm/gems/ruby-2.2.0/gems/blinky-0.0.12/lib/blinky/light_factory.rb:7:indetect_lights'
from /home/arvin/.rvm/gems/ruby-2.2.0/gems/blinky-0.0.12/lib/blinky.rb:26:in `initialize'

Unable to install on OS X 10.8.3

Very excited to use this!
I have the latest command-line tools and brew is updated. Libusb installs no problem.
When I 'sudo gem install blinky' on 10.8.3 it fails, please help.
Install ends with:
"Configuring libffi for i386
configure: WARNING: if you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used
configure: error: in /Library/Ruby/Gems/1.8/gems/ffi-1.8.1/ext/ffi_c/libffi-i386': configure: error: C compiler cannot create executables" Seeconfig.log' for more details
make[1]: *** No targets specified and no makefile found. Stop.

Installing Gem issue

I get this error on Ubuntu 13.11 when installing the Gem....

eddie@ubuntu13-10:~$ sudo gem install blinky
Building native extensions.  This could take a while...
ERROR:  Error installing blinky:
    ERROR: Failed to build gem native extension.

        /usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from extconf.rb:4:in `<main>'


Gem files will remain installed in /var/lib/gems/1.9.1/gems/ffi-1.9.3 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/ffi-1.9.3/ext/ffi_c/gem_make.out

Any ideas?

Port to Java

Hey @perryn I am currently working on porting this project to java, I am going to be basing myself a lot on the structure of this one so I just wanted to both give you a heads up and to confirm if you were ok with it.

I am also still not set on the name but one of my choices was jblinky, which also made me wonder if you had any issue with that as well.

Let me know any comments or concerns, thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.