scratchClient Download


scratchClient is software especially for raspberryPi which allows scratch 1.4  or scratch 2 to use hardware on the pi.
scratchClient is written in python, so no compiling step is needed.

Installation and usage instructions are in the documentation.
Samples are in the code distribution.

Download code distribution:

Documentation is included in the download. Here are direct links:
scratchClient documents (pdf)
scratchClient documents (html)

Quick install procedure. Please note the quite long line in the script. Be sure to copy till the end of line.
python3 is recommended to run scratchClient.
python2 should not be used.

cd ~
wget -O scratchClient.tar.gz
tar xzf scratchClient.tar.gz
chmod +r -R scratchClient/
sudo apt-get update
sudo apt-get install python-pip  python-dev  python-smbus 
sudo apt-get install python3-pip python3-dev python3-smbus 
sudo pip  install tornado mako==1.0.6 spidev pyserial intelhex
sudo pip3 install tornado mako==1.0.6 spidev pyserial intelhex

Incompatibility Issue:
With the newest tornado versions 5.0.x, there is an incompatibility with older scratchClient releases.
The problem is: scratchClient is working with scratch 1.4, but data from scratchClient to scratch2 are not transferred.
How to find out if you are affected: Please check scratchClient version and tornado version

python3 src/ -version
pip3 freeze | grep tornado

 If you have tornado 5.0.x and scratchClient before 2018-04-02, then either update scratchClient to latest (be sure to make a backup copy of your configurations) or downgrade tornado to 4.5.3.

sudo pip3 uninstall tornado
sudo pip3 install tornado==4.5.3


Change history:

