New Ruby BetaBrite - 0.0.2

I just released a new version of the ruby BetaBrite sign library. It lets you control BetaBrite signs. You can write text, change the color, fonts, display images, and do a bunch of other stuff.

In celebration of this new release, I created a DRb server that lets you write to my BetaBrite sign and take a photo of it! Here is the code that will write "Seattle.rb" to my server and take a photo:

require 'drb'
require 'rubygems'
require 'betabrite'

DRb.start_service()
obj = DRbObject.new(nil, 'druby://eviladmins.org:9000')

File.open("out.jpg", 'wb') { |a|
  a.write obj.write_simple("Seattle.rb")
}

Which took this photo:


How about writing a red string?

require 'drb'
require 'rubygems'
require 'betabrite'

DRb.start_service()
obj = DRbObject.new(nil, 'druby://eviladmins.org:9000')

s = BetaBrite::String.new("Seattle.rb") { |a| a.set_color "red" }

File.open("out.jpg", 'wb') { |a|
  a.write obj.write(s)
}

Install it and try it out!

Posted by Aaron PattersonPermalinkLeave your Comment »

30 Comments for “New Ruby BetaBrite - 0.0.2”

  1. deejay says:

    Amazing example of ‘ruby as glue’. Thanks for sharing! This means I can use your BetaBrite as visual feedback on the Red/Green status of program builds :-)}
    deejay - Leicester, UK

    Thursday, 28 September 2006 @ 11:33pm

  2. Dennis Wilson says:

    Nice job! But to me it’s more impressive how you handle the connection to the cam. :)

    Friday, 29 September 2006 @ 3:02am

  3. J`ey says:

    I want one! Please point to a page where you can purhcase one!

    Friday, 29 September 2006 @ 8:11am

  4. Aaron Patterson says:

    I bought the sign from Sam’s club. You can get one too here.

    Friday, 29 September 2006 @ 8:23am

  5. pshjackie says:

    for some reason it won’t let me write this and take a photo

    xxXHoTaSiAnTeensXxx

    what’s the deal?

    Friday, 29 September 2006 @ 3:48pm

  6. Dan Peterson says:

    Thanks for this library! I used it a while back to play with my BetaBrite. Also, I like the reflection effect you hacked in. Where can I get the code for that? :P

    Friday, 29 September 2006 @ 4:14pm

  7. Aaron Patterson says:

    If you want reflection, just check out my “hardwood floor” hack. ;-)

    Friday, 29 September 2006 @ 4:23pm

  8. Masao says:

    Wow, great!

    Friday, 29 September 2006 @ 7:04pm

  9. piyo says:

    Thanks for the hackery. “piyokun” Now I gotta try it when there’s light. What’s your timezone?

    Friday, 29 September 2006 @ 8:06pm

  10. Kevin Marsh says:

    How about a BetaBrite Prism? Color!

    Friday, 29 September 2006 @ 10:17pm

  11. Dr Nic says:

    http://www.flickr.com/photos/drnic/256171377/

    Flickr tag: betabrite

    Great work :)

    Saturday, 30 September 2006 @ 12:54am

  12. Masatoshi SEKI says:

    Cool server!
    In 1st sample, It works with only ‘drb’ because the betabrite is in the server side.

    require ‘drb’

    obj = DRbObject.newwithuri(”druby://eviladmins.org:9000″)

    File.open(”out.jpg”, “wb”) { |a|
    a.write obj.write_simple(”www.druby.org”)
    }

    Saturday, 30 September 2006 @ 1:45am

  13. I like Ruby too. says:

    BetaBriteサーバ…

    よたらぼ経由、LEDパネルを操作するRubyのライブラリのサンプル的サーバを知りました。LEDパネルに文字を表示させてその様子をWebCamで画像として受け取れるものなんだけど、dRubyでサー…

    Saturday, 30 September 2006 @ 2:02am

  14. oystein says:

    Great stuff! How you handle the connection to the cam?

    Saturday, 30 September 2006 @ 2:23am

  15. Aaron Patterson says:

    I fork another process (vidcat) that reads the image from the webcam.

    def take_photo
      synchronize do
        IO.popen(‘/usr/bin/vidcat’, ‘rb’) { |f| f.read }
      end
    end

    Saturday, 30 September 2006 @ 10:28am

  16. Controlling BetaBrite LED Signs via Ruby « RubyHam says:

    [...] 1) Look here: http://tenderlovemaking.com/2006/09/28/new-ruby-betabrite-002/ [...]

    Sunday, 1 October 2006 @ 11:45am

  17. Betabrite : la puissance de Ruby at think’blog says:

    [...] Je qualifierais ça d’un “truc de ouf”. Voilà Betabrite, une library ruby, qui vous permait d’afficher divers mots sur un panneau lumineux ! [...]

    Monday, 2 October 2006 @ 6:21am

  18. The Zed says:

    Great ! It must be really fun to stare at it all day, watching the messages coming up ! Keep it up as long as possible and share the stats ! Do you actually keep the JPEGs ? You should ! And then make collage of something fun with them…. :)

    Tuesday, 3 October 2006 @ 1:02pm

  19. Jax says:

    Um, okay, people are commenting in DIFFERENT LANGUAGES, DUDE! Soon you’ll be dating Paris Hilton and then I’ll NEVER see you again.

    Wednesday, 8 November 2006 @ 9:17am

  20. rcorsaro says:

    Ahh! BetaBrite is not a permenant service?!!

    Wednesday, 29 November 2006 @ 6:51pm

  21. Jason says:

    Hi Aaron:

    I’m working on a project whereby incoming e-mail will be filtered and sent to an LED sign like this one. Can you tell me what model of BetaBrite you used? I see that the Ruby code uses a serial port so I assume it’s the older model — the new Prism model uses USB. Have you tried this library with any other model?

    Thanks,
    Jason

    Friday, 4 May 2007 @ 10:25am

  22. Aaron Patterson says:

    Hi Jason,

    It is an older model. I haven’t tried it with the new BetaBrite model because I haven’t had the money to buy one…. From what I can tell, the new one just sets up a USB serial interface, so all of my code should work with it, but I haven’t tried. I’m hoping to get a newer BetaBrite to try out before the next Ruby conference.

    Monday, 7 May 2007 @ 1:46am

  23. Tami Takamiya says:

    Aaron,

    I recently got to know there was a ruby library to manipulate Betabrite. It is really great! Thank you for your efforts on this.

    May I ask a question on the library? While I could display text files pretty easily with the help of your library, but could not find a way to display dots files… If you have simple samples to use dots files, could you make them available? Thank you.

    Tami Takamiya

    Thursday, 13 September 2007 @ 9:00pm

  24. Aaron Patterson says:

    Hey Tami. If you look under the script directory of the gem, you should find some sample scripts. One of them called “dots_file.rb” is an example of writing dots files to the sign.

    Friday, 14 September 2007 @ 8:30am

  25. Jason Weill Web Productions » Blog Archive » How I Built an LED Confession Board says:

    [...] LED signs for a hundred dollars or less. I specifically looked for BetaBrite after reading about a Ruby module specifically to talk to BetaBrite signs. A complete BetaBrite sign with all the needed accessories cost about $120 shipped. The sign [...]

    Sunday, 23 September 2007 @ 6:19pm

  26. Semone says:

    Aaron, I have one of the “New” Beta Brites and I am trying to send messages to the sign. I am programmer that uses Delphi, I am having trouble sending messages. The BetaBrite now has a dll that you use to access the sign with the USB. Do you have a newer betabrite as yet? If so, maybe you can help me tackle this sign.

    Wednesday, 2 January 2008 @ 11:58am

  27. Aaron Patterson says:

    I have one of the new usb beta brites too. Unfortunately I don’t have windows, and Adaptive won’t open the spec so I can get a USB driver on linux or os x.

    Wednesday, 2 January 2008 @ 2:42pm

  28. Hammer says:

    I’ve had some success getting the new USB sign working with Ruby on a Mac via libusb/ruby-usb. The Betabrite message protocol is the same, as far as I can tell, and I’m able to set Files on the device. However, when I send new messages, the device just goes blank. I can use the remote control to run the File, so I know it’s taking the changes that I’m sending over USB. I feel like I’m overlooking some sort of run command, but I didn’t see one in your Ruby library, nor in the protocol guide (http://www.ams-i.com/Pages/97088061.htm). It does seem reasonable to me that there would be a run file command though, since the operations are just updating files in the device’s memory. Did you encounter anything like this when working with the serial version?

    Friday, 8 February 2008 @ 11:15pm

  29. Aaron Patterson says:

    Hey! Can you send a link to the driver you used to get the USB betabrite working? I haven’t been able to get it working, and if I could get a driver for it, I could much better answer your questions. Or even update the library! :-D

    Saturday, 9 February 2008 @ 12:27am

  30. Hammer says:

    No driver, just libusb (http://libusb.wiki.sourceforge.net/) and ruby-usb (http://raa.ruby-lang.org/project/ruby-usb/). I had some trouble getting libusb to work, so I ended up grabbing a binary from http://www.ellert.se/twain-sane/. I used USB Prober (from an OS X Dev Kit) to identify the device so I could send messages to it. Once you get a handle to the device, it’s pretty much the same as talking to a non-USB serial device.

    Also, since my last post, I figured out what was wrong. I don’t yet know why, but the USB version chokes on ETX. I stopped sending that, and it started working.

    If you’d like a look at the code I’ve written to tie it all together, I’d be happy to email it to you.

    Saturday, 9 February 2008 @ 1:20am

Leave your Respond

Check Spelling
Activate Spell Check while Typing

RSS Feed for this EntryTrackBack URL