Chapter 5. Summary

5.1. Comparison gpioserver, scratchClient

CPU usage

gpioserver uses 'pigpio'-server since 2016-05. This is started when scratch is launched.

Use 'top' to see the cpu usage in a terminal window.

On a PI-B, pigpiod needs prox. 10% CPU.

On a PI-B, scratchClient needs prox. 5% CPU.

Speed

Simple commands are executed faster by gpioserver.

A detailed analysis is in scratch io response times .

gpioserver responds prox four times faster to button presses than scratchClient.

On the other side, scratchClient provides complex adapters with ready to use solutions like an 'edge detector'.

Another example is controlling stepper motors. Using basic GPIO control from scratch, this is really slow. With the scratchClient stepper control adapter, the speed is 40 times larger. gpioServer and scratchClient performance comparison for stepper driving signals

Robustness, simple usage scenario

There are some tricky problems with gpioserver. The server 'remembers' the commands received, so the visible code is not necessarly the current config in the system. This makes trouble shooting in student setups complicated. It is needed to restart scratch to get reproduceable results.
At the moment (2016-05), gpioserver changes IO behavior when an input is addressed as an output. This could result in hardware damage.

Preconfigured setups for scratchClient allow to focus on programming skills and eliminate trouble sources.

scratchClient allows to see current config with the web interface; this interface also allow to debug student setups.

Expandability

Scratch and gpioserver are written in smalltalk. Nowadays, this language is not very popular. Modifications and extensions are done by raspberry pi foundation and Tim Rowledge, but resources are limited.

scratchClient is written in python and there exists some documentation. Python is quite popular, and extensions should be done quite easily.