This document describes the GoGo Board Socket Server protocol version 1.0.1, including general guidelines, available commands, responses, and a streaming sensor server. The commands allow controlling motors, reading sensors, and other functions of a GoGo Board via networked socket connections. Responses are always in the format "command=status;" to indicate if the command was recognized and completed successfully. A streaming server continuously sends sensor data values within square brackets, comma-delimited.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
69 views4 pages
GoGo Board Socket Server Protocol
This document describes the GoGo Board Socket Server protocol version 1.0.1, including general guidelines, available commands, responses, and a streaming sensor server. The commands allow controlling motors, reading sensors, and other functions of a GoGo Board via networked socket connections. Responses are always in the format "command=status;" to indicate if the command was recognized and completed successfully. A streaming server continuously sends sensor data values within square brackets, comma-delimited.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4
GoGo Board Socket Server Protocol
Version 1.0.1 July 25, 2011
By Arnan (Roger) Sipitakiat
General Guidelines
Make sure to use the oo Monitor so!t"are #ersion $.5.0 or %etter. &he so'kets 'o((an)s are te*t+%ase). ,ou 'an e*peri(ent "ith the 'o((an)s %y 'onne'ting to the ser#er #ia a ter(inal e(ulator (-u&&, is a goo) !ree pa'kage). Make sure the 'onne'tion type is RA.. &hat is, all the so'ket )ata %eing sent or re'ei#e) shoul) %e seen )ire'tly %y the user. &he )e!ault port !or so'ket ser#er is /01$ an) /012 !or the sensor strea(ing ser#i'e. &he 'o((an)s sent to the so'ket ser#er "ill ha#e the sa(e e!!e't on the oo Monitor as "hen )ire'tly (anipulating the 34. 5or e*a(ple, sele'te) (otor ports "ill ha#e their 'he'k %o*es 'he'ke). .hite spa'es an) ne" line 'hara'ters %e!ore an) a!ter the 'o((an)s are ignore). 6o((an)s are 78& 'ase sensiti#e. &he oo %oar) (ust %e 'onne'te) to the oo (onitor other"ise the 'o((an)s "ill return an error.
The Commands
All 'o((an)s are )eli(ite) %y a se(i'olon (9:;). Multiple 'o((an)s 'an %e sent as long as they are properly )eli(ite). A )eli(iter is optional !or the last 'o((an) sent.
beep;ledon
&he a%o#e "ill tell the oo Boar) to %eep an) then turn on the user <=>.
&he response is al"ays in the !ollo"ing !or(at
command=status;
command is the 'o((an) %eing e*e'ute). Status is typi'ally 9ok; unless the 'o((an) is unre'ogni?e) or returns a #alue. &he response al"ays en)s "ith a se(i'olon. @ere are so(e e*a(plesA
beep; beep=ok;
foo foo=GoGo Monitor Error: Unrecognized command;
sensor1 sensor1=1023;
beep;ledon beep=ok;ledon=ok;
beep; beep=GoGo Monitor Error: GoGo board not connected;
&he !ollo"ing ta%le )es'ri%es the a#aila%le 'o((an)s an) their responses
close Ends the socket connection with the GoGo server.
Response close=ok; setcom number Sets the serial port number
Response setcom number=ok; Connect Connects the GoGo monitor to the GoGo Board
Response Connect=ok; Disconnect Disconnects the GoGo monitor from the GoGo Board
Response Disconnect=ok; Talktoport abcd Selects motor port(s) to work with. or e!ample"
talktoport ab
#ill make the motor ports $ and B selected. %ou will see the checkbo!es selected on the GoGo &onitor software.
Response Talktoport abcd=ok; Setpower number Sets the power level of the selected motor ports. 'umber must be between ( and ) otherwise an error messa*e will be sent.
Setpower 7
Sets the power level of the selected motor ports to ).
Response Setpower number=ok; +f number is invalid Setpower number= GoGo Monitor Error: power out of range; On, off, break, coast ,hese four commands control the on-off state of the selected motors. On.turns the motor(s) on Break.turns off the motor(s) and applies a resistance preventin* the motors to turn. Coast.turns off the motors with our resistance Off.turns off and applies a resistance for a short time then coasts.
Respons Command=ok; Thisway,thatway,rd ,hese three commands determine which wa/ the motor(s) will turn. RD stands for 0reverse direction1.
Response Command=ok;
Beep ,ells the GoGo Board to beep once
Response Beep=ok; Ledon, ledoff ,ells the GoGo Board to turn on and off the built-in user 2ED respectivel/.
Response Command=ok; Burston, burstoff ,urns on or off sensor readin*s. #hen on3 the GoGo Board will continuousl/ stream sensor data to the GoGo &onitor. Burst mode must be on for the sensor streamin* server to work.
Response Command=ok; sensorN Returns the sensor number '4s value. #here ' is between 5 and 6. or e!ample"
Sensor1 Sensor1=1023;
Response sensor=Value;
7alue is -5 if burst mode is not turned on
The Streaming Server
8n'e a 'onne'tion is esta%lishe) "ith the strea(ing ser#er, "hi'h is part o! the oo Monitor so!t"are, the ser#er "ill i((e)iately start stea(ing the sensor )ata to the 'lient. &he !or(at o! a sensor #alue pa'ket is as !ollo"s. &he #alues are pa'ke) insi)e sBuare %ra'kets. =a'h #alue is )eli(ite) %y a 'o((a.