System Commands affect the way in which data is transmitted/received or act upon the ScratchLink Firmware or ScratchLink Controller System.


Command Syntax:


Purpose:  resets all devices to their default state.


Command Syntax:


Purpose:  reboots i.e. power cycle restart the ScratchLink Controller which is the same as physically unplugging the power.  Note that communication connection will be lost and will need to be established again.

Smart Streaming

By default (ie unless change) the streaming command will return values only if there is a sufficient change ie ‘smart’ streaming.

This is turned on and off by

stream config smart on|off;

It will automatically turn on at boot-up.

The ultrasonic and proximity sensors min change value can be set via commands, and is seen in their config data. ie
ultra config smart 50;
proximity config smart 6;

would result in –


Only changes great than the smart value will result in a packet coming back.

For everything else the smart limit (change) is hard coded –
analog group >2
battery voltage >.1
battery current >.1
rfid != last card.
Wii button press changed, or joystick changed by >2
wheels distance or light sensor changed >5.


Command Syntax:


Purpose: Read current sensor values from ScratchLink Controller and return values.  “read” returns one set of values and is not a “stream” which is continuous.


Command Syntax:


Command generates a “pong” response in the form:

{pong:time in ms}
eg. {pong:10}

Purpose: generates a response “pong” packet indicating the time since the last “ping” command. You can use this to see how fast, and at what intervals, packets are getting to the robot, over any of the connection mechanisms. You do this by calling it multiple times. For example:

for (i=0;i<50;++i) { await sleep(5); socket.send('ping;'); }

Example output: shows that it was about 177 seconds since the last “ping” command and thereafter 4ms and 1ms…