Topic: Why does this have to be so ##@&$@$! difficult?

I got a bright idea.  I figured I'd install the arm tool chain and try cross compiling code for my chumby projects.  So I went to the chumby wiki on that topic and tried to follow their instructions.  Yeah, right!  As soon as I start installing the tool chainI start having problems with directories that don't exist (why would I, already, have an Arm directory already on my computer if I am installing an Arm tool chain?) 

The directions don't make sense.

Has anyone done this already and let me in on the simple directions to install the Arm tools?

2 (edited by guyc 2012-03-26 16:03:40)

Re: Why does this have to be so ##@&$@$! difficult?

Hopefully someone will pipe up with a more direct answer to your question, but if you are running on a CHB, I can make available an SD image with a dev environment already installed.  This tool chain is the product of this forum discussion.  It's a chumby-oe build, with c and c++ compilers, and a few extra packages for i2c twiddling.  The image is for a 1Gb SD card and is 88MB compressed.  It does NOT include the closed-source Actionscript stuff that comes supplied on the original image.

FWIW I've also started to collect and document sample code for accessing hardware on the CHB.  So far I have code for the accelerometer and leds.  These examples will build on the CHB using the dev image.  The led code includes a general purposes gpio library, and the accelerometer uses the kernal i2c interface.

Re: Why does this have to be so ##@&$@$! difficult?

Thanks GUYC.  I may already have something similar, but I'll take you up on your offer.

Here is what I want.  I want to use the three chumbies I have (2 info casts and a CHB) for the robotics program at my school.  I can program in "C" (although I can see I still have a lot to learn).  I can see that programming in Linux is really about writing a bunch of little programs that are bound together in an application.  Therefore, I figure I need to learn a scripting language like Python or Lua (I'm leaning towards Lua).  Both those languages have the ability to incorporate C programs written to do "stuff".  I figure there are two ways to do this: a) write on the chumby or b) cross compile on my desktop.

I'm not sure I can, say, compile a Lua version of your LEDS.C program so I could use the GPIO fuctions on the Chumby itself.  That would be fantastic.  I tried to install scratchbox, but here is where the madness starts.  After following the instructions on the wiki I tried to "/scratchbox/login" and got "permissions denied".  I am at a complete loss.

I am also trying to install the CBCLua i found at KISS Robotics.  I have little faith that it will work as their instructions are rather vauge.  It seems that most of the tools needed to do anything in Linux requires a much deeper understanding than one would need to do it with Windows.

It's rather frustrating.

Re: Why does this have to be so ##@&$@$! difficult?

Yep, you are in at the deep end for sure, but it is a worthwhile goal so let's see what we can
do to ease your pain.

Seems like what you really really want to get started is a boot image that includes python and lua.
I'm building that now, once it is done I'll test it and provide a download link if it all looks healthy.
There are lots of optional support packages for python, so it might take a few iterations
to get everything you need.

Once it passes quality assurance, I'll post back with an upload link.

Re: Why does this have to be so ##@&$@$! difficult?

Here is a ROM image rom-chumby-falconwing-chumby-edu-image.img.bz2 that includes compilers plus python and lua. 

Uncompressed the image size is 477579264 bytes, and md5 checksum is 3eea9b837d3ea530ec37c1ae472fee46.
Assuming you download it to a unix machine:

Uncompress it:

$ bunzip2 rom-chumby-falconwing-chumby-edu-image.img.bz2

Check the file size:

$ ls -l rom-chumby-falconwing-chumby-edu-image.img    
-rwxr-xr-x  1 guy  staff  477579264 Mar 27 12:58 rom-chumby-falconwing-chumby-edu-image.img

Verify the checksum (under OSX and FreeBSD the command is md5, for Linux it is md5sum)

$ md5sum rom-chumby-falconwing-chumby-edu-image.img
MD5 (rom-chumby-falconwing-chumby-edu-image.img) = 3eea9b837d3ea530ec37c1ae472fee46

Now copy it to SD and boot.  The transcript below shows version numbers and demonstrates a hello world for each.

.---O---.                                           
|       |                  .-.           o o        
|   |   |-----.-----.-----.| |   .----..-----.-----.
|       |     | __  |  ---'| '--.|  .-'|     |     |
|   |   |  |  |     |---  ||  --'|  |  |  '  | | | |
'---'---'--'--'--.  |-----''----''--'  '-----'-'-'-'
                -'  |
                '---'

The Angstrom Distribution chumby-falconwing ttyAM0

Angstrom v20120216 chumby-falconwing ttyAM0

chumby-falconwing login: root
root@chumby-falconwing:~# python
Python 2.6.6 (r266:84292, Feb 16 2012, 22:59:50) 
[GCC 4.5.3 20110311 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> print "hello world\n";
hello world

>>> 
root@chumby-falconwing:~# lua
Lua 5.1.4+bitwiseops  Copyright (C) 1994-2008 Lua.org, PUC-Rio
> print ("Hello World!")
Hello World!
> 
root@chumby-falconwing:~# 

Re: Why does this have to be so ##@&$@$! difficult?

Doesn't seem to work as you said.  I get to the login, but no python script (nor lua).  I did down load it on my windows machine, but I'm going to boot into Ubuntu and try it there.

Re: Why does this have to be so ##@&$@$! difficult?

What output do you get from "uname -a" on the Chumby's command line?

Re: Why does this have to be so ##@&$@$! difficult?

guyc wrote:

What output do you get from "uname -a" on the Chumby's command line?

Linux chumby-falconwing 2.6.28-chumby #4 PREEMPT Thu Feb 16 22:31;05 EST Armv5tejl GNU/Linux

Re: Why does this have to be so ##@&$@$! difficult?

Cool, looks like you do have the right boot image.   You said:

I get to the login, but no python script (nor lua).

So you can boot and login and you have the right kernel, so
lets take it one step at a time.  If you work through these and
get something different, respond with the resulting error message
or output and we can work from that.

First confirm that python is installed:

which python

Here's what you should see when you do this:

root@chumby-falconwing:~# which python
/usr/bin/python

If that works, you can try running a python script from the keyboard.  Start python:

python

You should see this:

root@chumby-falconwing:~# python
Python 2.6.6 (r266:84292, Feb 16 2012, 22:59:50) 
[GCC 4.5.3 20110311 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 

now enter the following line:

print "Hello world";

You should see this:

>>> print "Hello world";
Hello world
>>> 

To exit python you need to press control-D which means "end of file".
That will take you back to the command prompt.

Give that a shot.  If it doesn't work then provide a detailed description
of what happens and we can use that to figure out what is going wrong.

Re: Why does this have to be so ##@&$@$! difficult?

which python and which lua produce the expected responses.  So, some questions.

1) how do I get to use the rest of the sd card?  The card has about 450M of used space and 1.5G of unused space.  I have tried to expand this space on other ROMs, but only succeeded in trashing the files on the card.

2) Can I recompile Lua and Python on the Chumby?  I don't know how else to add modules.

Re: Why does this have to be so ##@&$@$! difficult?

mwalimu wrote:

1) how do I get to use the rest of the sd card?  The card has about 450M of used space and 1.5G of unused space.  I have tried to expand this space on other ROMs, but only succeeded in trashing the files on the card.

If you've tried the various published solutions with no luck I would recommend using OE to build the the image to fit your media. The size is configured by changing this line in chumby-oe/meta-chumby/conf/machine/chumby-falconwing.conf

IMAGE_ROOTFS_SIZE = "450000"

Units are Kbytes, and you need to leave a little room for  overheads like the boot loader.  If you are using a 2Gb SD card, I would try a value of 1950000KB.  I'm happy to build that for you if it would help.

As an aside, I recommend using a USB flash drive for storing your development code rather than the SD card so that it is painless to rewrite the root image without losing anything.

mwalimu wrote:

2) Can I recompile Lua and Python on the Chumby?  I don't know how else to add modules.

it is no doubt possible, but I would just add the packages to the OE recipe file and rebuild the root image.

Re: Why does this have to be so ##@&$@$! difficult?

I figured it out.  I had to mount mmcblk0p3. 

I also found that gcc will, indeed, build lua, but there is a catch.  The compiler needs the "readline" library (and I guess "history", also).  Neither appear to be on the falconwing image nor the OE image.  I found the GNU source for readline and I will try to build it.

Re: Why does this have to be so ##@&$@$! difficult?

Have you tried using the Buildroot toolchain? It'll compile a whole system image for you (minus the Chumby-specific stuff, like the kernel and the bootloader) given the right details.

14 (edited by mwalimu 2012-04-16 11:18:35)

Re: Why does this have to be so ##@&$@$! difficult?

OK.  So I've been fooling around with the various images I have some success.  Our Roombas and iCreate can be Chumby powered via Python.  I haven't used the OE image because I can't figure out the Wifi on it (it does have wifi, doesn't it) and it's cooler to show the robots being controlled over wifi than with a serial tether.

