the last month I worked on connecting scratch2, the web based scratch version from scratch.mit.edu and GPIO on raspberry and more.
To be precise, this is done by scratch extensions using http://scratchx.org/#scratchx. This is 'the same' as scratch2, but allows to use extensions. These extensions can provide an interface to scratchClient. And scratchClient can connect to GPIO as usual.
The extension blocks in scratchX are defined using the definitions from the config.xml file from scratchClient. This is working stable now.
Current implementation allows to send/receive broadcasts and to send/receive variables.
scratchX does not need to run on same computer as scratchClient. For example when using the pi2go adapter the scratchX can run on a laptop and scratchClient on the robot.
During this work, the internal web app was reworked and uses now tornado framework. Which has build in websocket support and is easier to use as cherrypy. As scratchX is online only, the connection to a local data provider needs to bypass the 'same server policy' and this was quite simple to achieve with tornado. Python3 is the suggested platform to run scratchClient now.
scratchClient is still working with scratch1.4, the program accepts connections from either scratchX or scratch1.4. Existing config files or adapters do not need to be changed. Monitoring and simulation of events is still possible by using the internal web server.
The current code was tested with the pi2go-configuration provided recently. Communication is now stable and allows reconnect. Execution in scratchX gets slow when browser is in background. Not very good if you automatically control a robot.
A release is available, see http://heppg.de/ikg/wordpress/?p=984. Especially shutdown with ctrl-c is working now. If there are still problems then kill the app from another window. In case of problems, close the browser (tab) and reload scratch2 application.
The provided adapters are same as in the previous scratch1.4 scratchClient.
The previous scratchClient 1.4 and the new scratchClient will be available in parallel till end of july, then both versions will be merged.
Next step is to validate the new scratchClient with the now available scratch2 in raspbian.