Installing ScratchGPIO5 software on a Raspberry Pi
- With Raspberry Pi connected to Internet
Copy the text below ( left click just before the s of sudo and drag right until all the text in the line as been selected) then right-click and select copy. Open up an LX Terminal window and select Edit and the Paste that into an LX Terminal window and run it to download the installer.
sudo wget http://goo.gl/Pthh62 -O isgh5.sh
(If there is a problem try this link instead)
sudo wget http://goo.gl/ikUpyJ -O isgh5.sh
Once the installer has been downloaded then just type (or copy and paste the text below as before)
sudo bash isgh5.sh
(If logged in as a different user to standard pi, then type sudo bash isgh5.sh yourusername) This will install all the necessary extra software and some simple examples.
- With Raspberry Pi not connected to Internet.
Power down you Pi and put the SD card into another computer and download this file
http://goo.gl/Pthh62
and copy it to your SD card.
Put the card back into your Pi and then open up an LX Terminal windowtype the following
sudo bash /boot/install_scratchgpio5.sh
(If logged in as a different user to standard pi, then type sudo bash /boot/install_scratchgpio5.shย yourusername) This will install all the necessary extra software and some simple examples.
The installer will create 2 desktop icons – ScratchGPIO5 which is used for beginners using simple circuits and ScratchGPIO 5Plus which is used with specific add-on boards.
Continue onto 1st Project
Hello,
I just read that you’ll prepare a v5 ?? Whow, great ! is it with Scratch2 ?
Thanks for your wokr on this project !
No – just a roll-up of all the extra add-on board support plus change back to 11,12,13,15,16 and 18 as default outputs and 7 and 22 default inputs with pull-up resistors enabled.
Hi I have tried to get scratch gpio 5 with your instructions and i fails and I don’t understand why I have the latest raspbian installed fresh to see if that helps on a raspberry pi b with a 32gb sd and loaded in raspbian to desktop tried copy paste text in lx and copy straight to sd and still got no where tried different raspberry pi s tried different sd s please help me as I think it must be simple but I just can’t do it please help
OK
When you do the sudo bash isgh5.sh does it look like it installs OK?
Do you see any new icons on your desktop?
If you go into lx terminal and CD scratchgpio5 does folder exist?
Does ls give you a list of files?
Simon
Do you think it is possible to use a Scratch2GPIO ?? inline or offline, doesn’t matter
No. Scratch 2 doesn’t work on the Pi ๐ฆ
I am trying to get BYOB working on Pi
Yes, interesting project because it can command arduino too !
But in Scratch2 you can have video, not in BYOB, and that is an interesting feature for kids.
We will soon have holidays in France, and I will (re)start documentation on robot ScratchGPIO+Pirocon : how to create image, use SrctahcGPIO, make wifihotspot, etc.
Hope v5 will soon arrive !
Hello, I just wondered if it is available yet? The page is telling me found for downloading http://goo.gl/6FY45Q on my laptop. I may be jumping the gun here?
Sorry about that – wrong link and instructions weren’t right either!
This is the link for downloading via other computer to SD Card
http://goo.gl/Pthh62
then stick it back in your Pi and open up LX Terminal and type
sudo bash /boot/install_scratchgpio5.sh
Hi Simon
Now that version 5 is available, do we have to remove the earlier version of GPIO before installing version 5.
Thanks for all your hard work on the software.
By the way what does BYOB stand for?
Alan
No Version5 installs complety seperate folder/icons (Just in case there was a problem with it but I think its fine from what people are saying )
BYOB is Build You Own Block
A long time ago, a ouple of CS people expanded Scratch so that it was usefull for teaching university level intro. Eventually it developed into a javascript online tool called Snap! but the original (and fully functional) Scratch mod is BYOB 3.11 which works on the RPi ๐
http://snap.berkeley.edu/
(Scroll down for BYOB stuff – use forum installer
http://www.raspberrypi.org/forum/viewtopic.php?f=77&t=62781&start=25#p503683
Simon
Hello Simon,
Thank you for all your amazing work to make GPIO control so easy in Scratch! I’ve volunteered some time at my kids school in the past to lead Scratch game making lessons. Next week we’ll try making some simple ‘robots’. It’s going to be fun!
This isn’t a feature request… I’m just curious whether there’s an existing way to use your Scratch GPIO tool to read a photocell light sensor similar to the following link:
https://learn.adafruit.com/basic-resistor-sensor-reading-on-raspberry-pi/basic-photocell-reading
Many thanks from Toronto!
Greg
I’ve added experiemental code for doing this is dev version https://cymplecy.wordpress.com/2013/11/26/scratchgpio-development-testing/
syntax is broadcast RCTimexx
wait 1 sec
A sensor value called RCTimexx should now be available
I’ve not tested it but if you have the bits you could try it out
A value of 1000 means nothing detected
Simon
Does the RCTime broadcast function work in version 7? I have tried to get readings but all the sensor value shows in 1000. I can get readings when I use a python script so I am pretty sure I have it wired correctly.
Not tried it in ages – let me have look send me python script that works for you please simplecy at googlemail dot com
Not sure what I did but it started working! Thanks for the reply.
Using the first line above (sudo wget http://goo.gl/Pthh62 -O isgh5.sh)
Gives the following error ๐ฆ
GnuTLS: A TLS warning alert has been received.
Unable to establish SSL connection.
This is an issue with my RPi rather than your link.
Any clues to the cure? ๐
mm – someone else had same trouble with dev version last night. I just tried normal version myself and it worked fine.
Try the old switch off and on again? ๐
There seems to be an issues about at the moment – maybe its the same thing? http://www.raspberrypi.org/forums/viewtopic.php?t=72587&p=523131
Try this link to a copy on my dropbox account
sudo wget https://www.dropbox.com/s/26f4iv1f5aj1j3z/isgh5.sh
Superb ๐ Thanks for the dropbox link.
Just bought an add board and trying to get it working before I return to school from the Easter break ๐
Very grateful for the dropbox link ๐
Stephen
What board?
Pibrella. Just ordered a PiDie too ๐
All LED’s working fine but not got the hang of the switch input yet ๐
Dos the switch example work? https://cymplecy.wordpress.com/scratchgpio/addon-boards/pibrella/
I downloaded and installed this fine but when I want to use the sensor value black only has these values
slider
light
sound
resistance-A
resistance-B
resistance-C
resistance-D
—————–
tilt
distance
and it doesn’t show any of the pins
oops – sorry about that – i left some code commented out – please re-download and it should be OK now – thanks for reporting it ๐
I have exactly the same problem as Erika Y even though I only downloaded last week (27 Jun).
I have a basic single LED on P11 and can run the Python script blink11.py fine using a terminal session and “sudo python blink11.py” and this flashes the LED.
When I run scratchgpio5 from the desktop icon, I get the message “Remote Sensor Connections Enabled”, click “OK” but the sensor values only list the same as Erika Y – no pins are shown – and when I load and run the blink11 scratch program, nothing happens!
I have tried running scratch first then run the python script from a terminal, scratch doesn’t do anything but the python script works then tried the python prog first then scratch but still nothing from scratch!
What could be going wrong?
Just to aid debugging – re-download and install – see what happens ๐
Then if it doesn’t work
reboot
open up LX terminal and run
cd /scratchgpio5
then
sudo python scratchgpio_handler5.py
The python prog should start and sit there complaining that it can’t connect to Scratch.
Launch NORMAL PLAIN Scratch and open up rsc file.
Go back to LX Terminal window and see if any error is being reported.
report back to me please
Simon
I have the same problem as Erkia Y and TimH. Accordingly to your suggestions I re-installed everything, started scratchgpio_handler5 and got the following error: “I couldn’t find a Mesh session at host: 127.0.0.1, port: 42001”
Do you have any idea what goes wrong?
Best,
Marcus
will this work with nwazet pecan pi relay board??
Have you got a link to info on it
http://nwazet.com/nwazet-pecan-pi-relays
i had this working good using python until
i did this ( sudo apt-get update). and then this
( sudo apt-get upgrad )
i can trigger the relays manualy useing this in the LXTerminal
gpio -g mode 25 out
gpio -g mode 17 out
gpio -g mode 27 out
gpio -g mode 22 out
gpio -g mode 23 out
gpio -g mode 24 out
gpio -g write 25 1
gpio -g write 17 1
gpio -g write 27 1
gpio -g write 22 1
gpio -g write 23 1
gpio -g write 24 1
gpio -g write 25 0
gpio -g write 17 0
gpio -g write 27 0
gpio -g write 22 0
gpio -g write 23 0
gpio -g write 24 0
GPIO cleanup()
but I cant get python to run my scripts?
I think you’d be better off going onto main Pi forum and asking about your Python problem there
http://www.raspberrypi.org/forums
Hi Simon,
love what you’ve done.
I’m looking to use the PiRoConB. I can get it to run via VNC, but was wondering if it might be a bit less CPU intensive it was run via -X windows forwarding. I followed the advice on Meltwaters site (removed -xshm and ran it as a shell script) but this didn’t work with scratchGPIO5plus.
Any ideas?
If not I’ll just keep using VNC
Thanks
Shane
I’ve heard about x-forwarding but not used it – is it easy to setup?
[…] demonstration uses Scratch GPIO developed by Simon Walters at Cymplecy. The robot can be purchased for about ยฃ25 – ยฃ30 such as through Rapid. It’s not too […]
First, ScratchGPIO is wonderful. Thank you for all of your work on this. My son and I bought a Pi (model B) this summer for a fun project. We have been working on some basic python scripts and scratch programming. We are just now getting into the GPIO pins (LED lights, etc.).
We ran into a slight snag while working on the “Sweet Shop Reaction Game” found on the RaspberryPi.org site:
http://www.raspberrypi.org/learning/reaction-game/
At one point, the game calls for us to add the sensing block “sensor value” in ScratchGPIO and, using the drop-down menu on the block, change slider to pin3. However, pin3 is not listed in the drop-down menu on the sensor block. Our drop-down looks like this:
slider
light
sound
resistance-A
resistance-B
resistance-C
resistance-D
โโโโโโ
tilt
distance
โโโโโโ
pin10
pin19
pin21
pin22
pin23
pin24
pin26
pin7
pin8
I think that pins 3 and 5 should also be listed with the other pins. After trying to re-download/install ScratchGPIO5 and still having no luck getting the pins to show up, I downloaded the GPIO testing utility from WiringPi: http://wiringpi.com
According to the pin test, the pins on the Pi are OK. Am I doing something wrong? Should this list include pins 3 and 5?
Thank you for any assistance!
I’ll check this out when I get back – things changed slightly between V4 and V5 ๐
I get a 404 message when trying to download. Has anything changed?
Sorry about that – I occidentally deleted a file but luckily Github really hels out when you do daft things like that
Try again – it should be OK now
Simon
Raspberry don’t find your file but it is in sd card. Why?
I’d need more info than that to help I’m afraid
Successfully executed first two commands. I downloaded Pthh62 to SD card on separate computer, copied to SD card root. After typing command “sudo bash /boot/install_scratchgpio5.sh” get error message “bash: /boot/install_scratchgpio5.sh: No such file on directory.” ScratchGPIO5 works with blink11, ScratchGPIO5 Plus doesn’t. Suspect copying Pthh62 to wrong place. Appreciate your thoughts.
Sorry, not used this method for a while. Can you try sudo bash /boot/ Pthh62 instead
I have successfully downloaded isgh5.sh but when I sudo bash isgh5.sh I get the following error message:
isgh5.sh: line 1: syntax error near unexpected token `newline’
isgh5.sh: line 1: `’
Is it me?? Help please!
Its not working for me – seems to be a problem with github ๐ฆ
I’ve copied it all to Dropbox – try this instead
sudo wget http://goo.gl/ikUpyJ -O isgh5.sh
Simon
I re-tried the original command sudo wget http://goo.gl/Pthh62 -O isgh5.sh later the same day and eventually it worked.
I wondered if the Pi was having a problem differentiating between backticks and apostrophes in line1.
However, as I said after redoing exactly the same command, on the same pi, a few times, eventually it worked! I put it down to the idiosyncrasies of the Pi, or you updating the code that afternoon!
We are now happily using Scratch GPIO on the RaspPi with our Year 7 and 8 pupils.
Thanks so much for your great program.
I think there was a problem at github as it’s working for me now as well ๐
Scratch GPIO6 Help Please…
Hello,
First, thank you for all the great work you’ve done making GPIO control so easy in Scratch! My kids and I have had fun building simple robots with your code.
We wanted to try adding servo motor control and downloaded GPIO6alpha to test this. We were looking forward to some robot arm waving.
The servo didn’t respond so we started simplifying our project back to simpler LED on/off control. This wouldn’t work either. When we ran the blink11.py script from the terminal, the LED would blink on and off, but when we ran blink11 in ScratchGPIO6alpha the LED stays off. If we run blink11 in Scratch GPIO5 with the same circuit connected the LED blinks as expected. The GPIO wiring connections seem to have the 3V and 5V and GND signals working properly but the programmable pins stay off even when we try to turn them all on with the GPIO6 code. With GPIO5 we can control pins, LEDs and motors fine.
I’ve tried a fresh re-install of the OS and have tried re-booting and re-downloading but always have this problem.
Appreciate any suggestions as to how I might get ScratchGPIO6 or some other form of servo control working from Scratch.
Thanks again for all your terrific work! It’s much appreciated!
Cheers,
Greg
Can you post your .sb file (or a picture of it) for me – email to simplecy@googlemail.com
Simon
I found that sudo wget http://goo.gl/Pthh62 worked better for me than removing the SD card and copying install_scratchgpio5.sh to the card. Manually copying makes it hard to put the file in the correct directory. By running wget from the boot directory everything just falls into place and you do not need to monkey around with the SD card and your PC.
If you have no internet on your Pi you need the other method ๐
Point taken. Thanks.;-)
I’m having a problem with v5, v7, and what ever version came with my pi 2. I’m learning to program and the graphical interface is much easier for me so i love the program. I made the “Robot” circuit and when i run the script the sound plays and the light blinks and then the scratch program shutsdown and i have to restart the program again to run the script again. Any ideas on how to fix it or what is going wrong?
1. New site is http://simplesi.net/
2. Its a conflict between something in the modifed Scratch that the the foundation have procured. If you install ScratchGPIO7 you’ll see desktop icon called ScratchGPIO extras. In there, you’ll find icons to call the old official Scratch version that doesn’t have a sound conflict
See http://simplesi.net/sound-problems-when-using-scratchgpio/
regards
Simon
[…] Jessie distribution of Raspberian didnt seem to see GPIO, however I used instructions found here https://cymplecy.wordpress.com/scratchgpio/scratch-raspberrypi-gpio/ to get everything up and […]
Is there a current list of available and compatible addon boards that work with raspberry pi 2b and scratch. Anything like the Adafruit 16 channel pwm servo hat? or RasPirobot3. Most of the supported boards I see listed,I cant find in the US. Thanks for the hard work.
There isn’t but that would be a good idea to have a simple list
The adafruit pwm/servo is supported