2018-11-19  added MPR121 device.
2018-11-19  removed perpetual scratch 1.4 connection reminder.
2018-11-19  bugfix value conversion scratch2 int values and other fixes for value conversions.
2018-11-15  added gps adapter for GY_GPS6MV2 provided by SFYRAKIS.
2018-11-15  favicon 404 error corrected.
2018-11-14  Logging config file can be defined on command line. Add NotificationHandler class.
2018-11-11  Value conversion error for servo, pwm in arduino adapter fixed.
2018-11-10   web application start/stop restructure to handle tornado 5.x better.
2018-11-01W1_DS1820: slight changes in log messages.
2018-04-02   added compatibility support for tornado release 5
2018-02-25   changed scratch2 extension loader; changed some conversions in arduino_uno script
2018-02-18   bugfix in javascript for adapter display.
2018-02-17   config for config_camjam_edukit added (experimental, could not test
2018-02-16  config tool arduinoUNO, do not allow ”undef” as a name; scratch2Extension, special handling of ”undef” events or names
2018-02-13    config tool for arduinoUno: remember command line file for save operation. Changed scratch2 extension to name-value pairs
2018-02-11    various experiments with scratch2 extension
2018-02-05    bugfix in scratchClientServer: scratch2 connection used orphaned dictionary which stored the name->id-relation, but was never checked for existing names
2018-02-04  added scratch2 extension installer: scratchClient/tools/scratch2connection/
2018-01-28   scratch2 connection: made js-code labels independent from variable names.
2018-01-28   arduino uno sketch: Bugfix 0xff eeprom code
2018-01-26   Bugfix: python3 bytes, bytebuffer handling corrected.
2018-01-25  Bugfix: python2->3 incompatibility in arduino UNO adapter in combination with older arduino firmware.
2018-01-24  Bugfix: python2->3 incompatibility in arduino UNO adapter solved.
2018-01-22  Bugfix: version date now automatically matches first entry in changes.
2018-01-07  Documentation, added adapter.gpio.GpioMotorPWM to configuration of adapters.
2017-12-21 Bugfix: wedo adapter, Enrico Gallo reported bugs in setting tilt sensor.
2017-11-19 Bugfix: corrected error message in stepper module.
2017-10-17 dht11 based on pigpiod.
2017-10-11 pwm adapter using pigpiod.
2017-10-10 Bugfix in socket singleton again; dma_pwm bug fixes when values overflow.
2017-10-09 Bugfix in socket singleton; python3 compatibility in various modules
2017-10-08 the with-loglevel does not work; workaround increase log level on “connected” to warning
2017-07-17 bugfix HCSR04-adapter; renamed class adapter.pigpiod.HC_SR04_Adapter to adapter.pigpiodAdapter.HC_SR04_Adapter
2017-07-08 add CAP1208, add ExplorerHatPro config
2017-07-01 add description of scratch2/raspbian to web docu. Add hotkeys for java arduinoUNO config tool.
2017-06-29 add configuser dir to search path in -c option
2017-06-20 arduinoUNO arduino program: handles unitialized eeprom as empty
2017-06-17 bugfix scratchClientConfig, counter-pullup not handled correctly
2017-06-17 bugfix scratchClientConfig, baud rate not set, a6,a7 analog in not generated xml
2017-06-16 gpio, pwm servo, corrected rate calculation
2017-06-15 scratch 1.4 usage hints for web page
2017-06-15 arduinoUNO adapter, ident handling added
2017-06-13 bug fixes in error messages for gpio handling in config
2017-06-10 pi2go config and adapters ADC_DAC_PCF8591 and Gpio_HCSR04_OnePin_Input
2017-05-27 lirc IR receive adapter.
2017-04-21 sonic pi adapter added
2017-04-06 mqtt-adapter with optional username, password
2017-03-19 Minecraft-Adapter for pi, based on mcpi-library
2017-03-13 added SCROLL PHAT HD-Adapter and sample scratch script
2017-03-13 added MICRO DOT PHAT-Adapter
2017-03-04 added mqtt-adapter.
2017-02-27 arduino.ino, added counter function, changes in config tool.
2017-02-14 singleton-ipc, added; added command line switch to select singleton logic
2017-02-13 singleton-pid, redesign, changes in shutdown logic
2017-02-12 UNO_Adapter, reconnect logic reworked; arduinoUno with added “disconnect”-command
2017-02-10 config tool to edit UNO_Adapter xml config files included.
2016-12-19 arduino nano used as neopixel driver
2016-12-01 pico2wave tts adapter2016-10-30 bugfix adapter.arduino.UNO_Adapter (usage of analog pins on arduino for digital io)
2016-09-26 optional parameters for servo adapter DMA_PWMServo
2016-08-19 added hc-sr04 sensor based on pigpiod
2016-08-14 added lego wedo2 adapter
2016-07-31 added openweathermap-api access
2016-06-05 added config file config_AT42QT1070
2016-05-30 Adapter GpioButtonInput is deprecated, use GpioEventInput instead
2016-05-28 fixed bug in GpioEventInput (inverse did not work)
2016-05-22 DS1820-Adapter, added error messages
2016-05-21 UNO_Adapter, for posix systems: added an exclusive lock to serial connection
2016-04-17 removed a flaw in accessing files.
2016-03-28 added twitter adapter.
2016-03-25 added arduino adapter for LEGO powerfunctions.
2016-03-19 added support for external speech recognition adapter.linux.Linux_ASR_Adapter.
2016-03-07 added aplay and arecord command adapter.
2016-02-29 bugfix RPIO2 library: pwm to zero did not reliably switch off when fullscale to zero.
2016-02-28 ident code for arduino sketch.
2016-02-21 performance optimizations in arduinoUNO adapter and arduino sketch.
2016-02-15 added servo capability for arduinoUNO-adapter, reworked reconnect policy for this adapter.
2016-01-02 dma based PWM added, gpioLib-switch removed.
2015-12-09 bug fixes in pwm-servo; value range checks added.
2015-11-16 pianoHat Adapter added.
2015-11-16 bugfix in GpioInput-Adapter.
2015-11-12 added blink(1)
2015-09-26 added senseHat-adapter LED, environmental, IMU
2015-08-03 RFID-Reader adapter added
2015-08-01 pico board adapter added
2015-07-17 GpioValueInput-Adapter added. Allows to send predefined values on low/high
2015-07-14 MCP3008
2015-07-09 error recovery strategy for scratch 1.4
2015-jan-15, issue#136
2015-05-25 added arduinoUNO adapter.
2015-05-23 system time adapter added
2015-05-18 added technical documentation for adapters.
2015-05-05 piFace support, piGlow support
2015-05-03 solved display issues in GUI for multiple scratch variables into one adapter method; added PCA9865; removed bugs in MCP23S17. Refactoring the i2c-system.
2015-04-19 removed bug in positioning popup editor in adapter display
2015-04-11 added DHT22 with atmega328-coprocessor; added smartphone positional sensors
2015-03-28 added atmel-328 adapter for hc-sr04
2015-03-16 added operation system command adapter
2015-03-16 added half-bridge motor adapter
2015-03-14 added MCP23S17-adapter (piface)
2015-03-01 usb barcode scanner added.
2015-02-12 ‘servoblaster’ adapter added.
2015-01-04 removed quote-handling-problem in broadcast name strings.
2014-12-22 added a lookup strategy for config files which allows for simpler command line syntax.
2014-12-17 namevalueparser, corrected for quote in name.
2014-12-13 worked on python3 compatibility; changed package structure.(adapter.adapter->adapter.adapters); fixed codepage conversion problems in web access.
2014-11-14 Added DS1820 adapter.
2014-10-17 Modified help output.
2014-10-03 modified socket code, outgoing to better handle utf8 strings; modified test adapter with different data types.’
2014-09-20 changed dma channel to 4
2014-09-01 Added BH1750 Luminosity Sensor, i2c bus
2014-08-29 GpioInput, fixed “inverse”-Problem.
2014-08-08 texttospeech, fixed an exception problem.
2014-08-03 renamed ADCInput to ADC_MCP3202_10_Input.
2014-08-01 bug fix for activation of adapters.
2014-07-30 renamed adapter.stepper.Stepper to adapter.stepper.BipolarStepper\
added adapter.stepper.UnipolarStepper
2014-07-26 added \’changes\’ command line switch.
2014-07-26 added SIM800 GSM Modem support.
2014-07-12 added GpioStateOutput-Adapter. Allows for connection status monitoring.
2014-06-19 performance improvements.
2014-06-13 added performance test adapter. Refined error handling for configuration.
2014-05-30 corrected handshake in atmel-328-irc-adapter for atmel-328-firmware.
2014-03-31 fixed config file config_ikg_7segment.xml; added error checks in reading xml files.
2014-03-12 changed data receive logic/process dataraw to be more robust. Instantiation the   managers on need only.
2014-03-11 changed data receive logic to work even for very long records.
2014-02-23 added I2C ADS1015
2014-02-08 dial plate adapter added.
2014-02-03 enable one broadcast/value for multiple adapters like ‘stopAll’
2014-01-24 fixed a conversion error from adapter to framework (now always strings)
2014-01-06 added WS2801-Adapter, some bug fixes in SPI handling
2013-12-26 added remote connection adapter
2013-12-01 configuration file for portMapping in xml
2013-11-16 added sighup in order to catch terminal closed.
2013-11-16 added code to enforce a singleton running instance


Firmware for atmel-328 is needed when programming an separate atmel 328-microcontroller as an adc-device, frequency measurement and more.

documentation english, documentation german
download scripts for adc, timer, ‘steckbrett’.

2014-06-07 modified interrupt handling for TIMED_COUNTER mode
2014-05-30 corrected handshake for ir receive module.

documentation for hc-sr04 ‘ultrasonic’
download scripts for hc-sr04 ‘ultrasonic’.

2015-03-28 initial upload.

documentation for DHT22
download scripts for DHT22, temperature, humidity.

2015-04-11 initial upload.


I have closed the comment function  for this page (thank you spammers). If you have questions about the software, please write me an email. Sorry.

Or raise topics in, forum, scratch.