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!

26 Comments

  1. deejay
    Posted September 28, 2006 at 11:33 pm | Permalink

    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

  2. Posted September 29, 2006 at 3:02 am | Permalink

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

  3. Posted September 29, 2006 at 8:11 am | Permalink

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

  4. Posted September 29, 2006 at 8:23 am | Permalink

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

  5. Posted September 29, 2006 at 3:48 pm | Permalink

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

    xxXHoTaSiAnTeensXxx

    what’s the deal?

  6. Posted September 29, 2006 at 4:14 pm | Permalink

    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

  7. Posted September 29, 2006 at 4:23 pm | Permalink

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

  8. Posted September 29, 2006 at 7:04 pm | Permalink

    Wow, great!

  9. piyo
    Posted September 29, 2006 at 8:06 pm | Permalink

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

  10. Posted September 29, 2006 at 10:17 pm | Permalink

    How about a BetaBrite Prism? Color!

  11. Posted September 30, 2006 at 12:54 am | Permalink

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

    Flickr tag: betabrite

    Great work :)

  12. Posted September 30, 2006 at 1:45 am | Permalink

    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”)
    }

  13. oystein
    Posted September 30, 2006 at 2:23 am | Permalink

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

  14. Posted September 30, 2006 at 10:28 am | Permalink

    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

  15. The Zed
    Posted October 3, 2006 at 1:02 pm | Permalink

    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…. :)

  16. Jax
    Posted November 8, 2006 at 9:17 am | Permalink

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

  17. rcorsaro
    Posted November 29, 2006 at 6:51 pm | Permalink

    Ahh! BetaBrite is not a permenant service?!!

  18. Jason
    Posted May 4, 2007 at 10:25 am | Permalink

    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

  19. Posted May 7, 2007 at 1:46 am | Permalink

    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.

  20. Posted September 13, 2007 at 9:00 pm | Permalink

    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

  21. Posted September 14, 2007 at 8:30 am | Permalink

    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.

  22. Semone
    Posted January 2, 2008 at 11:58 am | Permalink

    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.

  23. Posted January 2, 2008 at 2:42 pm | Permalink

    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.

  24. Hammer
    Posted February 8, 2008 at 11:15 pm | Permalink

    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?

  25. Posted February 9, 2008 at 12:27 am | Permalink

    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

  26. Hammer
    Posted February 9, 2008 at 1:20 am | Permalink

    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.

4 Trackbacks

  1. By I like Ruby too. on September 30, 2006 at 2:02 am

    BetaBriteサーバ…

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

  2. By Controlling BetaBrite LED Signs via Ruby « RubyHam on October 1, 2006 at 11:45 am

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

  3. By Betabrite : la puissance de Ruby at think’blog on October 2, 2006 at 6:21 am

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

  4. [...] 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 [...]

Post a Comment

Your email is never shared. Required fields are marked *

*
*
Check Spelling
Activate Spell Check while Typing