Using Scratch controlling Raspberry Pi GPIO Remotely

This information is largely superceded by the SID post http://cymplecy.wordpress.com/2013/08/03/use-your-raspberry-pi-as-a-wi-fi-scratch-interface-device/ but is still useful for experimentation

One thing that I’d completely forgotten about is that the Scratch GPIO handler program can be run with a parameter of an LAN IP address.

What this means is that you can run Scratch on your desktop of your PC/Mac/Linux machine or even another Raspberry Pi and write you code on that and get it to control the GPIO pins on your Raspberry PI remotely.

These instructions are not for beginners

basicaly

run a LX terminal session on your RPi

sudo python simplesi_scratch_handler/scratch_gpio_handler2.py 192.168.1.73

(replace 192.168.1.73 with your main computer IP address)

Your Pi will then listen for broadcasts from your main computer and you can simply run Scratch on yoru main computer, enable Remote Sensor Connections and then your Pi will pick up any broadcasts/variable changes that you make on your main computer

About these ads

One thought on “Using Scratch controlling Raspberry Pi GPIO Remotely

  1. When I run the command I get this error:

    from: can't read /var/mail/array
    simplesi_scratch_handler/scratch_gpio_handler2.py: 9: simplesi_scratch_handler/scratch_gpio_handler2.py: import: not found
    simplesi_scratch_handler/scratch_gpio_handler2.py: 10: simplesi_scratch_handler/scratch_gpio_handler2.py: import: not found
    simplesi_scratch_handler/scratch_gpio_handler2.py: 11: simplesi_scratch_handler/scratch_gpio_handler2.py: import: not found
    simplesi_scratch_handler/scratch_gpio_handler2.py: 12: simplesi_scratch_handler/scratch_gpio_handler2.py: import: not found
    simplesi_scratch_handler/scratch_gpio_handler2.py: 13: simplesi_scratch_handler/scratch_gpio_handler2.py: import: not found
    simplesi_scratch_handler/scratch_gpio_handler2.py: 14: simplesi_scratch_handler/scratch_gpio_handler2.py: import: not found
    simplesi_scratch_handler/scratch_gpio_handler2.py: 16: simplesi_scratch_handler/scratch_gpio_handler2.py: import: not found
    simplesi_scratch_handler/scratch_gpio_handler2.py: 17: simplesi_scratch_handler/scratch_gpio_handler2.py: Syntax error: word unexpected (expecting ")")
    

    It’s mind boggling.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s