mob-i-l
Posts: 204
Joined: Sat Dec 29, 2012 2:45 am
Location: Lund, Skåne/Scania, Sweden
Contact: Website Facebook Twitter YouTube

Installing BYOB in Raspbian

Sat Dec 07, 2013 6:26 pm

BYOB is an enhanced version of Scratch 1.4 for more advanced Computer Science. I've unsuccessfully tried to install it in the latest and most upgraded Raspbian. What happens when I start it is that it only shows a white window and that CPU and memory usage increases. The only way to stop it is by killing it using Task Manager. I think the problem is that Raspbian squeakvm is incompatible with BYOB. Maybe BYOB.image could be changed so that it works in Raspbian.
[Edit: Now I've updated the instructions to use the BYOB-Pi.image published in the installBYOB.sh script and now it works in Raspbian!]

Here is how I install and run BYOB.

cd ~/Downloads

wget https://www.dropbox.com/s/cevf5my91pjy0t1/BYOB-Pi.image

wget http://byob.berkeley.edu/byoblib.tgz

cd /usr/share/scratch/

sudo mv ~/Downloads/BYOB-Pi.image .

sudo tar xvf ~/Downloads/byoblib.tgz

cd ~/Downloads

cp $(which scratch.old) BYOB

sed -i -e 's/Scratch.*\.image/BYOB-Pi.image/' -e 's| scratch| BYOB|' BYOB

sudo mv BYOB /usr/bin/

BYOB
Last edited by mob-i-l on Sun May 24, 2015 4:52 pm, edited 3 times in total.
Raspberry Pi0&1A&1B2&1B+&2B&3B w/ Raspbian. Started w/ BASIC on ABC80&ZX81 then Forth, Z80… http://scratch.mit.edu/users/mobluse/ https://github.com/mobluse/ https://www.youtube.com/MOBiL4u/ https://twitter.com/mobluse/

timrowledge
Posts: 1058
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
Contact: Website

Re: Installing BYOB in Raspbian

Sat Dec 07, 2013 7:19 pm

I think the problem is that Raspbian squeakvm is incompatible with BYOB. Maybe BYOB.image could be changed so that it works in Raspbian.
I suspect the vm is ok, because the squeakvm on the Pi is built from the same code as the one on my iMac and the downloads you listed run happily on that. Typically a plain white screen, expanding memory use and nothing else is a sign that something very early in the system startup code in the image is looping because of an error. It can be a *real* pain to find the culprit, not least because it sometimes seems to depend upon something apparently completely unrelated.

I'll see if I can spot anything. It will be a bit harder than it needs to be because the byob team appear to have removed the backdoor that allows us to get into a production Scratch image and find the tools. Maybe they just put one in a harder to find place...

You could try some simple things as well
- move the scratch.ini file out of the way, in case one of the options is causing trouble
- try moving the tools.ypr & ToolSprite.ysp files - I have no idea what they might be for!
Making Smalltalk on ARM since 1986; making your Scratch better since 2012

mob-i-l
Posts: 204
Joined: Sat Dec 29, 2012 2:45 am
Location: Lund, Skåne/Scania, Sweden
Contact: Website Facebook Twitter YouTube

Re: Installing BYOB in Raspbian

Sun Dec 08, 2013 4:35 pm

timrowledge wrote:
I think the problem is that Raspbian squeakvm is incompatible with BYOB. Maybe BYOB.image could be changed so that it works in Raspbian.
I suspect the vm is ok, because the squeakvm on the Pi is built from the same code as the one on my iMac and the downloads you listed run happily on that. Typically a plain white screen, expanding memory use and nothing else is a sign that something very early in the system startup code in the image is looping because of an error. It can be a *real* pain to find the culprit, not least because it sometimes seems to depend upon something apparently completely unrelated.

I'll see if I can spot anything. It will be a bit harder than it needs to be because the byob team appear to have removed the backdoor that allows us to get into a production Scratch image and find the tools. Maybe they just put one in a harder to find place...
I think I might have found the backdoor: Try Shift+Click Edit, then there appears a few extra menu items.
timrowledge wrote: You could try some simple things as well
- move the scratch.ini file out of the way, in case one of the options is causing trouble
- try moving the tools.ypr & ToolSprite.ysp files - I have no idea what they might be for!
I tried these things but it still only shows a white window and has increasing memory usage. I have installed and run it on Ubuntu Linux 10.04 and 12.04 but then I used the Debian-package which seems to include its own special BYOB_squeak_vm. It's strange that it runs on Mac OS X using your squeakvm but not in Raspbian. Maybe it works in RISC OS. Is Scratch and Squeak built-in in RISCOS or do you have to download and install them?

I think it would be great for the Foundation's educational goals if BYOB 3.1.1 could run on Raspberry Pi.
Raspberry Pi0&1A&1B2&1B+&2B&3B w/ Raspbian. Started w/ BASIC on ABC80&ZX81 then Forth, Z80… http://scratch.mit.edu/users/mobluse/ https://github.com/mobluse/ https://www.youtube.com/MOBiL4u/ https://twitter.com/mobluse/

timrowledge
Posts: 1058
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
Contact: Website

Re: Installing BYOB in Raspbian

Tue Dec 10, 2013 6:30 pm

OK, I got the info on how to get into developer mode from the, err, developer, Jens. You have to start the system with the 'BYOB Development.sg' or 'BYOB Development.BAT' as appropriate and *then* the shift-click on 'Edit' extends the menu to include the 'turn off screen fill' which finally gets you to normal Squeak -land.

So now I can try it out and see what might be the problem.
Making Smalltalk on ARM since 1986; making your Scratch better since 2012

timrowledge
Posts: 1058
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
Contact: Website

Re: Installing BYOB in Raspbian

Fri Dec 13, 2013 3:16 am

Well, that was easy once I remembered back a few months to similar issues I had in Feb; BYOB development started early enough in Scratch-time that the image was based on such an old release that it hadn't had some rather important primitive access changes made. Open it up as a developer, file-in the relevant update file, save and try on Pi, bingo!

https://www.dropbox.com/s/f9nuy733p553r ... .image.zip

Unzip as usual, change your startup script (or the filename!) to suit, and give it a try. Remember, it has none of the speedups I've developed for the image, but the squeakvm does have the faster bitblt.
Making Smalltalk on ARM since 1986; making your Scratch better since 2012

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: Installing BYOB in Raspbian

Fri Dec 13, 2013 7:53 am

Fan-Dabby-Dozy :-) :-) :-)

