Re: Python and Ruby for Chumby!

Is there any way to interact with Ruby programs on chumby?

Re: Python and Ruby for Chumby!

hello??

Re: Python and Ruby for Chumby!

What do you mean by "interact"?  One can certainly open up the touchscreen driver and display driver to capture events and draw on the screen.

By the way, it's still the weekend - we don't respond as quickly to posts since we have families, lives, etc.

Re: Python and Ruby for Chumby!

ok, thanks, sorry.

Re: Python and Ruby for Chumby!

Duane wrote:

By the way, it's still the weekend - we don't respond as quickly to posts since we have families, lives, etc.

I think Its funny that most of users do "chumby" in their free time but chumby workers do this in their work time smile Anyway Its good to know you have lives!

Re: Python and Ruby for Chumby!

Duane wrote:

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.

Hi Duane, I'm pretty familiar with Java. I'm also now quite familiar with Python. I would like to make my Chumby into something that doesn't download executable content, rather I'd like to make it sort of a remote UI to data I already have in the "cloud". I can't do that with the current software model, fortunately Chumby has, as you so eloquently state, an "open" business model.  I'm currently trying to make Python (and Chumby Support libraries) part of the basic firmware load on my Chumby, any pointers on how I might do that ?

--Chuck

Re: Python and Ruby for Chumby!

Answered in this thread

Re: Python and Ruby for Chumby!

Python seems to be compiled without SSL support, even though SSL should be available on the chumby.

>>> import socket
>>> socket.ssl
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'ssl'

or, as we are using Python 2.6,

>>> import ssl
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/mnt/usb/lib/python2.6/ssl.py", line 60, in <module>
    import _ssl             # if we can't import it, let the error propagate
ImportError: No module named _ssl

According to this message, it happens when

the Python configure couldn't find the SSL header files, it struck _ssl from the list of compilable modules.

Could SSL support be added to the prebuilt Python download? Building it myself is a little over my head, I am afraid. Thanks.

Re: Python and Ruby for Chumby!

You could always shell out to the "curl" command and use that to do GET or POST via HTTPS.  That is compiled with SSL support, although the certificates are a bit out of date.

Re: Python and Ruby for Chumby!

hm it was my intention to create a push-email-widget backend that implements IMAP-idle (some mailservers, such as gmail, require ssl) - I am unsure whether the included curl supports imap and rewriting the exisiting imaplib does not seem wise. But maybe I can set up some kind of curl tunnel, thanks for the suggestion.

Re: Python and Ruby for Chumby!

Yeah, curl wouldn't be great for that, since it works on discrete commands -- keeping a connection open isn't it's game.  Sounds like you'll need to build some native code to run on the device.

37 (edited by nickovs 2010-02-05 11:13:25)

Re: Python and Ruby for Chumby!

speigei wrote:

hm it was my intention to create a push-email-widget backend that implements IMAP-idle (some mailservers, such as gmail, require ssl) - I am unsure whether the included curl supports imap and rewriting the exisiting imaplib does not seem wise. But maybe I can set up some kind of curl tunnel, thanks for the suggestion.

I'd like to second the request for SSL support in the Chumby Python binary distribution. The Chumby software includes openssl, so the code is there, but it looks like the library is in a non-standard place. I don't have access to a Linux box so I can't easily build a sandbox and rebuild Python myself, and I'm sure that we are not the only people who'd like to have SSL support in Python. Perhaps the Chumby development tool maintainers could sort this out.

Re: Python and Ruby for Chumby!

I managed to get python with SSL support running by using the binaries from here: http://nslu2-linux.dyoung-mirror.net/fe … ss/stable/ (I got the link from this forum somewhere)

I had to setup the LD_LIBRARY_PATH but after that it worked without a hitch.

Re: Python and Ruby for Chumby!

Please note that there is no "Chumby Python Distribution" - these are hacks done by some of the engineers in their spare time, and are not supported by Chumby Industries in any official capacity whatsoever.

In some cases, they're merely binaries scarfed from some other distribution, much as speigei has done here.  In fact I think that when we originally posted this, the python was from the Nokia N800 repository.

Re: Python and Ruby for Chumby!

Speigei, thanks for the pointer. I have Python working with SSL using those binaries. It took a few minutes to work out what .ipk files really are and then realise that I also had to download a separate openssl package, but it seems great now.

Duane, thanks for the clarification. Since the binaries that Speigei mentions (a) add useful functionality and (b) seem to be currently maintained, would it be worth updating the wiki page regarding Python to point to these?

Re: Python and Ruby for Chumby!

Ruby 1.9.2 has recently been released and has major improvements from 1.8.6. I have tried to compile it, but I get a "*** buffer overflow detected ***: arm-linux-ar terminated" error from make. Could you compile the newer version and post it or tell me how to get past this error? Thanks!