GoGo Board Socket Server Protocol

Embed Size (px)

Citation preview

  • 8/11/2019 GoGo Board Socket Server Protocol

    1/4

    GoGo Board Socket Server ProtocolVersion 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 'oans are te*t+%ase. ou 'an e*perient "ith the 'oans %y

    'onne'ting to the ser#er #ia a terinal eulator (-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 /$ an / !or the sensor streaing ser#i'e.

    &he 'oans sent to the so'ket ser#er "ill ha#e the sae e!!e't on the oo Monitor as

    "hen ire'tly anipulating the 34. or e*aple, 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 'oans are ignore. 6oans are 78& 'ase sensiti#e.

    &he oo %oar ust %e 'onne'te to the oo onitor other"ise the 'oans "ill

    return an error.

    The Commands

    All 'oans are eliite %y a sei'olon (9:;). Multiple 'oans 'an %e sent as long as they are

    properly eliite. A eliiter is optional !or the last 'oan 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 !orat

    command=status;

    commandis the 'oan %eing e*e'ute. Statusis typi'ally 9ok; unless the 'oan is

    unre'ogni?e or returns a #alue. &he response al"ays ens "ith a sei'olon. @ere are soe

    e*aples

    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;

  • 8/11/2019 GoGo Board Socket Server Protocol

    2/4

    &he !ollo"ing ta%le es'ri%es the a#aila%le 'oans an their responses

    close Ends the socket connection with the GoGo server.

    Response

    close=ok;setcom number Sets the serial port number

    Responsesetcom number=ok;

    Connect Connects the GoGo monitor to the GoGo Board

    ResponseConnect=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.

    ResponseTalktoport 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 .

    ResponseSetpower number=ok;

    +f number is invalidSetpower number= GoGo Monitor Error: power out of

    range;On, off, break,

    coast,hese four commands control the on-off state of the selected motors.

    Onturns the motor(s) on

    Breakturns off the motor(s) and applies a resistancepreventin* the motors to turn.

    Coastturns off the motors with our resistance

    Offturns off and applies a resistance for a short time then

    coasts.

    ResponsCommand=ok;

    Thisway,thatway,rd ,hese three commands determine which wa/ the motor(s) will turn.RD stands for 0reverse direction1.

    ResponseCommand=ok;

  • 8/11/2019 GoGo Board Socket Server Protocol

    3/4

    Beep ,ells the GoGo Board to beep once

    ResponseBeep=ok;

    Ledon, ledoff ,ells the GoGo Board to turn on and off the built-in user 2ED

    respectivel/.

    ResponseCommand=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.

    ResponseCommand=ok;

    sensorN Returns the sensor number '4s value. #here ' is between 5 and 6. or

    e!ample"

    Sensor1

    Sensor1=1023;

    Responsesensor=Value;

    7alue is -5 if burst mode is not turned on

    The Streaming Server

    8n'e a 'onne'tion is esta%lishe "ith the streaing ser#er, "hi'h is part o! the oo Monitorso!t"are, the ser#er "ill ieiately start steaing the sensor ata to the 'lient. &he !orat o! a

    sensor #alue pa'ket is as !ollo"s. &he #alues are pa'ke insie suare %ra'kets. =a'h #alue is

    eliite %y a 'oa.

    Csensor1,sensor2,sensor$,sensor,sensor5,sensorD,sensor,sensorE

    =a'h sensor #alue rages %et"een 0 an 102$. 4! the %urst+oe on the oo Monitor is not turne

    on, the sensor #alues "ill %e %lank.

  • 8/11/2019 GoGo Board Socket Server Protocol

    4/4

    Change Log

    1.0.1F July 25, 2011

    Ae o'uentation !or the sensor streaing ser#er