For people not used to playing around with Scratch modificactions here is a little guide to getting it installed alongside Scratch

Download file as above and copy it to /home/pi and then cd to /home/pi

Code: Select all

sudo copy BYOB-Pi.image to /usr/share/scratch

cp ./Desktop/scratch.desktop to ./Desktop/BYOB.desktop
nano ./Desktop/BYOB.desktop
Change contents to

Code: Select all

[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Exec=BYOB %f
Icon=scratch
Terminal=false
Name=BYOB
Comment= Programming system and content development tool
Categories=Application;Education;Development;
MimeType=application/x-scratch-project
save and then

Code: Select all

sudo cp /usr/bin/scratch /usr/bin/BYOB
sudo nano /usr/bin/BYOB
and change to

Code: Select all

#!/bin/sh
# File:            BYOB
# Description:     Script to start the Squeak VM binary with the BYOB image
# Original Author: Bert Freudenberg
# Adapted by:      Miriam Ruiz

VM_VERSION=`find /usr/lib/squeak/ -name "squeakvm" -type f|cut -f5 -d"/"`
SQ_DIR=/usr/lib/squeak/$VM_VERSION
VM="$SQ_DIR/squeakvm"
VMOPTIONS="-encoding UTF-8 -vm-display-x11 -xshm -plugins 

/usr/lib/scratch/plugins/:$SQ_DIR/"
IMAGE="/usr/share/scratch/BYOB-Pi.image"
IMOPTIONS=""
DOCUMENT=""
WRAPPER=""

#set to 1 to work around OLPC bug #8008
export SQUEAK_FAKEBIGCURSOR=0

# default directories (used if not running as Sugar activity)
[ -z "$SQUEAK_SECUREDIR" ] && export 

SQUEAK_SECUREDIR="$HOME/.scratch/private"
[ -z "$SQUEAK_USERDIR" ] && export SQUEAK_USERDIR="$HOME/Scratch"

[ ! -d "$SQUEAK_SECUREDIR" ] && mkdir -p "$SQUEAK_SECUREDIR" && chmod 

700 "$SQUEAK_SECUREDIR"
[ ! -d "$SQUEAK_USERDIR" ] && mkdir -p "$SQUEAK_USERDIR"

[ ! -d "$HOME/Documents" ] && mkdir -p "$HOME/Documents"

usage()
{
    echo "Usage: BYOB [--param value] [-vmopt value] [arg value]"
    echo "       where --param is --vm, --image, or --document;"
    echo "       -vmopt is an option passed to the Squeak VM;"
    echo "       and args are passed to the Squeak image."
}

if [ $# -eq 1 ] ; then
	case "$1" in
	    /*) DOCUMENT="$1"
		;;
	    *) DOCUMENT="$PWD/$1"
		;;
	esac
	shift
else
    while [ -n "$1" ] ; do
	if [ -z "$2" ] ; then
	        usage
		exit -1
	fi
	case "$1" in
	        --help)
			usage
 			exit
			;;
	        --document)
			case "$2" in
			    /*) DOCUMENT="$2"
				;;
			    *) DOCUMENT="$PWD/$2"
				;;
			esac
 			shift
			;;
	        --image)
			case "$2" in
			    /*) IMAGE="$2"
				;;
			    *) IMAGE="$PWD/$2"
				;;
			esac
 			shift
			;;
	        --vm)
			case "$2" in
			    /*) VM="$2"
				;;
			    *) VM="$PWD/$2"
				;;
			esac
 			shift
			;;
		-*) VMOPTIONS="$VMOPTIONS $1 $2"
			shift
			;;
		*)  IMOPTIONS="$IMOPTIONS $1 $2"
			shift
			;;
	esac
	shift
    done
fi

# do not crash on dbus errors
export DBUS_FATAL_WARNINGS=0

# make Compose input methods work
# 30/01/2013: apprently this causes issues, so comment out. asb@asbradbury.org
#[ -z "$LC_ALL" ] && export LC_ALL="$LANG"

VMOPTIONS="$VMOPTIONS -vm-sound-alsa"

# VM, Image, and Document are non-optional
# Document has to be present even if empty for IMOPTIONS to work
echo Executing: $WRAPPER "$VM" $VMOPTIONS "$IMAGE" "$DOCUMENT" 

$IMOPTIONS
exec $WRAPPER "$VM" $VMOPTIONS "$IMAGE" "$DOCUMENT" $IMOPTIONS
and robert is a close relation of your mother :)

All hail Tim and Jens :-)

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: Installing BYOB in Raspbian

Fri Dec 13, 2013 9:30 pm

[edit] 14Dec - Now includes required extra BYOB library files[/edit]
Hopefully I've manged to automate the install
Try

Code: Select all

wget https://dl.dropbox.com/s/zgkq2jw9o9wbava/installBYOB.sh -O installBYOB.sh
followed by

Code: Select all

sudo bash installBYOB.sh
This will download BYOB, create a desktop icon to a script to run it :)

This is for Raspbian users only running as normal user pi :) (Not for ubergeeks)

Simon
Last edited by simplesi on Mon Feb 10, 2014 10:39 pm, edited 2 times in total.
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: Installing BYOB in Raspbian

Fri Dec 13, 2013 9:47 pm

Aah - it seems like the BYOB image has the original high CPU usuage when displaying variables issue that kicked off the whole "lets speed up Scratch" process :(

@tim
Any chance of applying the magic fix - even just the original simple one would do :)

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

mob-i-l
Posts: 204
Joined: Sat Dec 29, 2012 2:45 am
Location: Lund, Skåne/Scania, Sweden
Contact: Website Facebook Twitter YouTube

Re: Installing BYOB in Raspbian

Fri Dec 13, 2013 11:48 pm

timrowledge wrote:Well, that was easy once I remembered back a few months to similar issues I had in Feb; BYOB development started early enough in Scratch-time that the image was based on such an old release that it hadn't had some rather important primitive access changes made.[...]

https://www.dropbox.com/s/f9nuy733p553r ... .image.zip

Unzip as usual, change your startup script (or the filename!) to suit, and give it a try. Remember, it has none of the speedups I've developed for the image, but the squeakvm does have the faster bitblt.
This worked for me and I updated the install-instructions in the original post. Thanks!
Raspberry Pi0&1A&1B2&1B+&2B&3B w/ Raspbian. Started w/ BASIC on ABC80&ZX81 then Forth, Z80… http://scratch.mit.edu/users/mobluse/ https://github.com/mobluse/ https://www.youtube.com/MOBiL4u/ https://twitter.com/mobluse/

mob-i-l
Posts: 204
Joined: Sat Dec 29, 2012 2:45 am
Location: Lund, Skåne/Scania, Sweden
Contact: Website Facebook Twitter YouTube

Re: Installing BYOB in Raspbian

Fri Dec 13, 2013 11:58 pm

simplesi wrote:Hopefully I've manged to automate the install[...]
You miss byoblib and probably BYOB.changes and the right menu icon if you only run that Bash-script.
Raspberry Pi0&1A&1B2&1B+&2B&3B w/ Raspbian. Started w/ BASIC on ABC80&ZX81 then Forth, Z80… http://scratch.mit.edu/users/mobluse/ https://github.com/mobluse/ https://www.youtube.com/MOBiL4u/ https://twitter.com/mobluse/

timrowledge
Posts: 1058
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
Contact: Website

Re: Installing BYOB in Raspbian

Sat Dec 14, 2013 12:40 am

simplesi wrote:Aah - it seems like the BYOB image has the original high CPU usuage when displaying variables issue that kicked off the whole "lets speed up Scratch" process :(

@tim
Any chance of applying the magic fix - even just the original simple one would do :)

Ouch. Didn't spot that one. I'll see what I can do but it may take a few days. In the meantime, bask in the nostalgia of how awful it was...
Making Smalltalk on ARM since 1986; making your Scratch better since 2012

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: Installing BYOB in Raspbian

Sat Dec 14, 2013 10:32 am

@mob-i-l
Ta - :)
I've included the byoblib files now but haven't worked out where I can find an icon file so still using the Scratch one

I didn't include the changes file as I'm assuming Tim has rolled them into his image

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

mob-i-l
Posts: 204
Joined: Sat Dec 29, 2012 2:45 am
Location: Lund, Skåne/Scania, Sweden
Contact: Website Facebook Twitter YouTube

Re: Installing BYOB in Raspbian

Wed Dec 25, 2013 5:12 pm

simplesi wrote:@mob-i-l
Ta - :)
I've included the byoblib files now but haven't worked out where I can find an icon file so still using the Scratch one

I didn't include the changes file as I'm assuming Tim has rolled them into his image
There are icons in the deb-file for i386 in data.tar.gz in /./usr/share/icons/hicolor/.

@timrowledge Can BYOB-Pi do without the changes-file?
Raspberry Pi0&1A&1B2&1B+&2B&3B w/ Raspbian. Started w/ BASIC on ABC80&ZX81 then Forth, Z80… http://scratch.mit.edu/users/mobluse/ https://github.com/mobluse/ https://www.youtube.com/MOBiL4u/ https://twitter.com/mobluse/

timrowledge
Posts: 1058
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
Contact: Website

Re: Installing BYOB in Raspbian

Thu Dec 26, 2013 8:28 pm

The short story is that you can always manage without the .changes file and the .sources file since all they are is the saved source text; the .sources is a large read-only file with mostly the main system code and the .changes file is an audit trail of edits made and saved and code filed in. There's a much longer story that you could learn about by reading up on how Smalltalk works, should you be interested (wiki.squeak.org/wikiwould be a decent starting point)

Even if you are doing development work you can survive without the two source files since Smalltalk systems can decompile the code and let you edit and re-save it. You lose helpful comments etc but you can still work.

I'll try to take a look at adding the scratch speedups to byob over the next few days. Some of them will be very simple to import but I suspect some of the major speedups in the execution machinery might need a fair bit of work since byob has altered things down in the dungeons.
Making Smalltalk on ARM since 1986; making your Scratch better since 2012

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: Installing BYOB in Raspbian

Thu Dec 26, 2013 9:15 pm

I think the variable display issue has always been the real killer slowdown so if that one alone could be sorted that would be great :)

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

timrowledge
Posts: 1058
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
Contact: Website

Re: Installing BYOB in Raspbian

Fri Dec 27, 2013 10:16 pm

OK, for the pathologically brave, there is another BYOB derived image at https://www.dropbox.com/s/hd1j1n7ig0ak9 ... .image.zip

It's so scary you might want to hide behind the sofa with your anti-Dalek paper bag over your head.

What it has so far-
better handling of the updating of variables displayed on-stage
popup menus that work in the development tools (quite important when you are using them!)
faster background displaying
better graphic effect filter handling
some media item improvements

It *does not* have any of the execution engine improvements, nor the tile editing speedups - yet.
Making Smalltalk on ARM since 1986; making your Scratch better since 2012

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: Installing BYOB in Raspbian

Fri Dec 27, 2013 10:52 pm

Its just hanging with white screen with me :(

If I put the original back, then that works fine

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

timrowledge
Posts: 1058
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
Contact: Website

Re: Installing BYOB in Raspbian

Fri Dec 27, 2013 11:37 pm

Hmm. I did mention the paper bag, right?

Try adding the changes file (https://www.dropbox.com/s/e382wuh7mmwe5 ... hanges.zip) to the same directory as the image file. Make sure you have the SqueakV2.sources file in the same directory as the squeak vm - that ought to be /usr/lib/squeak - see https://www.dropbox.com/s/4x4b35kab8yn6 ... ources.zip for a copy if it isn't already there.

On my machine (which is admittedly in a decidedly not-standard state) it starts up ok. You *might* find a debug log file if we're lucky.
Making Smalltalk on ARM since 1986; making your Scratch better since 2012

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: Installing BYOB in Raspbian

Sat Dec 28, 2013 9:16 am

Copied changes into /usr/share/scratch- no diff

installed sources into /usr/lib/squeak - no diff

:(

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

timrowledge
Posts: 1058
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
Contact: Website

Re: Installing BYOB in Raspbian

Thu Jan 02, 2014 3:38 am

Hmph. That is very odd. I'm running out of ideas to test.
Making Smalltalk on ARM since 1986; making your Scratch better since 2012

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: Installing BYOB in Raspbian

Thu Jan 02, 2014 8:14 am

I'll download them all and start again and see what happens the 2nd time

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

timrowledge
Posts: 1058
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
Contact: Website

Re: Installing BYOB in Raspbian

Thu Jan 02, 2014 6:21 pm

Just in case there is some compression artefact causing issues, try this tgz instead -

https://www.dropbox.com/s/7kftb6du1ufh2wb/BYOB-Pi2.tgz

(`tar xvzf BYOB-Pi2` should decompress it)

It runs perfectly ok on my Mac and Pi.
Making Smalltalk on ARM since 1986; making your Scratch better since 2012

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: Installing BYOB in Raspbian

Thu Jan 02, 2014 9:59 pm

No - still just white screen :(

We need someone else to try it and see what happens to them

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

timrowledge
Posts: 1058
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
Contact: Website

Re: Installing BYOB in Raspbian

Thu Jan 02, 2014 11:04 pm

Yes, I think we need a third party test; I even went so far as to copy your desktop & script stuff to see if that might explain it - no problem.
If you do the old `ps aux` do you see the vm running is
/usr/lib/squeak/4.10.2-2793 ?
Making Smalltalk on ARM since 1986; making your Scratch better since 2012

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: Installing BYOB in Raspbian

Thu Jan 02, 2014 11:15 pm

Yep

Code: Select all

/usr/lib/squeak/4.10.2-2793/squeakvm -encoding UTF-8 -vm-dis
Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

Return to “Scratch”

Who is online

Users browsing this forum: No registered users and 1 guest