[Firebug-cvs] firebug/web gps_driver.html,1.4,1.5
Brought to you by:
doolin
From: <cs...@us...> - 2003-06-09 17:45:49
|
Update of /cvsroot/firebug/firebug/web In directory sc8-pr-cvs1:/tmp/cvs-serv2212 Modified Files: gps_driver.html Log Message: added topo links to gps_driver Index: gps_driver.html =================================================================== RCS file: /cvsroot/firebug/firebug/web/gps_driver.html,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** gps_driver.html 23 May 2003 15:15:21 -0000 1.4 --- gps_driver.html 9 Jun 2003 17:45:46 -0000 1.5 *************** *** 13,64 **** </head> ! ! ! <body> <h1>FireBug --- GPS Driver</h1> ! <p> FireBug uses the <tt>gps</tt> driver to interface with a GPS ! receiver and handle location information. </p> <h2>Introduction</h2> ! <p> The current driver implements standard NMEA protocol to interact ! with an AXIOM GPS receiver. Running <tt>gpsM.nc</tt> on the client ! mote initializes the receiver for GPS Fix Data (GGA) reception. Incoming ! GGA data is checked by the client for validity, parsed, and then stored ! in its EEPROM flash memory. </p> <h2>How <tt>gps</tt> works</h2> ! <p> GPS receivers provide location and time information in a variety ! of data formats. At initialization, the client's UART is set to ! the same baud rate as the GPS receiver. Next, <tt>clearGPS()</tt> is ! called, which commands the receiver to block all output. The receiver ! requires several seconds before it can start processing NMEA commands ! following power on. For this reason, the first command in <tt>clearGPS()</tt> ! is sent 100 times until the receiver has warmed up.</p> ! <p>For this application, a single GGA message is required. To acquire this, ! <tt>getGPS()</tt> is called, which requests GGA data at 1 Hz. The ! number of satellites used in constructing each GGA message is then determined. ! When this number exceeds three, the corresponding message is parsed ! and stored in the client's EEPROM.</p> ! <p> Values stored in the client's memory can the be retrieved and broadcasted ! over the radio at any time with <tt>GenericBase</tt>. Instructions ! on this are given at the end of this guide. </p> <h2>Sending Commands to the Receiver</h2> <p> Communication between the client and receiver is handled by <tt> ! gpsM.nc</tt>. After the client's second UART (UART1) is ! set to 4800 baud, NMEA commands may be sent to the gps receiver. For ! SiRF chips, these generally have the form:</p> <center> <p>$PSRF,103,<b>Message type</b>,00,<b>Rate</b>,01,*<b>Checksum</b></p> </center> ! <p>followed by a carriage return ('\r') and linefeed ('\n'). There are six ! message types: </p> <center> <p>GGA=00, GLL=01, GSA=02, GSV=03, RMC=04, VTG=05</p> </center> ! <p> To block output of a certain message type, set Rate = 00. Rate = 01 ! corresponds to a 1 Hz output. Finally, the checksum is computed by performing ! an XOR on all characters, including the comma delimiters, between $ and *. ! Each character of the above string is contained as an element in the array ! <tt> cmd_msg</tt>, which is used throughout <tt>gpsM.nc</tt>. By changing ! array entries, different commands can be sent to the receiver, as shown ! below:</p> <center> <table class="code"> --- 13,63 ---- </head> ! <body> <h1>FireBug --- GPS Driver</h1> ! <p> FireBug uses the <tt>gps</tt> driver to interface with a GPS receiver ! and handle location information. </p> <h2>Introduction</h2> ! <p> The current driver implements standard NMEA protocol to interact ! with an AXIOM GPS receiver. Running <tt>gpsM.nc</tt> on the ! client mote initializes the receiver for GPS Fix Data (GGA) reception. ! Incoming GGA data is checked by the client for validity, parsed, ! and then stored in its EEPROM flash memory. </p> <h2>How <tt>gps</tt> works</h2> ! <p> GPS receivers provide location and time information in a variety ! of data formats. At initialization, the client's UART is set ! to the same baud rate as the GPS receiver. Next, <tt>clearGPS()</tt> ! is called, which commands the receiver to block all output. ! The receiver requires several seconds before it can start processing ! NMEA commands following power on. For this reason, the first command ! in <tt>clearGPS()</tt> is sent 100 times until the receiver has ! warmed up.</p> ! <p>For this application, a single GGA message is required. To acquire this, ! <tt>getGPS()</tt> is called, which requests GGA data at 1 Hz. ! The number of satellites used in constructing each GGA message ! is then determined. When this number exceeds three, the corresponding ! message is parsed and stored in the client's EEPROM.</p> ! <p> Values stored in the client's memory can the be retrieved and broadcasted ! over the radio at any time with <tt>GenericBase</tt>. Instructions ! on this are given at the end of this guide. </p> <h2>Sending Commands to the Receiver</h2> <p> Communication between the client and receiver is handled by <tt> ! gpsM.nc</tt>. After the client's second UART ! (UART1) is set to 4800 baud, NMEA commands may be sent to the gps ! receiver. For SiRF chips, these generally have the form:</p> <center> <p>$PSRF,103,<b>Message type</b>,00,<b>Rate</b>,01,*<b>Checksum</b></p> </center> ! <p>followed by a carriage return ('\r') and linefeed ('\n'). There are six ! message types: </p> <center> <p>GGA=00, GLL=01, GSA=02, GSV=03, RMC=04, VTG=05</p> </center> ! <p> To block output of a certain message type, set Rate = 00. Rate = 01 corresponds ! to a 1 Hz output. Finally, the checksum is computed by performing an XOR ! on all characters, including the comma delimiters, between $ and *. Each ! character of the above string is contained as an element in the array <tt> ! cmd_msg</tt>, which is used throughout <tt>gpsM.nc</tt>. By changing ! array entries, different commands can be sent to the receiver, as shown ! below:</p> <center> <table class="code"> *************** *** 73,92 **** </center> <p>Here, the command outb(UDR1,cmd_msg[i]) sends the byte at entry <i>i</i> ! of <tt>cmd_msg</tt> out to UART1. </p> <h2>Receiving Data from GPS Module</h2> ! <p>Data enters into the client from the receiver via UART1. Messages from ! the receiver are collected byte by byte with the command <tt>inp(UDR1)</tt> ! and temporarily stored in an array, <tt>rxBuffer</tt>. Data is ! collected only after the GGA start sequence, <tt>$GPGGA</tt>, is completed. ! Collection stops when the * delimiter is reached, after which point, ! the 40th and 41st entries of the buffer are combined to determine the number ! of satellites, i.e.</p> <center> <p>num_satellites = 10*(rxBuffer[40] - '0') + (rxBuffer[41] - '0');</p> </center> ! <p>If <tt>num_satellite</tt> < 4, <tt>rxBuffer</tt> is cleared and the ! client waits again for the GGA start sequence to pass in the subsequent ! message until it resumes data collection. Otherwise, the data stored in ! the buffer is parsed and stored in EEPRROM using <tt>logGPS</tt>.</p> <center> <table class="code"> --- 72,92 ---- </center> <p>Here, the command outb(UDR1,cmd_msg[i]) sends the byte at entry <i>i</i> ! of <tt>cmd_msg</tt> out to UART1. </p> <h2>Receiving Data from GPS Module</h2> ! <p>Data enters into the client from the receiver via UART1. Messages from ! the receiver are collected byte by byte with the command <tt>inp(UDR1)</tt> ! and temporarily stored in an array, <tt>rxBuffer</tt>. ! Data is collected only after the GGA start sequence, <tt>$GPGGA</tt> ! , is completed. Collection stops when the * delimiter is reached, ! after which point, the 40th and 41st entries of the buffer are combined ! to determine the number of satellites, i.e.</p> <center> <p>num_satellites = 10*(rxBuffer[40] - '0') + (rxBuffer[41] - '0');</p> </center> ! <p>If <tt>num_satellite</tt> < 4, <tt>rxBuffer</tt> is cleared and the ! client waits again for the GGA start sequence to pass in the subsequent ! message until it resumes data collection. Otherwise, the data stored ! in the buffer is parsed and stored in EEPRROM using <tt>logGPS</tt> ! .</p> <center> <table class="code"> *************** *** 101,108 **** </center> <h2>Logging and Retrieving Data</h2> ! <p>Fields in the GGA message are comma delimited. These are parsed with <tt> ! logGPS()</tt>, which simultaneously stores the data into the client's EEPROM ! using <tt>LoggerWrite.write</tt>. One line of memory is reserved for each ! field, and these are numbered as follows:<br> <br> </p> --- 101,108 ---- </center> <h2>Logging and Retrieving Data</h2> ! <p>Fields in the GGA message are comma delimited. These are parsed with ! <tt> logGPS()</tt>, which simultaneously stores the data into the ! client's EEPROM using <tt>LoggerWrite.write</tt>. One line of memory ! is reserved for each field, and these are numbered as follows:<br> <br> </p> *************** *** 193,211 **** </table> </center> ! <p> To retrieve data, load a second mote with <code>GenericBase</code> and ! perform the following: </p> <ol> <li>Leaving the GenericBase mote connected to the programming board, start the serial port forwarding service using the command <code>java net.tinyos.sf.SerialForward</code></li> ! <li>Broadcast retrieve command over the radio: <code>java net.tinyos.tools.gpsBcast ! <group ID> <b>Field Name</b> <gps mote ! ID></code></li> ! <li>Packet is sent to the base station via radio. Contained in the packet ! payload is the data for the selected field. </li> </ol> <hr /=""> ! <p> Last updated: $Date$ by $Author$. ! </p> </body> </html> --- 193,239 ---- </table> </center> ! <p> To retrieve data, load a second mote with <code>GenericBase</code> and ! perform the following: </p> <ol> <li>Leaving the GenericBase mote connected to the programming board, start the serial port forwarding service using the command <code>java net.tinyos.sf.SerialForward</code></li> ! <li>Broadcast retrieve command over the radio: <code>java net.tinyos.tools.gpsBcast ! <group ID> <b>Field Name</b> <gps ! mote ID></code></li> ! <li>Packet is sent to the base station via radio. Contained in the packet ! payload is the data for the selected field. </li> ! </ol> ! <h2>Instructions for Use</h2> ! <p>NOTE: gps.nc only runs on the mica2 platform</p> ! <ol> ! <li>Load gps into mica2</li> ! <li>Mica2 will take several minutes to lock on to satellites</li> ! <li>Load a second mote with GenericBase</li> ! <li>Leaving the GenericBase mote connected to the programming board, ! start the serial port forwarding service using the command <br> ! <center><code>java net.tinyos.sf.SerialForward</code></center> ! </li> ! <li>Run gpsBcast to have gps data sent to the GenericBase mote (base station) ! over the radio. From the <tt>firebug/project/java</tt> directory, type ! <br> ! <center><code>./gpsrun.sh <group ID> <b>Field Name</b> ! <gps mote ID></code></center> ! </li> ! <li>Packet is sent to the base station via radio. Contained in the packet ! payload is the data for the selected field.</li> </ol> + Alternatively, the gps driver can be connected directly to the PC via the + programming board. GPS data could be sent to UART and displayed on + the PC with a java application. .<br> + <h2>Useful Links</h2> + <p><a href="http://nmviewogc.cr.usgs.gov/viewer">USGS National Map Viewer</a> + -- use <i>Identify</i> tool to get Long/Lat coordinates of any point in + the U.S.A.</p> + <p><a href="http://www.topozone.com">www.topozone.com</a> + -- interactive USGS topo map of the entire U.S.A.</p> <hr /=""> ! <p> Last updated: $Date$ by $Author$. ! </p> </body> </html> |