Now we have an Infocast 8 and it's itching to have OE on it.  I tried to follow the directions on the Chumby wiki, but it crashed about half way through - something about a mismatching checksum in password.bb.  I'd like to try the Clearwater github directions, however, I'm confused by what sem to be clear directions.  The firs step reads get a clean version of Debian, which I read as install a very limited version of Debian on my computer, which is a non-starter.  Did I get that right or can I use my computer with Ubuntu 10.04 installed on it?

Re: Why does this have to be so ##@&$@$! difficult?

From what I've read Ubuntu should work, although someone around here did comment that they had problems with Ubuntu and had to switch to Debian to run OE.  I know from personal experience that OSX and FreeBSD will not work.  After failing with those I set up a discarded PC as a dedicated Debian build machine.  That worked, but was really slow due to the antique hardware.  Now I use a much beefier Windows 7 machine running a VM with Debian which is passably fast.

Re: Why does this have to be so ##@&$@$! difficult?

If you try Ubuntu (which is very similar to straight debian) and see if it works?  If not, I'd recommend posting here to see if there's a work-around or running debian in a VM.

Linux Guy - Occasional Chumby Hacker

Re: Why does this have to be so ##@&$@$! difficult?

OK, here goes...

Re: Why does this have to be so ##@&$@$! difficult?

OK.  So we're baking Chumby pie now.    It didn't ask me what flavor I wanted, I'm just going to have eat falconwing and like it. 

So, forgive my naivete, but perhaps someone could answer this.  Wouldn't it make more sense to have all these files in one place where people couldn't  change files willy-nilly (thus gumming up the works) and make for a quicker download and build?  I believe that Angstom does this.

Re: Why does this have to be so ##@&$@$! difficult?

So do I change the build log to get a silvermoon flavor of chumby pie?

Re: Why does this have to be so ##@&$@$! difficult?

Half way through, no problems...

Re: Why does this have to be so ##@&$@$! difficult?

NOOOOOOOOOOOOO.....................!


NOTE: package e2fsprogs-1.41.14-r30: task do_compile: Started
ERROR: Logfile of failure stored in: /home/chris/chumby-oe/output-angstrom-.9/work/armv5te-angstrom-linux-gnueabi/e2fsprogs-1.41.14-r30/temp/log.do_compile.16925
Log data follows:
| + do_compile
| + find ./ -print
| + xargs chmod u=rwX
| chmod: changing permissions of `./patches/llseek-uclibc.patch': Operation not permitted
NOTE: package e2fsprogs-1.41.14-r30: task do_compile: Failed
ERROR: Function 'do_compile' failed (see /home/chris/chumby-oe/output-angstrom-.9/work/armv5te-angstrom-linux-gnueabi/e2fsprogs-1.41.14-r30/temp/log.do_compile.16925 for further information)
ERROR: Task 815 (/home/chris/chumby-oe/openembedded/recipes/e2fsprogs/e2fsprogs_1.41.14.bb, do_compile) failed with exit code '1'

Any ideas?

Re: Why does this have to be so ##@&$@$! difficult?

The operation that failed appears to be doing chmod u=rwX' on some subset of the files in e2fsprogs-1.41.14-r30 and it fails with "Operation not permitted".  On possibility is that there are file ownership issues - eg maybe some files are owned as root as in this very similar situation.

I suppose another possibility is that you are using some sort of file system that doesn't support full chmod semantics like fat32 or a network-mounted or USB-mounted drive?

Re: Why does this have to be so ##@&$@$! difficult?

I'm using the main Hard drive of my computer - it is dual boot for Windows 7 and Ubuntu 10.04.  I tried  "chmod -R USER org.openembedded", but it objected to USER, so I guess that means something else, (like perhaps I need to replace USER with (who knows?).

I now return to the original title of this thread... :<

Re: Why does this have to be so ##@&$@$! difficult?

I would suggest the following command to make sure user 'chris' is the owner
of all of the files in the chumby-oe tree:

cd /home/chris/
chown -R chris chumby-oe

Since it is dual-boot, you may well be using an NTFS file system.  Mount will tell you.
For example mount shows I'm using ufs here:

%mount
/dev/ad0s1a on / (ufs, local)
devfs on /dev (devfs, local, multilabel)
/dev/ad0s1e on /tmp (ufs, local, soft-updates)
/dev/ad0s1f on /usr (ufs, local, soft-updates)
/dev/ad0s1d on /var (ufs, local, soft-updates)

I don't know what the ramifications are of using NTFS,
but try the recursive chown and see if that gets you through.

Re: Why does this have to be so ##@&$@$! difficult?

Apparently,

cd /home/chris/
chown -R chris chumby-oe

is an operation that is not permitted.

so is %mount

sigh...