Topic: Python and Ruby for Chumby!

Folks -

I've added Python and Ruby dongle images for the Chumby. These are based on the ports done for the Nokia 770, which uses a similar processor.  You can use the languages to program the chumby, and even create a custom dongle to boot your own software!

See the development tools wiki page.

I've also started a port for Squeak, but it's not complete.

Re: Python and Ruby for Chumby!

Very cool - thanks Duane!

As an aside - I imagine you guys have been following emTraces widgetstation - I just finally read that its widgets are written in Python. I'm so glad you went with Flash for the front end - as much as I like Python, I'd hate to have to create actual graphics/dynamic animation with it...

Rob

Re: Python and Ruby for Chumby!

bunnie took a brief look at it at CES.  Apparently they were quite grim when they (quickly) figured out who bunnie was.  Apparently the booth people had been told to look out for us smile  I guess our Open business model makes some folks nervous.

Python is an interesting choice - a system based on a more general scripting language was something we'd considered, along with all of the other (mutually incompatible) XML/Javascript/HTML file-splat schemes that most of the other widget systems use.

The problem with a generalized language, when one is pulling these untrusted binaries across the network, is security of the user's data.  If you care about that sort of thing (which we do), you really need a sandboxed environment, and at the moment, that pretty much comes down to Flash and Java.  Flash then becomes the natural choice if you want to make it easy to do interesting graphics, animation and audio, with all the assets in a single encapsulated file, and do it all in a small binary.

My limited understanding is that you have to explicitly install the widgets on the WidgetStation, which makes it more like how you'd manage a phone or computer's applications, than our system of a relatively stateless player pulling widgets on demand from a server.

The WidgetStation is an interesting product, and we'll be keeping our eye on it, and it's pretty clear they're doing the same.  We expect others to pop up over time.

Re: Python and Ruby for Chumby!

Ha - thats a great story. smile

Agree - security is one of the keys to success for he chumby. It will be interesting to see how things evolve in this area.

I feel, regardless of the front end technology used for the widgets themselves, that the centralized method of managin/pulling the widgets in from one location on a server that Chumby has implemented as opposed to emtraces model of discrete installation, is going to be much easier to approach, manage and update.

The fact that you can throw your own widgets into the mix so painlessly with the Chumby, and push out updates, etc. it just seems like such a no brainer. I think everyone has enough things to manage on a daily basis, and having to fiddle with individual installations of widgets through some other process is probably too much to demand of the average user.

Rob

Re: Python and Ruby for Chumby!

Yes, we've fixed bugs and enhanced the performance and features of several of the existing widgets, which were effectively deployed immediately.

We'll be adding a form of caching to the chumby to reduce the amount of network traffic, but we'll still be able to update widgets and have them take effect pretty quickly.

Re: Python and Ruby for Chumby!

I just got my Chumby, so sorry if this is obvious.  I'm a big fan of squeak.  Is the idea of this port that I would use squeak instead of Flash?  If so, does morphic work?

Re: Python and Ruby for Chumby!

Unfortunately, I haven't finished the Squeak port, but yes, you should be able to use Morphic.

What it needs is to be hooked up to the input devices (touchscreen, USB keyboard, etc) and an image built with the various elements positioned rationally for the small screen.

8

Re: Python and Ruby for Chumby!

Ruby on Chumby, very cool!

What else would need to be done to use Rails to develop a widget?

thanks,
jp

Re: Python and Ruby for Chumby!

Um, well, widgets are written in Flash, so Rails, which is a server-side web application framework, probably wouldn't be too helpful, at least on the chumby itself.

You could probably use Rails combined with Ming or Open Laszlo on a server to produce Flash movies.

10

Re: Python and Ruby for Chumby!

Duane wrote:

Um, well, widgets are written in Flash, so Rails, which is a server-side web application framework, probably wouldn't be too helpful, at least on the chumby itself.

You could probably use Rails combined with Ming or Open Laszlo on a server to produce Flash movies.

Yes, I see.  Just stumbled onto Chumby moments ago.  Guess I should have taken the time to digest more of how it works before posting.

Can you recommend a brain upgrade path for a server side guy like myself to RTFM and learn how to write software for Chumby without first becoming a Flash expert?  If I wanted to write something for Chumby in Ruby, would it be a simple Flash Chumby Widget with some Ruby code hanging off of it somehow, or can the Ruby code completely replace the Flash stuff.  I guess then you would need some sort of a graphics library tied in, like RMagic.

Though I don't know much about it yet, there is also this Flex thing that I gather is part of the Flash universe, and people have been talking lately about co-mingling Flex and Rails for database centric apps.  Does this make sense for chumby, or has my lack of groking the Chumby-sphere sent me off in the weeds again?

thanks,
jp

Re: Python and Ruby for Chumby!

We provide a couple of programming languages so that people can write their own software and ignore normal chumby service, if they like.

At the moment, we have a serivce that serves Flash movies to the device, but we understand that folks may want to do other things, and we've simply made that easier rather than send out cease-and-desist letters as most companies are inclined to do.

It's up to you to figure out what to do with these tools we've provided.

If you want to play in our normal widget ecosystem, at the moment, that means Flash.

12

Re: Python and Ruby for Chumby!

Thanks.

In another of your answers to my rash of questions you mentioned that "...at the moment, that means Flash".  Dare I read anything into the "at the moment" part of that?  Are there any other leading contenders for additional fully supported methods of programming Chumby in the relatively near future?

jp

Re: Python and Ruby for Chumby!

