NuScratch version of Whiskers
Hot off the press – No-Mod-Programming has done NuScratch version of Whiskers for RaspberryPi 🙂
To use on the Pi download the image file , unzip it save it into /home/pi folder and make a copy of it
cp /home/pi/Whiskers.image /home/pi/NuWhiskers.image
(need to use sudo for these commands)
sudo cp /home/pi/NuWhiskers.image /usr/share/scratch
sudo cp /usr/bin/scratch /usr/bin/nuwhiskers
Then
sudo nano /usr/bin/nuwhiskers
and change line 10 to be
IMAGE="/usr/share/scratch/NuWhiskers.image"
and save it (CTRL-X followed by Y then enter)
Then to run Whiskers type
sudo bash /usr/bin/nuwhiskers
or create this file using the text editor in /home/pi/Desktop and call it whiskers.desktop
nano /home/pi/Desktop/nuwhiskers.desktop
[Desktop Entry] Encoding=UTF-8 Version=1.0 Type=Application Exec=nuwhiskers Icon=scratch Terminal=false Name=NuWhiskers Comment= Programming system and content development tool Categories=Application;Education;Development; MimeType=application/x-scratch-project
If you want to run ScratchGPIO with NuWhiskers then follow these isntructions supplied by Steve aka “@NoSheds” on twitter
You must already have Scratch GPIO7 installed. If you haven’t, then follow these instructions
Create a NuWhiskers GPIO desktop icon:
nano /home/pi/Desktop/nuwhiskersgpio7.desktop
paste in
[Desktop Entry] Encoding=UTF-8 Version=1.0 Type=Application Exec=/opt/scratchgpio7/nuwhiskersgpio7.sh Icon=scratch Terminal=false Name=NuWhiskersGPIO 7 Comment= Programming system and content development tool Categories=Application;Educati on;Development; MimeType=application/x-scratch -project
Create a shell script to run ScratchGPIO with NuWhiskers. Simplest way to get the file permissions etc is just to copy the existing scratchgpio7.sh file
sudo cp /opt/scratchgpio7/scratchgpio7.sh /opt/scratchgpio7/nuwhiskersgpio 7.sh
then edit it with
sudo nano /opt/scratchgpio7/nuwhiskersgpio7.sh
and change the last line from scratch to muwhiskers:
nuwhiskers --document "/home/pi/Documents/Scratch Projects/rsc.sb" &
Simon
Contact me if this doesn’t work
Hi Simon,
I am using NuScratch on RPi. However, I am trying to figure out how it can be used to control motors. Please advise. Thanks,
Simon
Hi
NuScratch is the Pi official Scratch to GPIO controller and support for it is best obtained on their forum
https://www.raspberrypi.org/forums/viewforum.php?f=77
as it use different syntax than my own ScratchGPIO version
regards
Simon
PS ScratchGPIO is much better BTW 🙂
Hi! I follow the instrucion above but at the end the terminal repaly me with this error” Executing: /usr/lib/squeak/4.10.2-2614/squeakvm -encoding UTF-8 -vm-display-x11 -plugins /usr/lib/scratch/plugins/:/usr/lib/squeak/4.10.2-2614/ /usr/share/scratch/NuWhiskers.image
This interpreter (vers. 0) cannot read image file (vers. 6521).
Press CR to quit…” have you a solution?
Hi
I just ran through the instructions again on a PiZero
Worked OK for me
I imagine you maybe didn’t succeed editing /usr/bin/nuwhiskers and changing line 10 to
IMAGE="/usr/share/scratch/NuWhiskers.image"
Simon
I try many time and I edit well (just copy and past than save) but the terminal reply me as before 🙁
please help me it’s important …
have you other suggestion?
Are you using 27May6 Raspian image?
if so, please attach your /usr/bin/nuwhiskers file
(or photo of 1st page of code if that’s easier)
Simon
1. I’ve got raspbian jessie. I dont know if is it the same image that you said. I bought rpi with the noobs preinstalled on the sdcard.
how can i chek it?
2. i type on lxterminal “/usr/bin/nuwhiskers” and than repplay me as before
” Executing: /usr/lib/squeak/4.10.2-2614/squeakvm -encoding UTF-8 -vm-display-x11 -plugins /usr/lib/scratch/plugins/:/usr/lib/squeak/4.10.2-2614/ /usr/share/scratch/NuWhiskers.image
This interpreter (vers. 0) cannot read image file (vers. 6521).
Press CR to quit…”
3. i don’t have any folder nuwhiskers in “/usr/bin/…. but only the file:
nuwhiskers; nuwhiskers.save1; and nuwhiskers.save2
thats all …. thanks!!
🙂
One problem could be that the version of Jessie that you have pre-isntalled on the card may be too old -its a common problem
The main information I need is to see the contents of /usr/bin/nuwhiskers as I believe that is incorrect
Are you able to do
nano /usr/bin/nuwhiskers
and then photograph what you see and send it to me simplecy@googlemail.com
thanks
Simon
I am facing exactly the same problem as six, here is my /usr/bin/scratch (I wanted to replace it seamlessly)
#!/bin/sh
# File: scratch
# Description: Script to start the Squeak VM binary with the scratch 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/Whiskers.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: scratch [–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
All I can suggest is to follow my instructions and make sure that works first.
Then you can go on to try and replace Scratch with NuWhiskers (but I really don’t see why you’d want to) 🙂
Simon
Dear Simon,
I sorted it out, I needed to get nuScratch first, as I had the base squeak version and not the optimised one. Now I am getting an error using the “If I am a clone” hat block. I cannot save the project, I get an error:
MessageNotUnderstood: WhenCloneHatBlock>>asBlockTuple
Also, the hat block “When SPACE is pressed” gets transformed into
the hat block “When backdrop switches to SPACE” which does not make sense. This happens as soon as I have used “When I am a clone” hat block.
Dear Simon
to be a bit more precise, as long as there is no error (debug message in a separate window) saving works no problem. After an error, any attempt to save leads to KEY pressed hat blocks being transformed into “When backdrop switches to KEY”. also the saved data reflect this (i.e. are nonsensical). Closing whiskers, starting it anew and loading such a file shows “When backdrop switches to KEY” hat blocks instead of the “KEY pressed” hat blocks. Correcting the blocks is futile, since at saving they get converted to “When backdrop switches to KEY”.
Best regards,
George (I should have opened a different thread)
I’d ask these sort of questions on the Scratch forum Whiskers thread.
But I think the author has abandoned development 🙁
Simon
I am using whiskers but it keeps causing errors and crashing. Has anyone else had problems with whiskers?
I stopped using it – i think it was needed in the past but not nowadays