element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum GPIO on scratch
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 25 replies
  • Subscribers 707 subscribers
  • Views 3625 views
  • Users 0 members are here
  • raspberry_pi
Related

GPIO on scratch

tabarus12
tabarus12 over 13 years ago

Hi does anyone know where I can download and how to install control for GPIO on the weeze scratch?

Its so much fun to use scratch but its kinda limited to visual efect only, Id like to use it for comunication with the outside world.

  • Sign in to reply
  • Cancel
Parents
  • ntrayler
    ntrayler over 13 years ago

    A lot of useful work has been done by cymplecy (a teacher in the uk) into using Scratch on the Raspberry Pi to control the GPIO. Follow his instructions and you should be up and running fairly quickly.

     

    http://cymplecy.wordpress.com/2013/04/22/scratch-gpio-version-2-introduction-for-beginners/

     

    Make sure that you have updated to the latest version of Raspbian (sudo apt-get update; sudo apt-get upgrade) as Scratch has been patched to improve performance and to fix some annoying bugs that were present in the earlier versions.

     

    Scratch 2.0 is not particularly useful as it doesn't run on the pi (its a web based application) and it cant access the GPIO.

     

    Hope this helps.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • tabarus12
    tabarus12 over 13 years ago in reply to ntrayler

    I checked this out and I cant seem to install it it shows file or path not found or sintax error when I try the sudo /boot/install instruction like the page describes.

    Do you know how to download it correctly because the instructions on the page arent working.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • ntrayler
    ntrayler over 13 years ago in reply to tabarus12

    It looks like the first command in the instructions did not work. If had worked then there would be a file called install_scratch_gpio2.sh in the /boot/ directory, the error you are getting indicates that this file may not be there. Here are some instructions that may help

     

    First - check that your raspberry pi is able to access the internet: Open an LX Terminal window and type the command:


    ping www.google.com

     

    If this returns messages starting with the text "64 bytes from ...." then you are connected and the networking is working type Ctrl and C together to stop the ping command.

    If you do not get the message this will need to be fixed before anything else will work.

     

    still in the LX Terminal window enter the following command (all on one line):

     

    sudo wget https://dl.dropbox.com/s/oql4qzm8jlnsbeb/install_scratch_gpio2.sh -O /boot/install_scratch_gpio2.sh

     

    If this works you should 16 lines of information appearing in the LX Terminal box.

     

    Resolving dl.dropbox.com (dl.dropbox.com)... 23.23.110.193

    Connecting to dl.dropbox.com (dl.dropbox.com)|23.23.110.193|:443... connected.

    HTTP request sent, awaiting response... 302 FOUND

    Location: https://dl.dropboxusercontent.com/s/oql4qzm8jlnsbeb/install_scratch_gpio2.sh [following]

    --2013-07-03 21:00:49--  https://dl.dropboxusercontent.com/s/oql4qzm8jlnsbeb/ins                                           tall_scratch_gpio2.sh

    Resolving dl.dropboxusercontent.com (dl.dropboxusercontent.com)... 54.225.155.209

    Connecting to dl.dropboxusercontent.com (dl.dropboxusercontent.com)|54.225.155.209|:443... connected.

    HTTP request sent, awaiting response... 200 OK

    Length: 134445 (131K) [text/x-sh]

    Saving to: `/boot/install_scratch_gpio2.sh'

     

    100%[=================================================================================>] 134,445     80.7K/s   in 1.6s

     

    2013-07-03 21:01:00 (80.7 KB/s) - `/boot/install_scratch_gpio2.sh' saved [134445/134445]

     

    This confirms that the file has been downloaded from cymplecy's dropbox into your /boot/ directory.

     

    Still in the  LX Terminal window enter the command:

     

    sudo /boot/install_scratch_gpio2.sh

     

    If all is well you should see an icon called ScratchGPIO 2 appear on the desktop and you should be good to go.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • tabarus12
    tabarus12 over 13 years ago in reply to ntrayler

    So being able to enter the internet on midory does not mean that I have internet connection? because I even tried with midory to download the file and it shows the file saved but the same error and I dont see any line after entering the line you indicated.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • ntrayler
    ntrayler over 13 years ago in reply to tabarus12

    If you have managed to get the file through Midori then your networking setup is ok. I am not sure why the wget command does not work for you but in this case you can use Midori to download the file - however it will need at least one more step to allow it to be executed.

     

    By default Midori will save the file in the directory /home/pi  rather than the /boot/ directory that Simon's wget command uses as its target location. This is not a problem as long as we take it into account when trying to execute the file. What will be a problem is that the file wont have execute permissions so if you try to execute it with the command sudo /home/pi/install_scratch_gpio2.sh it will report no file found.

     

    To fix the permissions open a LS Terminal window and run the command:

     

         chmod /home/pi/install_scratch_gpio2.sh

     

    Run the command:

     

        ls -l /home/pi/install_scratch_gpio2.sh

     

    If this returns "-rwxr-xr-x 1 pi pi 134445 Jul 4 08:08 install_scratch_gpio2.sh" (ignoring differences in the date and time elements which will obviously be different for you)  then the file is present on your system and the permissions have been set to allow the file to be executed.

     

    Running the command

     

         sudo /home/pi/install_scratch_gpio2.sh

     

    should result in some text saying that the Self Extracting Installer is extracting seven files (blink11.py, blink11.sb, GPIOexample.sb, installer.sh , rsc.sb, scratchgpio2.desktop and scratch_gpio_handler2.py). It will then run the installer.sh file which wil show the Home Directory (/home/pi), User (pi) and Group (pi) and finally it will say its finished.

     

    If you see that you should also see the new ScratchGPIO 2 icon on the desktop.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • e14 Contributor
    e14 Contributor over 13 years ago in reply to ntrayler

    Hi Neil,

    I followed these steps, and still having problems.

    When execute the shortcut on the desktop appears an error, that says:

    Failed to execute child process "./simplesi_scratch_handler/scratch_gpio2.sh" (No such file or directory).

     

    Do you know what that mean?

    Thanks in advance.

    Regards,

    Marcelo

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • ntrayler
    ntrayler over 13 years ago in reply to e14 Contributor

    Hi Marcelo,

     

    That message means that the desktop shortcut cannot find  the shell script that should have been created in the directory /home/pi/simplesi_scratch_handler .

     

    In a LX Terminal window go to the directory where install_scratch_gpio2.sh is located. this will either be in /boot  if you used the wget command or in /home/pi if you downloaded the file using Midori. then run the command:

     

    sudo ./install_scratch_gpio2.sh

     

    Watch the output and check if there are any errors if there are then make a note of them and let me know.

     

    If there are none shown then try clicking again on the ScratchGPIO2 icon.

     

     

    Neil

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • e14 Contributor
    e14 Contributor over 13 years ago in reply to ntrayler

    Hi Neil,

    again failed.

    I reinstalled as you said.

    My install_scratch_gpio2.sh is at /home/pi/

    Then I tried with sudo ./install_scratch_gpio2.sh and appears this:

     

    Self Extracting Installer

     

    ./blikll.py

    ./blinkll.sb

    ./GPIOexample.sb

    ./installer.sh

    ./rsc.sb

    ./scratchgpio2.desktop

    ./scratch_gpio_handler2.py

    Running Installer

     

    Install Details:

    Home Directory: /home/pi

    User: pi

    Group: pi

     

    Finished.

     

    Then, when execute the icon on the desktop said the same.

    Failed to execute child process "./simplesi_scratch_handler/scratch_gpio2.sh" (No such file or directory).

    Thanks in advance, Marcelo.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • ntrayler
    ntrayler over 13 years ago in reply to e14 Contributor

    Hi Marcelo,

     

    Ok so the installer thinks it has completed with no errors.

     

    Is there a sub-directory called simplesi_scratch_handler in your /home/pi directory ? if it does exist, does it contain two files scratch_gpio2.sh and scratch_gpio_handler2.py ?

     

    If the two files are there then try using LX Terminal to run the scratch_gpio2.sh script directly:

     

    cd /home/pi/simplesi_scratch_handler

     

    ./scratch_gpio2.sh

     

    This should open the scratch window. If not do you get any error messages ?

     

    Neil

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • ntrayler
    ntrayler over 13 years ago in reply to e14 Contributor

    Hi Marcelo,

     

    Ok so the installer thinks it has completed with no errors.

     

    Is there a sub-directory called simplesi_scratch_handler in your /home/pi directory ? if it does exist, does it contain two files scratch_gpio2.sh and scratch_gpio_handler2.py ?

     

    If the two files are there then try using LX Terminal to run the scratch_gpio2.sh script directly:

     

    cd /home/pi/simplesi_scratch_handler

     

    ./scratch_gpio2.sh

     

    This should open the scratch window. If not do you get any error messages ?

     

    Neil

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • e14 Contributor
    e14 Contributor over 13 years ago in reply to ntrayler

    Hello Neil,

    good, now is working, and Scratch opens OK, but.........

    I looking for HELP menu, and then in ABOUT SCRATCH.

    What about that?? Why appear as Scratch 1.4??

    image

     

    Thanks,

    Marcelo

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • e14 Contributor
    e14 Contributor over 13 years ago in reply to e14 Contributor

    Why appear as Scratch 1.4?

     

    Version 1.4 is correct.  The next version is 2.0, which is available to use online,

    rather than as a download.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • ntrayler
    ntrayler over 13 years ago in reply to e14 Contributor

    Hi Marcelo,

     

    I am glad it is now working for you.

     

    As coder27 said scratch 1.4 is the current version for the non web based version. Version 2.0

     

    This is the second version of Simon's (Cymplesy) scratch GPIO handler hence the scratch_gpio2.sh. filename. For tutorials etc see http://cymplecy.wordpress.com/2013/04/22/scratch-gpio-version-2-introduction-for-beginners/

     

    Have fun.

     

    Neil

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube