Skip to content
JamesNewton edited this page Mar 12, 2020 · 12 revisions

The scratch programming language is a popular option to teach programming with a visual, block, based user interface.
https://scratch.mit.edu/

A Scratch extension has been developed to allow Dexter to be controlled with simple blocks.
https://github.com/Kenny2github/scratch-dexter
https://www.facebook.com/steamaker/videos/577470826025034/

If your Dexter image has scratch, you should be able to hit Dexters IP address and then click on "scratch" to use it. If you see the web page there and get a 404 when continuing on to /scratch, then you may need to follow the directions here:
https://github.com/HaddingtonDynamics/Dexter/issues/55#issuecomment-519360374

In general: To setup communications between Dexter and your browser, a Node.JS proxy between websockets and Dexter's raw socket interface is required. Node.js and a proxy is available on the current image, but since it is running from Dexters IP address, the browser will see it as a cross site scripting security vulnerability and refuse to work. Running a Node.JS proxy on localhost, however, is allowed. To set that up:

  • nodejs installed on your local machine
    https://nodejs.org/en/download/
    On Ubuntu, use:
    sudo apt-get install curl python-software-properties
    curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
  • npm installed on your local machine. It should be installed with node.js but if you need to install it separately you can.
  • Make a folder, and at the command prompt, npm init it and install ws. You can just take the defaults for most question during the init. You can change the entry point to 'httpd.js' and point the repo at kenny's link above or just ignore the repo warnings.
mkdir dexproxy
cd dexproxy
npm init
npm install ws

Once you have all that setup,

  • nodejs httpd.js dexter_ip where dexter_ip is the IP address of the dexter robot.

For Scratch 2 (FLASH based)

For Scratch 3 (HTML5 based)

Examples

Clone this wiki locally