jp wrote:

Are there any other leading contenders for additional fully supported methods of programming Chumby in the relatively near future?

Not at the moment - a lot of people would like to be able to repurpose desktop widgets such as those used by Apple Dashboard, Yahoo Widgets, Google Gadgets, Microsoft WhateverTheyCallIt etc, which are typically a bizarre mishmash of XML, Javascript, HTML, a full browser with a rich selection of plugins, etc, but at this point is seems pretty unlikely we can support that sort of thing with the current hardware because these things are so resource intensive. It takes dozens of megabytes of software infrastructure just to run most of these widget systems and some pretty powerful processors.

The nice thing about Flash is that is can do everything those technologies can do, and more, in a small footprint (around 2 MB) and with a rational security model.  The downside is that existing widgets require a rewrite.

However, over time we expect embedded processors to become more powerful and cheaper so it's hard to say.

Re: Python and Ruby for Chumby!

Am I correct in thinking that I can't make sharable apps for the Chumby with Python? In other words, to run Python apps, I have to run it off a USB drive?

And while I'm in the neighborhood, anyone know which gui environments the Python for Chumby/Nokia supports? Wx by chance?

Thanks for any help. Just got my Chumby, wanting to make some widgets but leery of Flash.

Re: Python and Ruby for Chumby!

Widgets are Flash - there's no mechanism through our service to distribute other types of binaries as widgets.

The chumby has no native windowing system - several people (including me) have compiled and run nano-x successfully.  I've also experimented with GTK and some others, but they're much more difficult to cross-build, and use much more memory.

What's your concern with Flash?

Re: Python and Ruby for Chumby!

Thanks for the reply.

My experience with Flash has been that all its security concerns make doing anything useful with it an exercise in workarounds. But I suppose that's exactly why you want to use it, and I'm not saying I blame you.

I just finished my first widget, it's waiting for approval I think. It's called ChumbySpy, and it tunes into a bunch of security cameras all over the world. These security cameras change often so I wrote a Python script on my server that polls them (I think there's 300 cameras or so) and spits out a text file with known working cameras. It worked great when I ran the SWF from my computer pulling the datafile from the server, but when I installed it on the Chumby no go. I gather I need to play with crossdomainxml.

It probably just comes down to comfort though.

Re: Python and Ruby for Chumby!

Yes, you're right - we've definitely placed the user's security over developer convenience.

If we had gone with another technology besides Flash, I have to say we would have done something similar with security sandboxes.  Microsoft's alleged Flash-killer, Silverlight, uses exactly the same security model for exactly the same reasons - in fact, version 2.0 even understands existing Flash crossdomain.xml files.

There's a lot to be learned from the security disasters that have plagued Windows in particular, and we're not interested in being yet another vector for identity theft, spam, worms, botnets etc.

For your current application, all you need to do is put a small static file on your server.

18 (edited by wrybread 2008-03-06 14:58:13)

Re: Python and Ruby for Chumby!

I understand.

And I'm sure you understand that the fact that we can only share apps made in Flash is *much* more limiting than if we could share apps made in more powerful languages.

I guess that's the price of doing this as a corporate entity, as opposed to simply releasing them and telling people to have fun with them.

None of which is to say I don't like my Chumby. I like it a lot.

Re: Python and Ruby for Chumby!

You can certainly share your applications - just not through the standard Chumby Network widget service, which is simply not designed to do that.

If people want to create a directory of third-party applications on the chumby wiki (as I've done with the various languages, lighttpd and others), that's certainly fine with us.  I ported or found compatible versions of many of these languages and tools expressly for that purpose.

There also seems to be a Google Group of folks attempting to provide a replacement firmware image - we have no problem with that either.

Re: Python and Ruby for Chumby!

Awesome. I'm making the jump from PHP to Python, and this is just one more reason to do so.

Re: Python and Ruby for Chumby!

Sorry to bump this thread, but it would be awesome if someone with the new toolchain installed could build python again and upload the build. I unfortunally don't have a linux install, so i can't build it myself hmm

Re: Python and Ruby for Chumby!

bjarkebech wrote:

Sorry to bump this thread, but it would be awesome if someone with the new toolchain installed could build python again and upload the build. I unfortunally don't have a linux install, so i can't build it myself hmm

The python has been rebuilt for the GCC 4.3.2/EABI toolchain.

Re: Python and Ruby for Chumby!

The ruby has been rebuilt for the GCC 4.3.2/EABI toolchain.

Re: Python and Ruby for Chumby!

Hi Duane (and everyone else),

So I'm looking to build a fairly complete Python infrastructure on my Chumby and my first stop was getting Python, I'm looking at getting PyGTK setup next with Cairo for UI stuff. Is this something anyone else might be working on? My goal is to tie together some web stuff.

--Chuck

Re: Python and Ruby for Chumby!

I guess I could put some specific questions down. I saw the Python port, I had already started by converting the build system to using scons, then if found www.ptxdist.org which looks like eventually it will be an even better system but they are not yet done getting their 2.0 stuff done and they aren't really set up to handle folks trying to both learn ptx and their embedded system at the same time. Their cross tools are really good though.

I've built the 1.7 stuff but it leaves me short the include files for /usr/include. Presumably I can cobble together the includes in the tool chain with the kernel includes. I just copied the libraries off the chumby. The goal being to have a root file system that has all the development resources available as well. That way I can cross compile with the Chumby's includes. The VM thing looks interesting too but I've not yet gone that route.

--Chuck