firebug-cvs Mailing List for FireBug: wireless wildfire monitoring (Page 24)
Brought to you by:
doolin
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(36) |
Jun
(45) |
Jul
(108) |
Aug
(31) |
Sep
(2) |
Oct
(4) |
Nov
(113) |
Dec
(20) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(63) |
Feb
(37) |
Mar
(24) |
Apr
(6) |
May
(5) |
Jun
(5) |
Jul
(71) |
Aug
(42) |
Sep
(7) |
Oct
|
Nov
|
Dec
|
2005 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
(64) |
Jun
(71) |
Jul
(51) |
Aug
(89) |
Sep
(24) |
Oct
(1) |
Nov
(1) |
Dec
(2) |
2006 |
Jan
|
Feb
|
Mar
(3) |
Apr
(2) |
May
|
Jun
|
Jul
(21) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
From: <do...@us...> - 2004-01-14 14:05:37
|
Update of /cvsroot/firebug/fireboard/fireboard/sensors/leadtek9546 In directory sc8-pr-cvs1:/tmp/cvs-serv3689 Modified Files: gps.h gps_driver.nc gps_driverM.nc Removed Files: sensorboard.h Log Message: Cleaning up gps code. Removed some dead code, Index: gps.h =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/leadtek9546/gps.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** gps.h 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- gps.h 14 Jan 2004 14:05:34 -0000 1.2 *************** *** 81,84 **** --- 81,87 ---- #define GPS_H + // The actual values for each of these may vary, + // especially characters per field, which may be + // application dependent. #define GPS_MSG_LENGTH 100 #define GPS_CHAR 11 *************** *** 90,96 **** #define GPS_DATA_LENGTH 128 ! #define GPS_PACKET_START 0x24 //start of gps packet ! #define GPS_PACKET_END1 0x0D //penultimate byte of gps packet ! #define GPS_PACKET_END2 0x0A //last byte of gps packet // This isn't used yet, but should be. --- 93,114 ---- #define GPS_DATA_LENGTH 128 ! #define GPS_PACKET_START 0x24 //start of gps packet ! #define GPS_PACKET_END1 0x0D //penultimate byte of NMEA string ! #define GPS_PACKET_END2 0x0A //ultimate byte of NMEA string ! ! // Carriage return, ASCII 13 ! #define NMEA_END1 "\r" //0x0D //penultimate byte of NMEA string ! // Line feed, ASCII 10 ! #define NMEA_END2 "\n" //0x0A //ultimate byte of NMEA string ! ! #define NMEA_GSV_MASK 0x0001 ! #define NMEA_GSA_MASK 0x0002 ! #define NMEA_ZDA_MASK 0x0004 ! #define NMEA_PPS_MASK 0x0010 ! #define NMEA_FOM_MASK 0x0020 ! #define NMEA_GLL_MASK 0x1000 ! #define NMEA_GGA_MASK "0x2000" ! #define NMEA_VTG_MASK 0x4000 ! #define NMEA_RMC_MASK 0x8000 // This isn't used yet, but should be. *************** *** 98,101 **** --- 116,130 ---- #define GPS_POWER_ON 1 + const uint8_t gps_power_on = 0; + + + /** + * Predefined "programs" useful for setting various states + * of the GPS unit. These are all in NMEA format. + */ + const uint8_t gps_gga_mask[] = {"$PFST,NMEA,"NMEA_GGA_MASK NMEA_END1 NMEA_END2}; + //const uint8_t gps_rmc_mask[] = {"$PFST,NMEA",NMEA_RMC_MASK,",",NMEA_END1,",",NMEA_END2}; + + typedef struct _gga_msg GGA_Msg; *************** *** 104,107 **** --- 133,137 ---- typedef GPS_Msg * GPS_MsgPtr; + struct _gps_msg { Index: gps_driver.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/leadtek9546/gps_driver.nc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gps_driver.nc 6 Jan 2004 16:29:47 -0000 1.2 --- gps_driver.nc 14 Jan 2004 14:05:34 -0000 1.3 *************** *** 53,57 **** MicaWbSwitch, UARTGpsPacket, - //TimerC, LedsC; --- 53,56 ---- *************** *** 59,70 **** gps_driverM.StdControl = StdControl; Sensor = gps_driverM; - //StdControl = TimerC; StdControl = MicaWbSwitch; gps_driverM.Leds -> LedsC; - //gps_driverM.GPSTimer -> TimerC.Timer[unique("Timer")]; - //gps_driverM.REDTimer -> TimerC.Timer[unique("Timer")]; - /** Use gps without sensirion or adxl. */ //gps_driverM.SwitchControl -> MicaWbSwitch.StdControl; gps_driverM.PowerSwitch -> MicaWbSwitch.Switch[0]; --- 58,65 ---- Index: gps_driverM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/leadtek9546/gps_driverM.nc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** gps_driverM.nc 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- gps_driverM.nc 14 Jan 2004 14:05:34 -0000 1.2 *************** *** 39,43 **** command result_t log_gga_data_to_eeprom(GGA_Msg * pGGA); - //command result_t log_gga_data_to_eeprom(GGA_Msg * pGGA); } --- 39,42 ---- *************** *** 151,193 **** } - /** FIXME: Make sure we don't need the startDone, stopDone - * calls. - */ event result_t PowerSwitch.setDone(bool local_result) { - - #if 0 - switch(state) { - - case MAIN_SWITCH_ON: - SODbg(DBG_USR2, "PowerSwitch.setDone() MAIN_SWITCH_ON\n"); - state = IDLE; - /** GpsControl is wired to GpsPacket.nc */ - //signal GpsControl.startDone(); - break; - - case MAIN_SWITCH_OFF: - SODbg(DBG_USR2, "PowerSwitch.setDone() MAIN_SWITCH_OFF\n"); - state = POWEROFF; - /** GpsControl is wired to GpsPacket.nc */ - //signal GpsControl.stopDone(); - break; - - case WAIT_SWITCH_ON: - SODbg(DBG_USR2, "PowerSwitch.setDone() WAIT_SWITCH_ON\n"); - if (call PowerSwitch.set(MICAWB_GPS_POWER,1) == SUCCESS) { - state = MAIN_SWITCH_ON; - } - break; - - case WAIT_SWITCH_OFF: - SODbg(DBG_USR2, "PowerSwitch.setDone() WAIT_SWITCH_OFF\n"); - if (call PowerSwitch.set(MICAWB_GPS_POWER,0) == SUCCESS) { - state = MAIN_SWITCH_OFF; - } - default: - break; - } - #endif - return SUCCESS; } --- 150,154 ---- *************** *** 207,238 **** } - /** FIXME: Rewrite this with a switch/case. */ - /** FIXME: I see no reason why we need I2C information this - * high in the application. All this I2C bus info needs - * to be shoved down a level, and wired from here to something - * like turnSensorOn(), turnSensorOff(), etc. - */ event result_t IOSwitch.setDone(bool local_result) { - - //SODbg(DBG_USR2, "gps_driverM.IOSwitch.setDone(): state: %i \n", state); - #if 0 - if (state == OPENSCK) { //SCK line enabled - SODbg(DBG_USR2, "gps_newM.IOSwitch.setDone(): SCK enabled \n"); - state = OPENDATA; - return call IOSwitch.set(MICAWB_HUMIDITY_DATA,1); - } else if (state == OPENDATA) { //Data line enabled - SODbg(DBG_USR2, "gps_newM.IOSwitch.setDone(): SDA enabled \n"); - state = TIMER; - SODbg(DBG_USR2, "gps_newM.IOSwitch.setDone(): Timer Started, state: %i \n", - state); - return call GPSTimer.start(TIMER_ONE_SHOT, 100); - } else if (state == CLOSESCK) { - state = CLOSEDATA; - SODbg(DBG_USR2, "gps_newM.IOSwitch.setDone(): SCK disabled \n"); - return call IOSwitch.set(MICAWB_HUMIDITY_DATA,0); - } else if (state == CLOSEDATA) { - SODbg(DBG_USR2, "gps_newM.IOSwitch.setDone(): SDA disabled \n"); - } - #endif return SUCCESS; } --- 168,172 ---- *************** *** 248,261 **** command result_t isGGA(uint8_t * data) { - //SODbg(DBG_USR2, "firebugM.isGGA()\n"); - //UARTPutChar(data[3]); - //UARTPutChar(data[4]); - //UARTPutChar(data[5]); - if ( (data[3] == 'G') && (data[4] == 'G') && (data[5] == 'A')) { ! ! //SODbg(DBG_USR2, "\n"); return TRUE; } --- 182,193 ---- command result_t isGGA(uint8_t * data) { if ( (data[3] == 'G') && (data[4] == 'G') && (data[5] == 'A')) { ! return TRUE; ! } ! else if ( (data[3] == 'R') && ! (data[4] == 'M') && ! (data[5] == 'C')) { return TRUE; } *************** *** 372,381 **** event TOS_MsgPtr GpsReceive.receive(TOS_MsgPtr data) { ! uint8_t i; GPS_MsgPtr gps_data = (GPS_MsgPtr)data; ! int8_t gga_string[GPS_MSG_LENGTH]; ! bool gga_read = FALSE; ! bool gga_read_done = FALSE; call Leds.greenToggle(); --- 304,314 ---- event TOS_MsgPtr GpsReceive.receive(TOS_MsgPtr data) { ! //uint8_t i; GPS_MsgPtr gps_data = (GPS_MsgPtr)data; ! /** Save these for now. */ ! //int8_t gga_string[GPS_MSG_LENGTH]; ! //bool gga_read = FALSE; ! //bool gga_read_done = FALSE; call Leds.greenToggle(); *************** *** 384,389 **** --- 317,325 ---- SODbg(DBG_USR2, "gps_driverM.GpsReceive.receive() GGA Data\n"); signal Sensor.dataReady(gps_data); + signal Sensor.dataReady((void*)gps_gga_mask); } + + #if 0 uint8_t j = 0; --- sensorboard.h DELETED --- |
From: <do...@us...> - 2004-01-12 04:08:05
|
Update of /cvsroot/firebug/firebug/doc/spie2004 In directory sc8-pr-cvs1:/tmp/cvs-serv17281 Modified Files: spie_2004.tex Log Message: Removed blast description. Index: spie_2004.tex =================================================================== RCS file: /cvsroot/firebug/firebug/doc/spie2004/spie_2004.tex,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** spie_2004.tex 26 Nov 2003 14:41:07 -0000 1.7 --- spie_2004.tex 12 Jan 2004 04:08:02 -0000 1.8 *************** *** 22,26 **** ! \author{M. M. Chen\supit{a}, A. Sharma\supit{b}, D. M. Doolin\supit{b}, S. Glaser\supit{b} and N. Sitar\supit{b} \skiplinehalf --- 22,26 ---- ! \author{A. Sharma\supit{b}, D. M. Doolin\supit{b}, M. M. Chen\supit{a}, S. Glaser\supit{b} and N. Sitar\supit{b} \skiplinehalf *************** *** 29,39 **** } - %\author{M. M. Chen\thanks{Graduate student, - %Dept. of Civil and Env. Eng., UC Berkeley}, - %A. Sharma\thanks{EECS}, D. M. Doolin\thanks{% - %Post-doctoral researcher, Dept. of Civ. and Env. Eng., - %UC Berkeley}, S. Glaser, N. Sitar} - %\date{\today} - %\maketitle \authorinfo{Further author information: (Send correspondence to A.A.A.)\\A.A.A.: E-mail: aa...@tb..., Telephone: 1 505 123 1234\\ B.B.A.: E-mail: bb...@cm..., Telephone: +33 (0)1 98 76 54 32} --- 29,32 ---- *************** *** 373,377 **** - Tiny Active Messages ~\cite{hill:j2000} attempt to preserve the basic concepts of integrating communication with computation --- 366,369 ---- *************** *** 401,440 **** - - - - \blast\ is a routing stack of wireless ad-hoc - networks for mote sensing application. Sensor - readings are collected and encapsulated by the - applications, blast will establish a self - organizing network among the nodes,and route - the packet to the basestation. All nodes in the - network broadcast route messages, so every mode - can choose parent node based on the link reliability - caculated from the information of route messages. - Once the network is established, each node can - either sends its own packets or forwards its - children's packets to its parent node. Packets - can be forwarded to the base station in a multihop - fashion.With this scheme, blast win the 90\%+ - receive rate of data packet in ideal environment. - The two drawbacks of current version of blast are: - 1. The network setup time is relatively long, - it is because it needs to collect enough route - packet to caculate the reliability, 2. it needs a - mechanism to operate in power saving mode to extend - the longevity of the motes. - - - The \blast\ protocol has the following characteristics: - \begin{enumerate} - \item Many-to-one: messages are routed to a single base node. - \item Routing tables evolve using window mean with exponentially weighted, - moving average (WMEWMA) estimators for evaluating link quality. - WMEWMA balances reactivity to changes in link quality (agility) - with - - - \end{enumerate} \subsection{Firebug data protocol} --- 393,396 ---- |
From: <do...@us...> - 2004-01-06 17:59:46
|
Update of /cvsroot/firebug/fireboard/fireboard/doc/design In directory sc8-pr-cvs1:/tmp/cvs-serv24305/design Modified Files: index.html Log Message: Added more comments to design docs. Index: index.html =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/doc/design/index.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** index.html 5 Jan 2004 21:12:45 -0000 1.2 --- index.html 6 Jan 2004 17:59:42 -0000 1.3 *************** *** 65,69 **** <p> ! The following are helpful: </p> --- 65,89 ---- <p> ! Some definitions: ! </p> ! ! ! <ul> ! <li> ! A <em>sensorboard</em> is composed of one or more ! <em>sensors</em>, uses as many <code>Sensor</code> ! interfaces as necessary, and provides the ! <code>Sensorboard</code> interface. ! </li> ! ! <li> ! A <em>sensor driver</em> provides the <code>Sensor</code> ! interface. ! </li> ! ! </ul> ! ! <p> ! The following naming conventions are helpful: </p> *************** *** 74,78 **** model name. For example, the Sensirion SHT11 temperature/humidity sensor is located in an ! "sht11" subdirectory. </li> --- 94,100 ---- model name. For example, the Sensirion SHT11 temperature/humidity sensor is located in an ! "sensirion_sht11" subdirectory. See, for example, the ! <a href="http://cvs.sourceforge.net/viewcvs.py/firebug/fireboard/fireboard/sensors/">apps</a> ! directory for fireboard. </li> *************** *** 82,93 **** many sensors have capabilities beyond what is needed for a particular project. For example, ! some sensors, such as the LeadTek 9546 GPS ! sensor support a limited amount of programming. ! Documentation for the sensor should be here as well. </li> <li> ! A <em>sensorboard</em> is composed of one or more ! <em>sensors</em>. </li> --- 104,127 ---- many sensors have capabilities beyond what is needed for a particular project. For example, ! some sensors, such as the <a href="http://www.leadtek.com/gps/gps_9546_1.html">LeadTek 9546</a> ! GPS sensor support a considerable amount of programming, ! and nearly a dozen different output formats. ! Structs supporting different messages should ! be defined in the header file. </li> <li> ! The sensor specifications should be in a ! configuration file named "S_driver.nc", ! where S is the sensor name. This allows ! nesdoc to write all the sensor capabilities ! automatically. See for example <a href="http://cvs.sourceforge.net/viewcvs.py/firebug/fireboard/fireboard/sensors/leadtek9546/gps_driver.nc">gps_driver.nc</a> ! and <a href="http://cvs.sourceforge.net/viewcvs.py/firebug/fireboard/fireboard/sensors/sensirion_sht11/Sensirion.nc">Sensirion.nc</a>. ! Documentation should include enough information to allow a ! user to write further documentation of the ! sensor. For example, operating ranges, accuracy, ! precisions should be listed here. Also, a link ! to the manufacturers web page for that particular ! sensor should be here as well. </li> *************** *** 100,109 **** <li> - A <em>sensor driver</em> provides the <code>Sensor</code> - interface. - </li> - - - <li> <p> Monolithic sensor board applications require familiarity --- 134,137 ---- *************** *** 130,135 **** <h1>The Sensor interface</h1> ! ! <p> Data collection is a reasonably well-understood --- 158,163 ---- <h1>The Sensor interface</h1> ! ! <p> Data collection is a reasonably well-understood *************** *** 156,160 **** ! <p> The complete Sensor interface definition is listed below. This definition should be considered a "proposal", and --- 184,188 ---- ! <p> The complete Sensor interface definition is listed below. This definition should be considered a "proposal", and *************** *** 165,169 **** firebug project, and have considered simplified the code development. ! </p> <center> --- 193,197 ---- firebug project, and have considered simplified the code development. ! </p> <center> *************** *** 357,366 **** design will most likely evolve as more sophisticated applications are written. ! </p> <hr /> David M. Doolin<br /> ! Last updated: $ID: $ <hr /> --- 385,394 ---- design will most likely evolve as more sophisticated applications are written. ! </p> <hr /> David M. Doolin<br /> ! Last updated: $Id$ <hr /> |
From: <do...@us...> - 2004-01-06 16:29:50
|
Update of /cvsroot/firebug/fireboard/fireboard/sensors/sensirion_sht11 In directory sc8-pr-cvs1:/tmp/cvs-serv3476/fireboard/fireboard/sensors/sensirion_sht11 Modified Files: Sensirion.nc Log Message: Added more documentation to the sensor drivers. Index: Sensirion.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/sensirion_sht11/Sensirion.nc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Sensirion.nc 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- Sensirion.nc 6 Jan 2004 16:29:47 -0000 1.2 *************** *** 5,9 **** /** ! * Sensirion SHT11 driver test application. * * The Sensirion SHT11 sensor is manufactured by: --- 5,9 ---- /** ! * Sensirion SHT11 driver module. * * The Sensirion SHT11 sensor is manufactured by: *************** *** 79,86 **** * </pre> * ! * @author David M. Doolin ! */ ! ! /** * Parts of this code were written or modified for FireBug project * funded by the NSF Information Technology Research --- 79,83 ---- * </pre> * ! * * Parts of this code were written or modified for FireBug project * funded by the NSF Information Technology Research |
From: <do...@us...> - 2004-01-06 16:29:50
|
Update of /cvsroot/firebug/firebug/web In directory sc8-pr-cvs1:/tmp/cvs-serv3476/web Modified Files: fireboard.html Log Message: Added more documentation to the sensor drivers. Index: fireboard.html =================================================================== RCS file: /cvsroot/firebug/firebug/web/fireboard.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** fireboard.html 22 Nov 2003 01:06:46 -0000 1.3 --- fireboard.html 6 Jan 2004 16:29:47 -0000 1.4 *************** *** 135,140 **** <p> ! The <a href="http://www.leadtek.com">LeadTek</a> ! 9546 GPS unit has 12 channels "All-In-View" satellite tracking with cold/warm/hot start times of 45/38/8 Seconds --- 135,140 ---- <p> ! The <a href="http://www.leadtek.com/gps/gps_9546_1.html"> ! LeadTek 9546</a> GPS unit has 12 channels "All-In-View" satellite tracking with cold/warm/hot start times of 45/38/8 Seconds |
From: <do...@us...> - 2004-01-06 16:29:50
|
Update of /cvsroot/firebug/fireboard/fireboard/sensors/leadtek9546 In directory sc8-pr-cvs1:/tmp/cvs-serv3476/fireboard/fireboard/sensors/leadtek9546 Modified Files: gps_driver.nc Log Message: Added more documentation to the sensor drivers. Index: gps_driver.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/leadtek9546/gps_driver.nc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** gps_driver.nc 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- gps_driver.nc 6 Jan 2004 16:29:47 -0000 1.2 *************** *** 2,5 **** --- 2,29 ---- /** + * <h1>LeadTek 9546 Sirf-based GPS sensor</h1> + * + * <ul> + * <li>Compact module size (measured only 25.4*24.1*6.8mm, + * including RF shield and connector) suitable for + * space-sensitive applications.</li> + * <li>Onboard MMCX RF connector support active and passive antenna.</li> + * <li>20 pin Molex® board connector (Part#52991) for easy + * module interface and integration.</li> + * <li>SiRF 2e/LP low power chipset with Trickle Power + * mode support for additional power saving.</li> + * <li>12 Channels All-In-View Tracking with + * onboard TCXO for superior sensitivity and performance.</li> + * <li>Cold/Warm/Hot Start Time: 45/38/8 Seconds.</li> + * <li>Reacquisition Time: 0.1 seconds.</li> + * <li>Support NMEA-0183 and SiRF Binary protocol + * (default NMEA 4800 with GGA, RMC, VTG at 1Hz + * and GSV, GSA at 0.2Hz).</li> + * <li>Multi-path Mitigation Hardware.</li> + * <li>On-board RTCM SC-104 DGPS and WASS Demodulator enabled.</li> + * <li>Integrated ARM7TDMI CPU for customized software integration.</li> + *</ul> + * + * * Parts of this code were written or modified for FireBug project * funded by the NSF Information Technology Research |
From: <do...@us...> - 2004-01-06 16:29:50
|
Update of /cvsroot/firebug/fireboard/fireboard/sensors/intersema5534ap In directory sc8-pr-cvs1:/tmp/cvs-serv3476/fireboard/fireboard/sensors/intersema5534ap Modified Files: Calibration.nc Intersema.nc Log Message: Added more documentation to the sensor drivers. Index: Calibration.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/intersema5534ap/Calibration.nc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Calibration.nc 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- Calibration.nc 6 Jan 2004 16:29:47 -0000 1.2 *************** *** 1,5 **** ! /* tab:4 ! * ! * * "Copyright (c) 2000-2002 The Regents of the University of California. * All rights reserved. --- 1,3 ---- ! /** * "Copyright (c) 2000-2002 The Regents of the University of California. * All rights reserved. *************** *** 61,67 **** /* * ! * Authors: Joe Polastre * ! * $Id$ */ --- 59,89 ---- /* * ! * @author Joe Polastre * ! */ ! ! /** ! * From the Intersema 5534 spec sheet: ! * ! * "Every module is individually factory calibrated ! * at two temperatures and two pressures. As a result, ! * 6 coefficients necessary to compensate for process ! * variations and temperature variations are calculated ! * and stored in the 64-Bit PROM of each module. These ! * 64-Bit (partitioned into four words of 16-Bit) must ! * be read by the microcontroller software and used in ! * the program converting D1 and D2 into compensated pressure ! * and temperature values." ! */ ! ! /** ! * Parts of this code were written or modified for FireBug project ! * funded by the NSF Information Technology Research ! * initiative. Copyright Regents of the University of ! * of California, 2003. ! * ! * @url http://firebug.sourceforge.net ! * ! * @author David. M. Doolin */ Index: Intersema.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/intersema5534ap/Intersema.nc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Intersema.nc 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- Intersema.nc 6 Jan 2004 16:29:47 -0000 1.2 *************** *** 3,6 **** --- 3,58 ---- /** + * Intersema 5534 barometric pressure and temperature + * sensor driver module. + * + * The Intersema 5534 sensor is manufactured by: + * + * <pre> + * Intersema Sensoric SA + * Ch. Chapons-des-Prés 11 + * CH-2022 Bevaix + * Switzerland + * Telephone +41 (0) 32 847 9550 + * Fax +41 (0) 32 847 9569 + * http://www.intersema.ch + * </pre> + * + * + * Integrated pressure sensor + * Pressure range 300-1100 mbar + * 15 Bit ADC + * 6 coefficients for software calibration stored on-chip + * 3-wire serial interface + * 1 system clock line (32.768 kHz) + * Low voltage / low power + * + * <h2>Description</h2> + * + * <p> + * From the <a href="http://www.intersema.ch/site/technical/ms5534.php> + * 5534 web page</a> + * </p> + * <blockquote>The MS5534 is a SMD-hybrid device including a + * piezoresistive pressure sensor and an ADC-Interface IC. + * It provides a 16 Bit data word from a pressure- and + * temperature-dependent voltage. Additionally the module + * contains 6 readable coefficients for a highly accurate + * software calibration of the sensor. MS5534 is a low-power, + * low-voltage device with automatic power down (ON/OFF) + * switching. A 3-wire interface is used for all communications + * with a microcontroller. Sensor packaging options are + * plastic or metal cap. + * </blockquote> + * + * Here is the <a href="http://www.intersema.ch/site/technical/files/ms5534.pdf"> + * spec sheet</a>. + * + * + * <h2>Physics</h2> + * + * The barometric sensor works by... + * + * The temperature sensor works by... + * * Parts of this code were written or modified for FireBug project * funded by the NSF Information Technology Research |
From: <do...@us...> - 2004-01-06 16:29:50
|
Update of /cvsroot/firebug/fireboard/fireboard/apps In directory sc8-pr-cvs1:/tmp/cvs-serv3476/fireboard/fireboard/apps Modified Files: Makelocal Log Message: Added more documentation to the sensor drivers. Index: Makelocal =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/apps/Makelocal,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Makelocal 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- Makelocal 6 Jan 2004 16:29:46 -0000 1.2 *************** *** 1,5 **** ! MTS420CA = $(HOME)/firebug/fireboard LOCAL_PATH += -I$(MTS420CA)/sensors/$(SENSORBOARD) --- 1,5 ---- ! MTS420CA = $(HOME)/sf.net/firebug/fireboard/fireboard LOCAL_PATH += -I$(MTS420CA)/sensors/$(SENSORBOARD) |
From: <do...@us...> - 2004-01-05 21:12:49
|
Update of /cvsroot/firebug/fireboard/fireboard/doc/design In directory sc8-pr-cvs1:/tmp/cvs-serv14161 Modified Files: index.html Log Message: Bad export from other archive. Import is missing files. Index: index.html =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/doc/design/index.html,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** index.html 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- index.html 5 Jan 2004 21:12:45 -0000 1.2 *************** *** 15,28 **** <h1>Driver design for Crossbow MTS420CA Fire board</h1> - - <p> The MTS420CA is the current generation of a sensor board design for the FireBug project for monitoring ! wildfires. </p> ! <h1>Software conventions</h1> <p> --- 15,66 ---- <h1>Driver design for Crossbow MTS420CA Fire board</h1> <p> The MTS420CA is the current generation of a sensor board design for the FireBug project for monitoring ! wildfires. The board contains sensors for measuring ! acceleration, temperature, barometric pressure, ! humidity and GPS location. The driver code is written ! in as a monolithic module, where all of the code for ! every sensor is located in a single directory. Since ! many of the sensors on the board are used on other ! sensor boards, it makes sense to compose modules for ! each sensor, then assemble those modules for a particular ! sensor board. To facilitate composing applications, ! we introduce a new "Sensor" interface consisting of ! commands necessary for any sensor and firing events ! common to all sensors. </p> + + <h2>Motivation</h2> ! <p> ! The motivation for the work is fourfold: ! </p> ! ! <ol> ! <li>Provide simple abstraction to allow ! beginning to intermediate programmers to ! productively use TinyOS.</li> ! ! <li>Develop templates allowing automatic ! code generation, both application and testing.</li> ! ! <li>Develop guidelines for assembling ! <em>sensorboards</em> using an arbitrary ! collection of <em>sensors</em>.</li> ! ! <li>Develop guidelines for internal documentation.</li> ! </ol> ! ! ! <p> ! In the following, the details for implementing the framework ! and using the Sensor interface are described. ! </p> ! ! ! ! <h1>Driver software conventions</h1> <p> *************** *** 88,101 **** </li> ! <li> </ul> ! <h1>Implementing the Sensor interface</h1> <center> --- 126,336 ---- </li> + </ul> ! <h1>The Sensor interface</h1> + <p> + Data collection is a reasonably well-understood + process, and all data collection devices, such + as wireless sensors, have behavior in common. + For example, sensors need to powered on and + powered off, and provide data at possibly + pre-specified intervals. The following list + summarizes many of the common aspects of + sensor data collection: + </p> + <ul> + <li>Configuration management</li> + <li>Acquisition control</li> + <li>Communications control</li> + <li>Time synchronization</li> + <li>Trigger control/trigger synchronization</li> + <li>Power management</li> </ul> ! <h2>Sensor interface definition</h2> ! ! ! <p> ! The complete Sensor interface definition is listed below. ! This definition should be considered a "proposal", and ! it's likely that many commands and events will be added, ! deleted, or the defined behavior changed to support ! real applications. However, implementations of the ! Sensor interface are being used successfully in the ! firebug project, and have considered simplified the ! code development. ! </p> ! ! <center> ! <table class="code"> ! ! <tbody> ! <tr> ! <td width="100%"> ! <pre> ! interface Sensor { ! ! /** ! * Turn on the power, but do not collect data. If the ! * sensor provides data given power, this command should ! * set a state where that data is only fired back through ! * dataReady when the user is ready for it. Any system ! * bus, I/O state, whatever should be left in a consistent ! * state. Implementation should be idempotent. ! * ! * @return Whether powering on was successful. ! */ ! command result_t powerOn(); ! ! /** ! * Notify components that the component has been started ! * and is ready to receive other commands. Implementation ! * should be idempotent. ! */ ! event result_t powerOnDone(); ! ! /** init() might be used to send a default ! * programming string to the sensor. ! */ ! command result_t init(); ! ! /** ! * Stop the component cleanly, without leaving ! * the system in an inconsistent state. ! * ! * @return Whether stopping was successful. ! */ ! command result_t powerOff(); ! ! /** ! * Notify components that the component has been stopped. ! */ ! ! event result_t powerOffDone(); ! ! command result_t setSamplingInterval(uint16_t sampling_rate); ! command result_t getSamplingInterval(uint16_t sampling_rate); ! ! ! /** startSampling puts the sensor into a state such that ! * the dataReady event will fire when data is ready to ! * to be collected from the sensor. ! */ ! command result_t startSampling(); ! ! /** Stop the sensor from sampling. ! */ ! command result_t stopSampling(); ! ! /** This is for collecting a single sample from ! * sensor. It should leave whatever state the sensor is ! * in unchanged. It should not be used in conjunction ! * with startSampling(). ! */ ! command result_t sampleOnce(); ! ! /** dataReady is where the main action is; ! * the entire system exists to support what ! * happens here. ! */ ! event result_t dataReady(void * userdata); ! ! /** Some sensors, for example the Leadtek 9546 used on ! * the Crossbow MTS420CA, are programmable. It isn't ! * practical to define one interface to handle ! * programming for arbitrary sensors, but any of the ! * sensors that can be programmed should have the ! * capability to read from some sort of I/O, which ! * an implementation of this command should encapsulate. ! */ ! command result_t loadProgram(uint8_t * program); ! ! /** Error codes for individual sensors should go into the ! * header file for that sensor. 16 bits should be enough ! * to extract an upper 8 bits for errors and a lower 8 ! * bits for other sensor dependent stuff, perhaps channel ID ! * something. Extraction code could be written as macros in ! * the sensor header file. ! */ ! event result_t error(uint16_t error_code); ! } ! </pre> ! </td> ! </tr> ! </tbody> ! </table> ! ! </center> ! ! ! <h2>The fireboard configuration</h2> ! ! <p> ! Hooking everything up is easy. ! Each driver implements StdControl, and ! provides Sensor. ! </p> ! ! ! <center> ! <table class="code"> ! ! <tbody> ! <tr> ! <td width="100%"> ! <pre> ! configuration fireboardsensor { ! ! provides { ! interface StdControl; ! interface Data[uint8_t id]; ! } ! ! } ! ! implementation { ! ! components fireboardsensorM, ! gps_driver, ! Intersema, ! Sensirion, ! taos, ! TimerC, ! LedsC; ! ! fireboardsensorM.StdControl = StdControl; ! StdControl = gps_driver; ! StdControl = Intersema; ! StdControl = Sensirion; ! Data = fireboardsensorM; ! ! fireboardsensorM.Leds -> LedsC; ! fireboardsensorM.GlobalTimer -> TimerC.Timer[unique("Timer")]; ! ! fireboardsensorM.LeadTek9546 -> gps_driver.Sensor; ! fireboardsensorM.SHT11 -> Sensirion.Sensor; ! fireboardsensorM.Intersema5534AP -> Intersema.Sensor; ! fireboardsensorM.TAOS -> taos.Sensor; ! } ! </pre> ! </td> ! </tr> ! </tbody> ! </table> ! ! </center> ! ! <h2>Test applications</h2> ! <p> ! Four test applications implementing the Sensor interface, ! each using a single sensor on the MTS420CA ("Fireboard"). ! Such applications are particularly easy to wire, just ! provide a Main and the driver configuration: ! </p> <center> *************** *** 109,124 **** </tr> </table> - <hr /> ! David M. Doolin<br /> ! Last updated: $Log$ ! Last updated: Revision 1.1.1.1 2004/01/05 21:03:27 doolin ! Last updated: New fireboard code. ! Last updated: ! Last updated: Revision 1.6 2004/01/05 20:06:05 doolin ! Last updated: Working on design web page. ! Last updated: </body> </html> --- 344,368 ---- </tr> </table> + </center> ! <h1>Conclusions</h1> ! ! <p> ! The driver system described above is in use in the ! <a href="http:firebug.sourceforge.net">Firebug</a> ! system. Limited Sensor interface implementations are very ! successful for the initial applications, but the ! design will most likely evolve as more sophisticated ! applications are written. ! </p> ! ! <hr /> ! ! David M. Doolin<br /> ! Last updated: $ID: $ ! <hr /> ! </body> </html> |
Update of /cvsroot/firebug/fireboard/fireboard/doc/design/images In directory sc8-pr-cvs1:/tmp/cvs-serv14161/images Added Files: TestGPS.testgps.nc.if.gif TestIntersema.testintersema.nc.if.gif TestSensirion.testsensirion.nc.if.gif TestTaos.testtaos.nc.if.gif Log Message: Bad export from other archive. Import is missing files. --- NEW FILE: TestGPS.testgps.nc.if.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: TestIntersema.testintersema.nc.if.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: TestSensirion.testsensirion.nc.if.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: TestTaos.testtaos.nc.if.gif --- (This appears to be a binary file; contents omitted.) |
From: <do...@us...> - 2004-01-05 15:08:42
|
Update of /cvsroot/firebug/firebug/project/src/FireBug In directory sc8-pr-cvs1:/tmp/cvs-serv3949 Modified Files: .cvsignore FireBug.nc FireBugM.nc Log Message: Updating from non sf archive. Index: .cvsignore =================================================================== RCS file: /cvsroot/firebug/firebug/project/src/FireBug/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** .cvsignore 17 Dec 2003 13:07:56 -0000 1.1 --- .cvsignore 5 Jan 2004 15:08:35 -0000 1.2 *************** *** 1 **** ! build --- 1 ---- ! build *~ Index: FireBug.nc =================================================================== RCS file: /cvsroot/firebug/firebug/project/src/FireBug/FireBug.nc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FireBug.nc 17 Dec 2003 13:07:56 -0000 1.1 --- FireBug.nc 5 Jan 2004 15:08:35 -0000 1.2 *************** *** 7,10 **** --- 7,12 ---- includes RoutingStack; + //includes gps; + configuration FireBug { *************** *** 14,51 **** implementation { ! components Main, ! FireBugM, MHSender, LedsC, - MicaWbSwitch, VirtualComm, ParentSelection, ! UARTGpsPacket, ! TimerWrapper; ! //Accel; Main.StdControl -> FireBugM.StdControl; FireBugM.MultiHopSend -> MHSender.MultiHopSend[RS_DATA_TYPE]; - ParentSelection.InForwardReceive -> VirtualComm.ReceiveMsg[RS_DATA_TYPE]; FireBugM.Timer1 -> TimerWrapper.Timer[unique("Timer")]; FireBugM.Timer2 -> TimerWrapper.Timer[unique("Timer")]; FireBugM.Leds -> LedsC; - Main.StdControl -> MHSender.StdControl; ! ! // Wiring for gps ! FireBugM.GpsControl -> UARTGpsPacket; ! FireBugM.GpsSend -> UARTGpsPacket; ! FireBugM.GpsReceive -> UARTGpsPacket; ! FireBugM.GpsCmd -> UARTGpsPacket.GpsCmd; ! ! ! ! // Wiring for Accelerometer, not yet dealt with in Makelocal ! #if 0 ! FireBugM.AccelControl -> Accel.StdControl; ! FireBugM.AccelCmd -> Accel.AccelCmd; ! #endif } --- 16,38 ---- implementation { ! components FireBugM, MHSender, LedsC, VirtualComm, ParentSelection, ! TimerWrapper, ! Main; ! Main.StdControl -> FireBugM.StdControl; + Main.StdControl -> MHSender.StdControl; + FireBugM.MultiHopSend -> MHSender.MultiHopSend[RS_DATA_TYPE]; FireBugM.Timer1 -> TimerWrapper.Timer[unique("Timer")]; FireBugM.Timer2 -> TimerWrapper.Timer[unique("Timer")]; FireBugM.Leds -> LedsC; ! ParentSelection.InForwardReceive -> VirtualComm.ReceiveMsg[RS_DATA_TYPE]; } Index: FireBugM.nc =================================================================== RCS file: /cvsroot/firebug/firebug/project/src/FireBug/FireBugM.nc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FireBugM.nc 17 Dec 2003 13:07:56 -0000 1.1 --- FireBugM.nc 5 Jan 2004 15:08:35 -0000 1.2 *************** *** 17,24 **** includes RoutingStack; ! includes gps; ! /** FIXME: Move these to the gps.h file. */ #define GPS_MSG_LENGTH 100 --- 17,25 ---- includes RoutingStack; ! //includes gps; ! /** ! * Move this stuff into the gps.h file. */ #define GPS_MSG_LENGTH 100 *************** *** 38,43 **** interface StdControl; - command result_t parseGPS(int8_t gga_string[GPS_MSG_LENGTH], uint8_t length); - command result_t logGPS(char gga_fields[GPS_FIELDS][GPS_CHAR_PER_FIELD]); } --- 39,42 ---- *************** *** 48,82 **** interface Timer as Timer2; interface Leds; - - interface I2CSwitchCmds as GpsCmd; - interface StdControl as GpsControl; - interface BareSendMsg as GpsSend; - interface ReceiveMsg as GpsReceive; - - - //Accels - #if 0 - interface StdControl as AccelControl; - interface I2CSwitchCmds as AccelCmd; - #endif - - } } - #define DATA_FREQ 10000 implementation { #include "SODebug.h" ! #include "gps.h" TOS_Msg msgToSend; ! //GPS_MsgPtr gps_data; struct DataFormat_t { uint16_t addr; uint16_t cnt; float temp; ! float rel_hum; ! float baro_pres; }; --- 47,82 ---- interface Timer as Timer2; interface Leds; } } implementation { #include "SODebug.h" ! TOS_Msg msgToSend; ! //GGA_Msg *pGGA; ! uint8_t pHours; ! uint8_t pMinutes; ! uint16_t pDec_sec; ! uint8_t pLat_deg; ! uint16_t pLat_dec_min; ! uint8_t pLong_deg; ! uint16_t pLong_dec_min; ! uint8_t pNSEWind; struct DataFormat_t { uint16_t addr; uint16_t cnt; + uint8_t hours; + uint8_t minutes; + uint16_t dec_sec; + uint8_t Lat_deg; + uint16_t Lat_dec_min; + uint8_t Long_deg; + uint16_t Long_dec_min; + uint8_t NSEWind; float temp; ! //float rel_hum; ! //float baro_pres; }; *************** *** 87,118 **** bool gps_active; //true if gps is active ! command result_t StdControl.init() { ! gps_active = TRUE; init_debug(); call Leds.init(); - call GpsControl.init(); - //call AccelControl.init(); //initialize accelerometer return SUCCESS; } command result_t StdControl.start() { int i; counter = 0; - call GpsControl.start(); - SODbg(DBG_USR2, "FireBugM.GpsControl.start() called\n"); - - call Timer1.start(TIMER_REPEAT, 5000); - - //if (! call GpsCmd.PowerSwitch(1)) { //turn on GPS power - // call Leds.yellowToggle(); - // SODbg(DBG_USR2, "Failed to power on gps \n"); - //} - - call Leds.redToggle(); for (i = 0; i < 29; i++) { msgToSend.data[i] = 0; --- 87,107 ---- bool gps_active; //true if gps is active ! bool gps_done; command result_t StdControl.init() { ! gps_active = FALSE; ! gps_done = TRUE; init_debug(); call Leds.init(); return SUCCESS; } command result_t StdControl.start() { + int i; counter = 0; for (i = 0; i < 29; i++) { msgToSend.data[i] = 0; *************** *** 127,138 **** event result_t Timer1.fired() { - //call GpsCmd.GpsPower(1); ! SODbg(DBG_USR2, "FireBugM.Timer1.fired()\n"); ! ! if (! call GpsCmd.PowerSwitch(1)) { //turn on GPS power call Leds.yellowToggle(); ! SODbg(DBG_USR2, "Failed to power on gps \n"); } return SUCCESS; } --- 116,132 ---- event result_t Timer1.fired() { ! #if 0 ! if (!gps_active){ call Leds.yellowToggle(); ! //if (! call GpsCmd.PowerSwitch(1)) { //turn on GPS power ! call GpsCmd.PowerSwitch(1); ! gps_active = TRUE; ! } ! else{ ! gps_active = FALSE; } + #endif + return SUCCESS; } *************** *** 154,160 **** uint8_t *dataPortion; uint16_t availableLength = 0; - struct DataFormat_t *df; ! SODbg(DBG_USR2, "FireBugM.Timer2.fired()\n"); if (sending == 1) { --- 148,153 ---- uint8_t *dataPortion; uint16_t availableLength = 0; ! struct DataFormat_t *df; if (sending == 1) { *************** *** 162,174 **** } dataPortion = call MultiHopSend.getBuffer(&msgToSend, &availableLength); df = (struct DataFormat_t *) dataPortion; df->addr = TOS_LOCAL_ADDRESS; df->cnt = counter++; ! //df->temp = gps_data->data[0]; ! //df->rel_hum = gps_data->data[1]; ! //df->baro_pres = gps_data->data[2]; sending = call MultiHopSend.send(&msgToSend, sizeof(struct DataFormat_t)); return SUCCESS; } --- 155,189 ---- } + #if 0 dataPortion = call MultiHopSend.getBuffer(&msgToSend, &availableLength); df = (struct DataFormat_t *) dataPortion; df->addr = TOS_LOCAL_ADDRESS; df->cnt = counter++; ! df->hours = pHours; ! df->minutes = pMinutes; ! df->dec_sec = pDec_sec; ! df->Lat_deg = pLat_deg; ! df->Lat_dec_min = pLat_dec_min; ! df->Long_deg = pLong_deg; ! df->Long_dec_min = pLong_dec_min; ! df->NSEWind = pNSEWind; ! df->temp = 100.1; ! //df->rel_hum = 36.2; ! //df->baro_pres = 28.3; ! ! SODbg(DBG_USR2, "hours:%i\n", df->hours); ! SODbg(DBG_USR2, "hours:%i\n", pHours); ! //SODbg(DBG_USR2, "minutes:%i\n", df->minutes); ! //SODbg(DBG_USR2, "dec_sec:%i\n", df->dec_sec); ! //SODbg(DBG_USR2, "Lat_deg:%i\n", df->Lat_deg); ! //SODbg(DBG_USR2, "Lat_dec_min:%i\n", df->Lat_dec_min); ! //SODbg(DBG_USR2, "Long_deg:%i\n", df->Long_deg); ! //SODbg(DBG_USR2, "Long_dec_min:%i\n", df->Long_dec_min); ! //SODbg(DBG_USR2, "NSEWind:%i\n", df->NSEWind); ! //SODbg(DBG_USR2, "hours:%h\n", df->temp); sending = call MultiHopSend.send(&msgToSend, sizeof(struct DataFormat_t)); + #endif + return SUCCESS; } *************** *** 185,416 **** event result_t MultiHopSend.sendDone(TOS_MsgPtr msg, uint8_t success) { sending = 0; call Timer2.stop(); return SUCCESS; } - // ************************** - //*Packet received from GPS* - //************************** - // - //*The following should be executed in GpsPacket - - - event TOS_MsgPtr GpsReceive.receive(TOS_MsgPtr data) { - - int8_t gga_string[GPS_MSG_LENGTH]; - bool gga_read = FALSE; - bool gga_read_done = FALSE; - uint16_t i = 0; - uint8_t j = 0; - uint8_t k = 0; - - GPS_MsgPtr gps_data = (GPS_MsgPtr)data; - SODbg(DBG_USR2, "gps_data:%i,\n", gps_data->length); - for (k = 0; k <= gps_data->length ; k++) UARTPutChar(gps_data->data[k]); - SODbg(DBG_USR2, "\n"); - - while (!gga_read_done) { - - if(gps_data->data[i] == 'G') { - if(gps_data->data[i+1] == 'G') { - if(gps_data->data[i+2] == 'A') { - gga_read = TRUE; - } - } - } - - if(gps_data->data[i] == GPS_END_MSG) { - if(gga_read) { - if(call GpsCmd.PowerSwitch(0)) { - SODbg(DBG_USR2, "GPS Power Off\n"); - } - call parseGPS(gga_string, j); - gga_read = FALSE; - gga_read_done = TRUE; - } - } - - if(gga_read) { - gga_string[j] = gps_data->data[i]; - j++; - } - - i++; - } - - call Leds.greenToggle(); - return data; - } - - - - //**************** - //*Parse GPS Data* - //**************** - //* - //* Fields are comma delimited - //* NMEA string parsed by field and stored into - //* gga_fields array - - - command result_t parseGPS(int8_t gga_string[GPS_MSG_LENGTH], uint8_t length) { - - char gga_fields[GPS_FIELDS][GPS_CHAR_PER_FIELD]; - - bool end_of_field = FALSE; - uint8_t i=0; - uint8_t j,m; - uint16_t k=0; - - //***DEBUG: Output NMEA message*** - uint16_t q; - SODbg(DBG_USR2, "parse GPS: \n"); - for(q=0; q<length; q++) UARTPutChar(gga_string[q]); - SODbg(DBG_USR2, "\n"); - //******************************** - - // Parse and store comma delimited fields into EEPROM - while (i < GPS_FIELDS) { - - // assemble gga_fields array - end_of_field = FALSE; - j = 0; - while (!end_of_field & k < length) { - if (gga_string[k] == GPS_DELIMITER) { - end_of_field = TRUE; - } - else { - gga_fields[i][j] = gga_string[k]; - } - j++; - k++; - } - - // two commas (,,) indicate empty field - // if field is empty, set it equal to 0 - if (j <= 1) { - for (m=0; m<10; m++) gga_fields[i][m] = '0'; - } - - i++; - } - - //call logGPS(gga_fields); - return SUCCESS; - } - - - - // ************** - //*Log GGA data* - //************** - //* - //* Assemble GGA message structure from gga_fields - //* Store GGA data into line 25 of EEPROM - - - command result_t logGPS(char gga_fields[GPS_FIELDS][GPS_CHAR_PER_FIELD]) { - - #if 0 - GGA_Msg *pGGA; - char gga_log_array[GPS_CHAR]; - - char NS; - char EW; - uint8_t j; - uint8_t nos; // number of satellites - - // Assemble GGA_Msg - - pGGA->hours = 10*(gga_fields[1][0]-'0') + (gga_fields[1][1]-'0'); - gga_log_array[0] = pGGA->hours; - pGGA->minutes = 10*(gga_fields[1][2]-'0') + (gga_fields[1][3]-'0'); - gga_log_array[1] = pGGA->minutes; - pGGA->dec_sec = 10000*(gga_fields[1][4]-'0') + 1000*(gga_fields[1][5]-'0') + 100*(gga_fields[1][7]-'0') + 10*(gga_fields[1][8]-'0') + (gga_fields[1][9]-'0'); - gga_log_array[2] = (pGGA->dec_sec)>>8; // MSB - gga_log_array[3] = pGGA->dec_sec; // LSB - - pGGA->Lat_deg = 10*(gga_fields[2][0]-'0') + (gga_fields[2][1]-'0'); - gga_log_array[4] = pGGA->Lat_deg; - pGGA->Lat_dec_min = 100000*(gga_fields[2][2]-'0') + 10000*(gga_fields[2][3]-'0') + 1000*(gga_fields[2][4]-'0') + 100*(gga_fields[2][5]-'0') + 10*(gga_fields[2][6]-'0') + (gga_fields[2][7]-'0'); - gga_log_array[5] = (pGGA->Lat_dec_min)>>8; - gga_log_array[6] = pGGA->Lat_dec_min; - - pGGA->Long_deg = 100*(gga_fields[4][0]-'0') + 10*(gga_fields[4][1]-'0') + (gga_fields[4][2]-'0'); - gga_log_array[7] = pGGA->Long_deg; - pGGA->Long_dec_min = 100000*(gga_fields[4][3]-'0') + 10000*(gga_fields[4][4]-'0') + 1000*(gga_fields[4][5]-'0') + 100*(gga_fields[4][6]-'0') + 10*(gga_fields[4][7]-'0') + (gga_fields[4][8]-'0'); - gga_log_array[8] = (pGGA->Long_dec_min)>>8; - gga_log_array[9] = pGGA->Long_dec_min; - - NS = (gga_fields[3][0] == 'N') ? 1 : 0; - EW = (gga_fields[5][0] == 'W') ? 1 : 0; - pGGA->NSEWind = EW | (NS<<4); // eg. Status = 000N000E = 00010000 - gga_log_array[10] = pGGA->NSEWind; - - nos = 10*(gga_fields[7][0]-'0') + (gga_fields[7][1]-'0'); - - //***DEBUG: Output GGA data before gga_fields*** - SODbg(DBG_USR2, "LOGGER GPS:\n"); - for(j=0; j<11; j++) UARTPutChar(gga_log_array[j]); - SODbg(DBG_USR2, "\n"); - //***************************************** - - #endif - - return SUCCESS; - } - - - - - /****************************************************************************** - * Packet received from GPS - ASCII msg - * 1st byte in pkt is number of ascii bytes - * async used only for testing - *****************************************************************************/ - - - //((((((((((((((This is a alternative way from the above)))))))))))))) - /* - - event TOS_MsgPtr GpsReceive.receive(TOS_MsgPtr data) { //change to GPS packet!! - uint8_t i; - - GPS_MsgPtr gps_data = (GPS_MsgPtr)data; - - //gps_data = (GPS_MsgPtr)data; - call Leds.greenToggle(); - - //for (i = 0; i <= gps_data->data[0] ; i++) UARTPutChar(gps_data->data[i]); - for (i = 0; i <= gps_data->length ; i++) UARTPutChar(gps_data->data[i]); - - SODbg(DBG_USR2, "\n"); - call Timer2.start(TIMER_ONE_SHOT,300); - return data; - } - */ - - - event result_t GpsSend.sendDone(TOS_MsgPtr msg, result_t success) { - return SUCCESS; - } - - - event result_t GpsCmd.SwitchesSet(uint8_t PowerState){ - gps_active = TRUE; - call Leds.yellowToggle(); - SODbg(DBG_USR2, "Gps power on \n"); - - return SUCCESS; - } - - - #if 0 - event result_t AccelCmd.SwitchesSet(uint8_t PowerState){ - return SUCCESS; - } - #endif } --- 200,211 ---- event result_t MultiHopSend.sendDone(TOS_MsgPtr msg, uint8_t success) { + sending = 0; call Timer2.stop(); + SODbg(DBG_USR2, "radio_senddone, power gps again\n"); return SUCCESS; } } |
From: <do...@us...> - 2004-01-05 15:04:36
|
Update of /cvsroot/firebug/firebug/project/src/FireBase In directory sc8-pr-cvs1:/tmp/cvs-serv2977 Modified Files: .cvsignore Log Message: Updating from non sf archive. Index: .cvsignore =================================================================== RCS file: /cvsroot/firebug/firebug/project/src/FireBase/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** .cvsignore 17 Dec 2003 13:06:54 -0000 1.1 --- .cvsignore 5 Jan 2004 15:04:33 -0000 1.2 *************** *** 1 **** ! build --- 1 ---- ! build *~ |
From: <do...@us...> - 2004-01-03 13:38:55
|
Update of /cvsroot/firebug/firebug/project/src/multihop In directory sc8-pr-cvs1:/tmp/cvs-serv6577/project/src/multihop Modified Files: Makefile Log Message: Holiday work. Index: Makefile =================================================================== RCS file: /cvsroot/firebug/firebug/project/src/multihop/Makefile,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Makefile 17 Dec 2003 13:04:58 -0000 1.20 --- Makefile 3 Jan 2004 13:38:52 -0000 1.21 *************** *** 16,22 **** UISP = uisp UISP_FLAGS = -dprog=dapa $(UISP_EXTRA_FLAGS) ! TOSROOT=/cygdrive/c/tinyos/cygwin/opt BLASTROOT=/cygdrive/c/cygwin/home/dave/local/Blast-0.1 ! XBOWROOT = $(TOSROOT)/tinyos-1.x/contrib/xbow PLATFORMS= mica mica2 pc --- 16,22 ---- UISP = uisp UISP_FLAGS = -dprog=dapa $(UISP_EXTRA_FLAGS) ! #TOSROOT=/cygdrive/c/tinyos/cygwin/opt BLASTROOT=/cygdrive/c/cygwin/home/dave/local/Blast-0.1 ! #XBOWROOT = $(TOSROOT)/tinyos-1.x/contrib/xbow PLATFORMS= mica mica2 pc |
From: <do...@us...> - 2004-01-03 13:38:55
|
Update of /cvsroot/firebug/firebug/project/java/src/org/firebug/database In directory sc8-pr-cvs1:/tmp/cvs-serv6577/project/java/src/org/firebug/database Modified Files: MysqlDBHandler.java Log Message: Holiday work. Index: MysqlDBHandler.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/database/MysqlDBHandler.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** MysqlDBHandler.java 18 Jul 2003 18:03:26 -0000 1.8 --- MysqlDBHandler.java 3 Jan 2004 13:38:52 -0000 1.9 *************** *** 39,49 **** /*************** Constructors ***************/ ! public MysqlDBHandler() { setDebug(); setDBProperties("localhost","","3306","root",""); set_c_pool(use_c_pool); } public MysqlDBHandler(String host, String port, String user, String passwd, String dbname) { --- 39,60 ---- /*************** Constructors ***************/ ! public MysqlDBHandler(String dbname) { setDebug(); setDBProperties("localhost","","3306","root",""); + this.dbname = dbname; set_c_pool(use_c_pool); } + /* + public MysqlDBHandler(String propfile) { + + this.loadProperties(propfile); + connectionqueue = new LinkedList(); + initializeCQueue(number_of_connections); + + } + */ + public MysqlDBHandler(String host, String port, String user, String passwd, String dbname) { *************** *** 51,56 **** setDebug(); setDBProperties(host,"",port,user,passwd); - set_c_pool(use_c_pool); this.dbname = dbname; } --- 62,67 ---- setDebug(); setDBProperties(host,"",port,user,passwd); this.dbname = dbname; + set_c_pool(use_c_pool); } *************** *** 89,99 **** - public MysqlDBHandler(String propfile) { - - this.loadProperties(propfile); - connectionqueue = new LinkedList(); - initializeCQueue(number_of_connections); - - } --- 100,103 ---- *************** *** 123,128 **** ! if (debug) System.out.println("done."); } --- 127,133 ---- ! if (debug) { System.out.println("done."); + } } *************** *** 239,243 **** } e.printStackTrace(); ! } return connection; --- 244,251 ---- } e.printStackTrace(); ! } ! //catch (ConnectException e) { ! // e.printStackTrace(); ! //} return connection; *************** *** 534,558 **** } // close loadProps() - - /** This method can be called to initialize the dmoz database - * properties file. - */ - private static void test() { - - MysqlDBHandler dbh = new MysqlDBHandler(); - - /** Ensure that the properties set in this method - * are correct, then run it immediately. - */ - setupDefaults(dbh); - - if (TestDBHandler.test(dbh)) { - System.out.println("Passed MysqlDBHandler unit tests"); - } else { - System.out.println("Failed MysqlDBHandler unit tests"); - } - } - - /** Change the properties of the database to reflect the local * machine, then run make DBHandler.main to write these into --- 542,545 ---- *************** *** 575,578 **** --- 562,586 ---- } + + /** This method can be called to initialize the dmoz database + * properties file. + */ + private static void test() { + + MysqlDBHandler dbh = new MysqlDBHandler("firebug"); + + /** Ensure that the properties set in this method + * are correct, then run it immediately. + */ + setupDefaults(dbh); + + if (TestDBHandler.test(dbh)) { + System.out.println("Passed MysqlDBHandler unit tests"); + } else { + System.out.println("Failed MysqlDBHandler unit tests"); + } + } + + public static void main(String [] args) { *************** *** 599,602 **** --- 607,612 ---- pt.use_c_pool = true; + pt.set_dbname("firebug"); + /* Set the defaults for the local box */ pt.setDBProperties( pt.getDBHost("hostname"), //"127.0.0.1", *************** *** 606,609 **** --- 616,621 ---- pt.getDBPass("passwd")); //"tiger"); // oracle + + /* Now check out the connection... */ Connection con = pt.getConnection(); |
From: <do...@us...> - 2004-01-03 13:38:55
|
Update of /cvsroot/firebug/firebug/project/java/src/org/firebug In directory sc8-pr-cvs1:/tmp/cvs-serv6577/project/java/src/org/firebug Modified Files: ListenFB.java Log Message: Holiday work. Index: ListenFB.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/ListenFB.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** ListenFB.java 22 Nov 2003 02:15:56 -0000 1.14 --- ListenFB.java 3 Jan 2004 13:38:51 -0000 1.15 *************** *** 265,272 **** String port = args[args.length - 1]; ListenFB reader = new ListenFB(port); ! SensorPacket print = new SensorPacket(); DBLogger dblogger = new DBLogger(dbname); ! printers.add(print); printers.add(dblogger); --- 265,272 ---- String port = args[args.length - 1]; ListenFB reader = new ListenFB(port); ! //SensorPacket print = new SensorPacket(); DBLogger dblogger = new DBLogger(dbname); ! //printers.add(print); printers.add(dblogger); |
From: <do...@us...> - 2004-01-03 13:38:54
|
Update of /cvsroot/firebug/firebug/project/java In directory sc8-pr-cvs1:/tmp/cvs-serv6577/project/java Modified Files: build.xml mhrun.sh Log Message: Holiday work. Index: build.xml =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/build.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** build.xml 30 Jul 2003 21:43:21 -0000 1.9 --- build.xml 3 Jan 2004 13:38:51 -0000 1.10 *************** *** 24,28 **** <property name="servletlib" value="./jar/jsdk22.jar"/> <property name="dblib" value="./jar/mm.mysql-2.0.4-bin.jar"/> ! <property name="messagepath" value="c:\\tinyos-1.x\\tools\\java"/> --- 24,28 ---- <property name="servletlib" value="./jar/jsdk22.jar"/> <property name="dblib" value="./jar/mm.mysql-2.0.4-bin.jar"/> ! <property name="messagepath" value="c:\\cygwin\\opt\\tinyos-1.x\\tools\\java"/> Index: mhrun.sh =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/mhrun.sh,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** mhrun.sh 22 Nov 2003 02:15:56 -0000 1.7 --- mhrun.sh 3 Jan 2004 13:38:51 -0000 1.8 *************** *** 1,4 **** --- 1,9 ---- #!/usr/bin/sh + + + # Several environment variables must be set + # to make this script work properly. + ARGS=1 # Number of arguments expected. E_BADARGS=65 # Exit value if incorrect number of args passed. *************** *** 18,29 **** export MYSQLJAR=.\\jar\\mm.mysql-2.0.4-bin.jar ! #if [ $HOSTNAME == "MAX" ] ; then export MSGPATH=C:\\tinyos\\cygwin\\opt\\tinyos-1.x\\tools\\java ! #else ! # export MSGPATH=C:\\tinyos-1.x\\tools\\java ! #fi - #java -cp ".\\dist\\firebug.jar;$JAVA_HOME\\lib\\comm.jar" \ java -cp ".\\dist\\firebug.jar;$COMMJAR;$MYSQLJAR;$MSGPATH" \ org.firebug.ListenFB -e $1 COM1 --- 23,36 ---- export MYSQLJAR=.\\jar\\mm.mysql-2.0.4-bin.jar ! if [ $HOSTNAME = MAX ]; then export MSGPATH=C:\\tinyos\\cygwin\\opt\\tinyos-1.x\\tools\\java ! elif [ $HOSTNAME = firemobile ]; then ! echo $HOSTNAME ! export MSGPATH=C:\\cygwin\\opt\\tinyos-1.x\\tools\\java ! else ! echo Set MSGPATH to point to tinyos-1.x/tools/java ! fi java -cp ".\\dist\\firebug.jar;$COMMJAR;$MYSQLJAR;$MSGPATH" \ org.firebug.ListenFB -e $1 COM1 |
From: <do...@us...> - 2004-01-03 13:38:54
|
Update of /cvsroot/firebug/mts400/apps/TestGPS In directory sc8-pr-cvs1:/tmp/cvs-serv6577/mts400/apps/TestGPS Modified Files: gps_newM.nc Log Message: Holiday work. Index: gps_newM.nc =================================================================== RCS file: /cvsroot/firebug/mts400/apps/TestGPS/gps_newM.nc,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** gps_newM.nc 18 Nov 2003 22:45:10 -0000 1.6 --- gps_newM.nc 3 Jan 2004 13:38:51 -0000 1.7 *************** *** 25,29 **** interface StdControl as GpsControl; - interface I2CSwitchCmds as GpsCmd; interface BareSendMsg as GpsSend; --- 25,28 ---- |
From: <do...@us...> - 2004-01-03 13:38:54
|
Update of /cvsroot/firebug/mts400/apps In directory sc8-pr-cvs1:/tmp/cvs-serv6577/mts400/apps Modified Files: Makelocal Log Message: Holiday work. Index: Makelocal =================================================================== RCS file: /cvsroot/firebug/mts400/apps/Makelocal,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Makelocal 12 Dec 2003 00:31:10 -0000 1.6 --- Makelocal 3 Jan 2004 13:38:51 -0000 1.7 *************** *** 14,18 **** LOCAL_PATH += -I../../sensorboards/mts420ca ! PFLAGS := $(LOCAL_PATH) $(LOCAL_DEFINES) $(PFLAGS) --- 14,18 ---- LOCAL_PATH += -I../../sensorboards/mts420ca ! TOPDIRS += /home/dave/sf.net/firebug/mts400/apps PFLAGS := $(LOCAL_PATH) $(LOCAL_DEFINES) $(PFLAGS) |
From: <che...@us...> - 2003-12-19 23:46:33
|
Update of /cvsroot/firebug/firebug/web In directory sc8-pr-cvs1:/tmp/cvs-serv4833 Modified Files: admin.html Added Files: mh_readme.html Log Message: document on the mh setup --- NEW FILE: mh_readme.html --- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <link type="text/css" rel="stylesheet" href="firebug.css"> <link rel="SHORTCUT ICON" href="./images/favicon.ico"> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <title>mh_readme</title> </head> <body> <h1>How to make Firebug work</h1> <ul> The followings are required to install before the firebug can run. <li> PHP,Apache, Mysql on your PC, reference on how to set these up is <a href="admin.html"> here </a></li> <li> Blast Routing Stack</li> <li> CollectData application for the Mote/BaseStation.</li> <li> Sensorboard driver for GPS sensorboard mts400.(optional, no need for dummy packet application for motes)</li> </ul> <h2>Blast</h2> <ul> <li> You can get a blast stack software from <a href="http://www.ocf.berkeley.edu/%7Etmtong/tinyos/">http://www.ocf.berkeley.edu/~tmtong/tinyos/</a>.</li> <li> Unzip it to whereever you want, e.g. C:\Blast-0.11</li> </ul> <h2> CollectData applcation setup.</h2> <ul> <li> You should check out the lastest version of firebug from CVS.</li> <li> Go to firebug/project/src/multihop/, the files are explained as below:<br> . CollectDataFB_old/CollectDataMFB_old.nc : They are version for the motes using "Dummy Data" for the radio packet.<br> . CollectDataFB_gps_radio/CollectDataMFB_gps_radio.nc: Only Gps sensor work with radio, using real, full-string GGA data.<br> . BaseStation/BaseStationM.nc: One version for all the cases. </li> <li>Edit the Makefile, make sure you include the path to the blast stack and Sensorboard driver,i.e. <br> INCLUDES=-I$(BLASTROOT)/Blast-0.11/Sender <br> -I$(BLASTROOT)/Blast-0.11/Interface<br> -I$(BLASTROOT)/Blast-0.11/DataStructure<br> -I$(BLASTROOT)/Blast-0.11/VirtualComm<br> -I$(BLASTROOT)/Blast-0.11/ParentSelection<br> -I$(TOSROOT)/tinyos-1.x/tos<br> -I$(XBOWROOT)/tos/platform <br> -I$(XBOWROOT)/tos/interfaces <br> -I$(XBOWROOT)/tos/sensorboards/mts400 </li> <li>Install a base station with mote_id=1,<br> e.g. make mica2 install.1 BaseStation<br> Install a couple of mote with mote_id =2, 3....<br> e.g. make mica2 install.2 CollectDataFB<br> make mica2 install.3 CollectDataFB<br> </li> </ul> <h2> Firebug system setup</h2> <ul> <li> Database setup<br> .Fire a web broswer, go to http://localhost/firebug/db_admin.php,<br> .Supply a database name: firebug, and number is 10.<br> . So the database "firebug" and releavent tables are created. </li> . Go to http://localhost/firebug/db_select.php, click the table "cumulative"<br> <li> Data Logger setup<br> . Fire a cygwin, go the cygdrive/c/firebug/project/java, <br> . type ant <br> . Go to cygdrive/c/tinyos/opt/tinyos-1.x/tools/java, type: java net.tinyos.sf.SerialForwarder -comm serial@COM1:baudrate, this will fire the serialforwarder for our data logger.<br> . type ./mhrun.sh firebug<br> </li> <li> Make it Run!<br> . Connect a base station mote to the PC on the COM1 through seial port. <br> . Turn on a couple of motes.<br> . Grant a little bit Patience.<br> </li> </ul> </body> </html> Index: admin.html =================================================================== RCS file: /cvsroot/firebug/firebug/web/admin.html,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** admin.html 18 Jul 2003 20:06:20 -0000 1.11 --- admin.html 19 Dec 2003 23:46:30 -0000 1.12 *************** *** 1,283 **** ! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" ! "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> ! ! <html> ! ! <head> ! <link type="text/css" rel="stylesheet" href="firebug.css"> ! <link rel="SHORTCUT ICON" href="./images/favicon.ico"> ! <title>FireBug administration page</title> ! </head> ! ! <body> ! ! <h1>FireBug administration page</h1> ! ! <p> ! The information technology infrastructure of Firebug ! is composed of many components, including web servers, ! database servers and scripting languages. For our ! initial implementation, we have chosen freely available ! (usually open source) and ubiquituous products. ! Our toolchain is constructed by defining interfaces ! largely independent of the tools themselves, and ! independent of choice of operating systems. This ! allows replacing individual components on a case-by-case ! basis. ! </p> ! ! <p> ! For example, we are using PHP for client database access. ! The PHP scripts are designed such that the embedded ! SQL commands may be used independently of PHP, allowing ! different implementations to use Perl, Python or other ! scripting languages facilitating web-based interaction. ! </p> ! ! ! ! <h2>MySQL</h2> ! ! ! <p> ! Installing and setting up mysql is pretty easy. ! We can mostly use the defaults for the FireBug ! project, with exceptions for where things are locally ! installed on various different machines. If the ! server (mysqld) does not start automatically, ! there may be problems with the my.ini file, which ! is located in the Windows system root directory. ! Do a <a href="http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=mysql+startup+windows+2000&btnG=Google+Search">google search</a> to get some help ! on mysql startup on Windows. Remember to check the ! Windows Services manager to set mysql for automatically ! starting the server on bootup. ! </p> ! ! <p> ! Here is an example <code>my.ini</code> for a MySQL ! server installed on MS Windows 2000: ! <pre> ! [mysqld] ! basedir=D:/mysql ! datadir=D:/mysql/data ! [WinMySQLAdmin] ! Server=D:/mysql/bin/mysqld-nt.exe ! </pre> ! Different servers may have slightly different ! drive and paths, but <code>mysqld</code> must ! be able to find this information in order to ! start. ! </p> ! ! ! <p> ! Some useful MySQL commands: ! </p> ! <ul> ! <li> ! <code>mysql -u username -p</code> opens a command line ! client connection to a MySQL server running on localhost ! for a given username, and prompts for a password. ! </li> ! <li></code>mysql -u firebug --database=firebug --host=mysql -p</code> ! is the current login command for mysql on sourceforge. ! </li> ! <li> ! Loading tables from files can be performed using either ! the <code>mysqlimport</code> command (section 4.8.7 of the mysql ! manual), or the <code>LOAD DATA INFILE</code> (sections 3.3.3, ! 6.4.9 of the mysql manual). ! </li> ! <li>Deleting a database is performed by using the DROP sql ! command: <code>drop database <db-name></code>. ! </li> ! </ul> ! ! ! <p> ! Stuff we need to know how to do: ! </p> ! ! <ul> ! <li> ! How to extract databases/tables in databases from ! native format to flat ascii text files for backups ! and exports. ! </li> ! <li> ! There needs to be an environment variable or ! a property file for php to read to set the ! hostname or IP address of the mysql database. ! Having hosts hardwired into scripts results in ! lots of superfluous cvs commits as everyone ! changes just the host in a script. ! </li> ! </ul> ! ! <h3>MySQL tables for mote data</h3> ! ! ! <p> ! We use several different tables for mote data collection. ! Since FireBug motes are not mobile, location data is recorded ! only once. Sensor data is recorded into two tables. The ! first table accumulates times histories of the data by ! recording the data from each packet received. The second ! table keeps a record of the most recent data received from ! each mote, which saves querying the first table for real time ! updates. ! </p> ! ! <center> ! <h4>Sensor data table</h4> ! <table class="db_schema"> ! <tr> ! <td>mote_id</td> ! <td>time</td> ! <td>temp</td> ! <td>rel_hum</td> ! <td>baro_pres</td> ! <td>cnt</td> ! </tr> ! <tr> ! <td>INTEGER</td> ! <td>TIMESTAMP</td> ! <td>FLOAT</td> ! <td>FLOAT</td> ! <td>FLOAT</td> ! <td>INTEGER</td> ! <td></td> ! </tr> ! </table> ! </center> ! ! <p /> ! ! <center> ! <h4>Sensor location table</h4> ! <table class="db_schema"> ! <tr> ! <td>mote_id</td> ! <td>longitude</td> ! <td>latitude</td> ! </tr> ! <tr> ! <td>INTEGER</td> ! <td>FLOAT</td> ! <td>FLOAT</td> ! <td></td> ! </tr> ! </table> ! </center> ! ! ! ! <h3>Creating the tables</h3> ! <p> ! ! First create the "firebug"" database: ! <pre> ! CREATE DATABASE firebug; ! </pre> ! ! Next switch to the firebug database: ! <pre> ! USE DATABASE firebug; ! </pre> ! ! Then create the "example" table: ! <pre> ! CREATE TABLE example (mote_id INTEGER, ! time TIMESTAMP, ! temp FLOAT, ! rel_hum FLOAT, ! baro_pres FLOAT, ! cnt INTEGER); ! </pre> ! ! Load the example.txt file using: ! <pre> ! LOAD DATA INFILE 'example.txt' INTO TABLE example; ! </pre> ! ! The example.txt file must be located in the ! <code>$mysqlroot/data/firebug</code> directory for ! <code>LOAD DATA</code> command. ! ! The example data should now be displayed on its own ! <a href="./example.php">web page</a>. ! </p> ! ! ! <p> ! For testing the jdbc interface, two more tables need ! to be created: <code>example_current</code> and ! <code>example_cumulative</code>. The mysql client ! supports cut and paste, use the following: ! <pre> ! CREATE TABLE example_current (mote_id INTEGER, ! time TIMESTAMP, ! temp FLOAT, ! rel_hum FLOAT, ! baro_pres FLOAT, ! cnt INTEGER); ! </pre> ! <pre> ! CREATE TABLE example_cumulative (mote_id INTEGER, ! time TIMESTAMP, ! temp FLOAT, ! rel_hum FLOAT, ! baro_pres FLOAT, ! cnt INTEGER); ! </pre> ! <p> ! ! ! ! ! <h3>MySQL users and security</h3> ! ! <p> ! Since FireBug does not make extensive use of all of the ! MySQL database server capabilities, the number of users ! and the privileges for those users can be highly restricted. ! Following administrative guidelines result in a MySQL ! server that is reasonably secure, but flexible enough to ! handle data insertion and display for the FireBug project. ! </p> ! ! ! <h3>MySQL problems</h3> ! ! MySQL errors listed by error numbers: ! ! <ul> ! <li> ! <code>Warning: MySQL Connection Failed: ! Can't connect to MySQL server ! on 'localhost' (10061)</code>: CHeck to make ! sure the server is running. It should appear ! in the Windows Task Manager, or in <code>top</code> ! or <code>ps aux</code> in unix. If it isn't running, ! in Windows the server can be started using the ! services dialog box. In unix, run the script ! <code>safe_mysql</code>. ! </li> ! </ul> ! ! ! <h2>PHP</h2> ! ! <h2>Apache</h2> ! ! ! <hr /> ! ! <p> ! Last Updated: $Date$ by $Author$. ! </p> ! ! </body> ! </html> ! ! --- 1,182 ---- ! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> ! <html> ! <head> ! <link type="text/css" rel="stylesheet" href="firebug.css"> ! <link rel="SHORTCUT ICON" href="./images/favicon.ico"> ! <title>FireBug administration page</title> ! </head> ! <body> ! <h1>FireBug administration page</h1> ! <p> The information technology infrastructure of Firebug is composed of ! many components, including web servers, database servers and scripting ! languages. For our initial implementation, we have chosen freely ! available (usually open source) and ubiquituous products. Our toolchain ! is constructed by defining interfaces largely independent of the tools ! themselves, and independent of choice of operating systems. This allows ! replacing individual components on a case-by-case basis. </p> ! <p> For example, we are using PHP for client database access. The PHP ! scripts are designed such that the embedded SQL commands may be used ! independently of PHP, allowing different implementations to use Perl, ! Python or other scripting languages facilitating web-based interaction. ! </p> ! <h2>MySQL</h2> ! <p> Installing and setting up mysql is pretty easy. We can mostly use ! the defaults for the FireBug project, with exceptions for where things ! are locally installed on various different machines. If the server ! (mysqld) does not start automatically, there may be problems with the ! my.ini file, which is located in the Windows system root directory. Do ! a <a ! href="http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=mysql+startup+windows+2000&btnG=Google+Search">google ! search</a> to get some help on mysql startup on Windows. Remember to ! check the Windows Services manager to set mysql for automatically ! starting the server on bootup. </p> ! <p> Here is an example <code>my.ini</code> for a MySQL server ! installed on MS Windows 2000: </p> ! <pre> [mysqld]<br> basedir=D:/mysql<br> datadir=D:/mysql/data<br> [WinMySQLAdmin]<br> Server=D:/mysql/bin/mysqld-nt.exe<br> </pre> ! Different servers may have slightly different drive and paths, but <code>mysqld</code> ! must be able to find this information in order to start. ! <p> Some useful MySQL commands: </p> ! <ul> ! <li> <code>mysql -u username -p</code> opens a command line client ! connection to a MySQL server running on localhost for a given username, ! and prompts for a password. </li> ! <li>mysql -u firebug --database=firebug --host=mysql -p is the ! current login command for mysql on sourceforge. </li> ! <li> Loading tables from files can be performed using either the <code>mysqlimport</code> ! command (section 4.8.7 of the mysql manual), or the <code>LOAD DATA ! INFILE</code> (sections 3.3.3, 6.4.9 of the mysql manual). </li> ! <li>Deleting a database is performed by using the DROP sql command: <code>drop ! database <db-name></code>. </li> ! </ul> ! <p> Stuff we need to know how to do: </p> ! <ul> ! <li> How to extract databases/tables in databases from native format ! to flat ascii text files for backups and exports. </li> ! <li> There needs to be an environment variable or a property file for ! php to read to set the hostname or IP address of the mysql database. ! Having hosts hardwired into scripts results in lots of superfluous cvs ! commits as everyone changes just the host in a script. </li> ! </ul> ! <h3>MySQL tables for mote data</h3> ! <p> We use several different tables for mote data collection. Since ! FireBug motes are not mobile, location data is recorded only once. ! Sensor data is recorded into two tables. The first table accumulates ! times histories of the data by recording the data from each packet ! received. The second table keeps a record of the most recent data ! received from each mote, which saves querying the first table for real ! time updates. </p> ! <center> ! <h4>Sensor data table</h4> ! <table class="db_schema"> ! <tbody> ! <tr> ! <td>mote_id</td> ! <td>time</td> ! <td>temp</td> ! <td>rel_hum</td> ! <td>baro_pres</td> ! <td>cnt</td> ! </tr> ! <tr> ! <td>INTEGER</td> ! <td>TIMESTAMP</td> ! <td>FLOAT</td> ! <td>FLOAT</td> ! <td>FLOAT</td> ! <td>INTEGER</td> ! <td><br> ! </td> ! </tr> ! </tbody> ! </table> ! </center> ! <p> </p> ! <center> ! <h4>Sensor location table</h4> ! <table class="db_schema"> ! <tbody> ! <tr> ! <td>mote_id</td> ! <td>longitude</td> ! <td>latitude</td> ! </tr> ! <tr> ! <td>INTEGER</td> ! <td>FLOAT</td> ! <td>FLOAT</td> ! <td><br> ! </td> ! </tr> ! </tbody> ! </table> ! </center> ! <h3>Creating the tables</h3> ! <p> First create the "firebug"" database: </p> ! <pre> CREATE DATABASE firebug;<br> </pre> ! Next switch to the firebug database: ! <pre> USE DATABASE firebug;<br> </pre> ! Then create the "example" table: ! <pre> CREATE TABLE example (mote_id INTEGER,<br> time TIMESTAMP,<br> temp FLOAT,<br> rel_hum FLOAT,<br> baro_pres FLOAT,<br> cnt INTEGER);<br> </pre> ! Load the example.txt file using: ! <pre> LOAD DATA INFILE 'example.txt' INTO TABLE example;<br> </pre> ! The example.txt file must be located in the <code>$mysqlroot/data/firebug</code> ! directory for <code>LOAD DATA</code> command. The example data should ! now be displayed on its own <a href="./example.php">web page</a>. ! <p> For testing the jdbc interface, two more tables need to be created: ! <code>example_current</code> and <code>example_cumulative</code>. The ! mysql client supports cut and paste, use the following: </p> ! <pre> CREATE TABLE example_current (mote_id INTEGER,<br> time TIMESTAMP,<br> temp FLOAT,<br> rel_hum FLOAT,<br> _baropres FLOAT,<br> cnt INTEGER);<br> </pre> ! <pre> CREATE TABLE example_cumulative (mote_id INTEGER,<br> time TIMESTAMP,<br> temp FLOAT,<br> rel_hum FLOAT,<br> baro_pres FLOAT,<br> cnt INTEGER);<br> </pre> ! <p> </p> ! <h3>MySQL users and security</h3> ! <p> Since FireBug does not make extensive use of all of the MySQL ! database server capabilities, the number of users and the privileges ! for those users can be highly restricted. Following administrative ! guidelines result in a MySQL server that is reasonably secure, but ! flexible enough to handle data insertion and display for the FireBug ! project. </p> ! <h3>MySQL problems</h3> ! MySQL errors listed by error numbers: ! <ul> ! <li> <code>Warning: MySQL Connection Failed: Can't connect to MySQL ! server on 'localhost' (10061)</code>: CHeck to make sure the server is ! running. It should appear in the Windows Task Manager, or in <code>top</code> ! or <code>ps aux</code> in unix. If it isn't running, in Windows the ! server can be started using the services dialog box. In unix, run the ! script <code>safe_mysql</code>. </li> ! </ul> ! <h2>PHP</h2> ! <ul> ! <li>Go to php web page <a href="http://www.php.net/downloads.php">http://www.php.net/downloads.php</a> ! to download the php installation file.</li> ! <li>Run the installation file. </li> ! <li> After that, go to "C:\winnt\php.ini", open the file. </li> ! <li>Search the keyword "error_reporting" in the script, and change ! the value like:<br> ! error_reporting = E_All^E_Notice; </li> ! <li>if necessary, make sure the "envrionment variable" -"PATH" ! include the path to PHP. e.g. C:\PHP\bin;</li> ! <li> Fire a Cygwin, type: $mysql, you will get the mysql running.</li> ! </ul> ! <h2>Apache</h2> ! <ul> ! <li>go to apach web page <a ! href="http://httpd.apache.org/download.cgi">http://httpd.apache.org/download.cgi</a> ! to download the .exe installation file, and install it.</li> ! <li>After run the installation, go to C:\Program Files\Apache ! Group\Apache2\conf, open the file "httpd.conf". </li> ! <li> insert the folllowing text to the very end of the file.</li> ! <p>ScriptAlias /php/ "c:/php/" <br> ! AddType application/x-httpd-php .php <br> ! Action application/x-httpd-php "/php/php.exe"<br> ! </p> ! <li>if necessary, make sure the "envrionment variable" -"PATH" ! include the path to Apache. e.g. C:\Program ! Files\apache-ant-1.5.3-1\bin;</li> ! <li>restart Apache</li> ! </ul> ! <hr> ! <p> Last Updated: $Date$ by $Author: doolin ! $. </p> ! </body> ! </html> |
From: <che...@us...> - 2003-12-19 01:06:06
|
Update of /cvsroot/firebug/firebug/web In directory sc8-pr-cvs1:/tmp/cvs-serv25485 Modified Files: db_create.php db_table_select.php Log Message: change on the php Index: db_create.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/db_create.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** db_create.php 30 Nov 2003 00:21:59 -0000 1.10 --- db_create.php 19 Dec 2003 01:06:02 -0000 1.11 *************** *** 38,45 **** mysql_query($statement) or die("Error: ".mysql_error()." in creating location atable"); ! $statement = "CREATE TABLE current (mote_id INTEGER, time TIMESTAMP, hours INTEGER, minutes INTEGER, dec_sec INTEGER, Lat_deg INTEGER, Lat_dec_min INTEGER, Long_deg INTEGER, Long_dec_min INTEGER, NSEWind INTEGER, temp FLOAT, cnt INTEGER)"; mysql_query($statement) or die("Error: ".mysql_error()." in creating current atable"); ! $statement = "CREATE TABLE cumulative (mote_id INTEGER, time TIMESTAMP, hours INTEGER, minutes INTEGER, dec_sec INTEGER, Lat_deg INTEGER, Lat_dec_min INTEGER, Long_deg INTEGER, Long_dec_min INTEGER, NSEWind INTEGER, temp FLOAT, cnt INTEGER)"; mysql_query($statement) or die("Error: ".mysql_error()." in creating cumulative atable"); --- 38,45 ---- mysql_query($statement) or die("Error: ".mysql_error()." in creating location atable"); ! $statement = "CREATE TABLE current (mote_id INTEGER, time TIMESTAMP, temp FLOAT, cnt INTEGER, hours INTEGER, minutes INTEGER, dec_sec INTEGER, Lat_deg INTEGER, Lat_dec_min INTEGER, Long_deg INTEGER, Long_dec_min INTEGER, NSEWind INTEGER)"; mysql_query($statement) or die("Error: ".mysql_error()." in creating current atable"); ! $statement = "CREATE TABLE cumulative (mote_id INTEGER, time TIMESTAMP, temp FLOAT, cnt INTEGER, hours INTEGER, minutes INTEGER, dec_sec INTEGER, Lat_deg INTEGER, Lat_dec_min INTEGER, Long_deg INTEGER, Long_dec_min INTEGER, NSEWind INTEGER)"; mysql_query($statement) or die("Error: ".mysql_error()." in creating cumulative atable"); Index: db_table_select.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/db_table_select.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** db_table_select.php 30 Nov 2003 00:22:00 -0000 1.2 --- db_table_select.php 19 Dec 2003 01:06:02 -0000 1.3 *************** *** 60,65 **** <td>NSEWind</td> <td>Temp</td> - <td>Rel. Hum.</td> - <td>Baro. Pres.</td> <td>Cnt </td> </tr> --- 60,63 ---- *************** *** 118,130 **** $temp = "%"; } - - if ($rel_hum == "") { - $rel_hum = "%"; - } - - if ($baro_pres == "") { - $baro_pres = "%"; - } - $result = mysql_query("select * from $tblname --- 116,119 ---- |
From: <do...@us...> - 2003-12-17 13:08:26
|
Update of /cvsroot/firebug/firebug/project/src In directory sc8-pr-cvs1:/tmp/cvs-serv4292 Added Files: Makelocal Log Message: Cleaning up after recent adds. --- NEW FILE: Makelocal --- MTS420CA = $(HOME)/firebug/mts420ca XBOWROOT = /home/dave/local/tinyos-1.x/contrib/xbow #LOCAL_PATH += -I$(MTS420CA)/sensors/$(SENSORBOARD) #LOCAL_PATH += -I$(MTS420CA)/sensors/adg715 #LOCAL_PATH += -I$(MTS420CA)/sensors/sht11 #LOCAL_PATH += -I$(MTS420CA)/sensors/intersema5534ap #LOCAL_PATH += -I$(MTS420CA)/sensors/tsl250rd #LOCAL_PATH += -I$(MTS420CA)/interfaces/ #LOCAL_PATH += -I$(MTS420CA)/sensorboards/mts420ca #LOCAL_PATH += -I$(MTS420CA)/apps/TestFireBoardData ROUTE_PATH += -I$(BLASTROOT)/Sender \ -I$(BLASTROOT)/Interface \ -I$(BLASTROOT)/DataStructure \ -I$(BLASTROOT)/VirtualComm \ -I$(BLASTROOT)/ParentSelection LOCAL_PATH += $(ROUTE_PATH) XBOW_PATH = -I$(XBOWROOT)/tos/platform \ -I$(XBOWROOT)/tos/interfaces \ -I$(XBOWROOT)/tos/sensorboards/mts400 LOCAL_PATH += $(XBOW_PATH) PFLAGS := $(LOCAL_PATH) $(LOCAL_DEFINES) $(PFLAGS) CFLAGS = -DCC1K_DEFAULT_FREQ=CC1K_433_002_MHZ |
From: <do...@us...> - 2003-12-17 13:07:59
|
Update of /cvsroot/firebug/firebug/project/src/FireBug In directory sc8-pr-cvs1:/tmp/cvs-serv4212 Added Files: .cvsignore FireBug.nc FireBugM.nc Makefile Log Message: Added firebug files for rewriting application. --- NEW FILE: .cvsignore --- build --- NEW FILE: FireBug.nc --- /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ /** * Author: Terence Tong, Alec Woo, Max Min Chen, David M. Doolin */ includes RoutingStack; configuration FireBug { } implementation { components Main, FireBugM, MHSender, LedsC, MicaWbSwitch, VirtualComm, ParentSelection, UARTGpsPacket, TimerWrapper; //Accel; Main.StdControl -> FireBugM.StdControl; FireBugM.MultiHopSend -> MHSender.MultiHopSend[RS_DATA_TYPE]; ParentSelection.InForwardReceive -> VirtualComm.ReceiveMsg[RS_DATA_TYPE]; FireBugM.Timer1 -> TimerWrapper.Timer[unique("Timer")]; FireBugM.Timer2 -> TimerWrapper.Timer[unique("Timer")]; FireBugM.Leds -> LedsC; Main.StdControl -> MHSender.StdControl; // Wiring for gps FireBugM.GpsControl -> UARTGpsPacket; FireBugM.GpsSend -> UARTGpsPacket; FireBugM.GpsReceive -> UARTGpsPacket; FireBugM.GpsCmd -> UARTGpsPacket.GpsCmd; // Wiring for Accelerometer, not yet dealt with in Makelocal #if 0 FireBugM.AccelControl -> Accel.StdControl; FireBugM.AccelCmd -> Accel.AccelCmd; #endif } --- NEW FILE: FireBugM.nc --- /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil; font-lock-mode: t -*- */ /** * This is an example of a general application using the * Routing Stack to send message to * basestation. It store a message in its frame, * call getUsablePortion to get the right location * to add in its own data. passed the data down * the stack with the send command. A Send done * command will come back. A recomment way to send * another message is to have a one shot * Time. When the clock fired, we make another * attempt to send again. * * @author: Terence Tong, Alec Woo, Max Min Chen */ includes RoutingStack; includes gps; /** FIXME: Move these to the gps.h file. */ #define GPS_MSG_LENGTH 100 #define GPS_CHAR 11 #define GPS_FIELDS 8 #define GPS_CHAR_PER_FIELD 10 #define GPS_DELIMITER ',' #define GPS_END_MSG '*' module FireBugM { provides { interface StdControl; command result_t parseGPS(int8_t gga_string[GPS_MSG_LENGTH], uint8_t length); command result_t logGPS(char gga_fields[GPS_FIELDS][GPS_CHAR_PER_FIELD]); } uses { interface Send as MultiHopSend; interface Timer as Timer1; interface Timer as Timer2; interface Leds; interface I2CSwitchCmds as GpsCmd; interface StdControl as GpsControl; interface BareSendMsg as GpsSend; interface ReceiveMsg as GpsReceive; //Accels #if 0 interface StdControl as AccelControl; interface I2CSwitchCmds as AccelCmd; #endif } } #define DATA_FREQ 10000 implementation { #include "SODebug.h" #include "gps.h" TOS_Msg msgToSend; //GPS_MsgPtr gps_data; struct DataFormat_t { uint16_t addr; uint16_t cnt; float temp; float rel_hum; float baro_pres; }; uint16_t counter; uint8_t sending; char count; bool gps_active; //true if gps is active command result_t StdControl.init() { gps_active = TRUE; init_debug(); call Leds.init(); call GpsControl.init(); //call AccelControl.init(); //initialize accelerometer return SUCCESS; } command result_t StdControl.start() { int i; counter = 0; call GpsControl.start(); SODbg(DBG_USR2, "FireBugM.GpsControl.start() called\n"); call Timer1.start(TIMER_REPEAT, 5000); //if (! call GpsCmd.PowerSwitch(1)) { //turn on GPS power // call Leds.yellowToggle(); // SODbg(DBG_USR2, "Failed to power on gps \n"); //} call Leds.redToggle(); for (i = 0; i < 29; i++) { msgToSend.data[i] = 0; } return SUCCESS; } command result_t StdControl.stop() { return SUCCESS; } event result_t Timer1.fired() { //call GpsCmd.GpsPower(1); SODbg(DBG_USR2, "FireBugM.Timer1.fired()\n"); if (! call GpsCmd.PowerSwitch(1)) { //turn on GPS power call Leds.yellowToggle(); SODbg(DBG_USR2, "Failed to power on gps \n"); } return SUCCESS; } /** * When the clock fired we are ready to send, CollectData ask the stack * where in the data payload we can safely put our data. We then call * Multihop passed the pointer down the stack * * @author: terence * @param: void * @return: always return success */ event result_t Timer2.fired() { uint8_t *dataPortion; uint16_t availableLength = 0; struct DataFormat_t *df; SODbg(DBG_USR2, "FireBugM.Timer2.fired()\n"); if (sending == 1) { return SUCCESS; } dataPortion = call MultiHopSend.getBuffer(&msgToSend, &availableLength); df = (struct DataFormat_t *) dataPortion; df->addr = TOS_LOCAL_ADDRESS; df->cnt = counter++; //df->temp = gps_data->data[0]; //df->rel_hum = gps_data->data[1]; //df->baro_pres = gps_data->data[2]; sending = call MultiHopSend.send(&msgToSend, sizeof(struct DataFormat_t)); return SUCCESS; } /** * When a message is sent, send done event is trigger. We then schedule the * time to generate another message to send * * @author: terence * @param: void * @return: void */ event result_t MultiHopSend.sendDone(TOS_MsgPtr msg, uint8_t success) { sending = 0; call Timer2.stop(); return SUCCESS; } // ************************** //*Packet received from GPS* //************************** // //*The following should be executed in GpsPacket event TOS_MsgPtr GpsReceive.receive(TOS_MsgPtr data) { int8_t gga_string[GPS_MSG_LENGTH]; bool gga_read = FALSE; bool gga_read_done = FALSE; uint16_t i = 0; uint8_t j = 0; uint8_t k = 0; GPS_MsgPtr gps_data = (GPS_MsgPtr)data; SODbg(DBG_USR2, "gps_data:%i,\n", gps_data->length); for (k = 0; k <= gps_data->length ; k++) UARTPutChar(gps_data->data[k]); SODbg(DBG_USR2, "\n"); while (!gga_read_done) { if(gps_data->data[i] == 'G') { if(gps_data->data[i+1] == 'G') { if(gps_data->data[i+2] == 'A') { gga_read = TRUE; } } } if(gps_data->data[i] == GPS_END_MSG) { if(gga_read) { if(call GpsCmd.PowerSwitch(0)) { SODbg(DBG_USR2, "GPS Power Off\n"); } call parseGPS(gga_string, j); gga_read = FALSE; gga_read_done = TRUE; } } if(gga_read) { gga_string[j] = gps_data->data[i]; j++; } i++; } call Leds.greenToggle(); return data; } //**************** //*Parse GPS Data* //**************** //* //* Fields are comma delimited //* NMEA string parsed by field and stored into //* gga_fields array command result_t parseGPS(int8_t gga_string[GPS_MSG_LENGTH], uint8_t length) { char gga_fields[GPS_FIELDS][GPS_CHAR_PER_FIELD]; bool end_of_field = FALSE; uint8_t i=0; uint8_t j,m; uint16_t k=0; //***DEBUG: Output NMEA message*** uint16_t q; SODbg(DBG_USR2, "parse GPS: \n"); for(q=0; q<length; q++) UARTPutChar(gga_string[q]); SODbg(DBG_USR2, "\n"); //******************************** // Parse and store comma delimited fields into EEPROM while (i < GPS_FIELDS) { // assemble gga_fields array end_of_field = FALSE; j = 0; while (!end_of_field & k < length) { if (gga_string[k] == GPS_DELIMITER) { end_of_field = TRUE; } else { gga_fields[i][j] = gga_string[k]; } j++; k++; } // two commas (,,) indicate empty field // if field is empty, set it equal to 0 if (j <= 1) { for (m=0; m<10; m++) gga_fields[i][m] = '0'; } i++; } //call logGPS(gga_fields); return SUCCESS; } // ************** //*Log GGA data* //************** //* //* Assemble GGA message structure from gga_fields //* Store GGA data into line 25 of EEPROM command result_t logGPS(char gga_fields[GPS_FIELDS][GPS_CHAR_PER_FIELD]) { #if 0 GGA_Msg *pGGA; char gga_log_array[GPS_CHAR]; char NS; char EW; uint8_t j; uint8_t nos; // number of satellites // Assemble GGA_Msg pGGA->hours = 10*(gga_fields[1][0]-'0') + (gga_fields[1][1]-'0'); gga_log_array[0] = pGGA->hours; pGGA->minutes = 10*(gga_fields[1][2]-'0') + (gga_fields[1][3]-'0'); gga_log_array[1] = pGGA->minutes; pGGA->dec_sec = 10000*(gga_fields[1][4]-'0') + 1000*(gga_fields[1][5]-'0') + 100*(gga_fields[1][7]-'0') + 10*(gga_fields[1][8]-'0') + (gga_fields[1][9]-'0'); gga_log_array[2] = (pGGA->dec_sec)>>8; // MSB gga_log_array[3] = pGGA->dec_sec; // LSB pGGA->Lat_deg = 10*(gga_fields[2][0]-'0') + (gga_fields[2][1]-'0'); gga_log_array[4] = pGGA->Lat_deg; pGGA->Lat_dec_min = 100000*(gga_fields[2][2]-'0') + 10000*(gga_fields[2][3]-'0') + 1000*(gga_fields[2][4]-'0') + 100*(gga_fields[2][5]-'0') + 10*(gga_fields[2][6]-'0') + (gga_fields[2][7]-'0'); gga_log_array[5] = (pGGA->Lat_dec_min)>>8; gga_log_array[6] = pGGA->Lat_dec_min; pGGA->Long_deg = 100*(gga_fields[4][0]-'0') + 10*(gga_fields[4][1]-'0') + (gga_fields[4][2]-'0'); gga_log_array[7] = pGGA->Long_deg; pGGA->Long_dec_min = 100000*(gga_fields[4][3]-'0') + 10000*(gga_fields[4][4]-'0') + 1000*(gga_fields[4][5]-'0') + 100*(gga_fields[4][6]-'0') + 10*(gga_fields[4][7]-'0') + (gga_fields[4][8]-'0'); gga_log_array[8] = (pGGA->Long_dec_min)>>8; gga_log_array[9] = pGGA->Long_dec_min; NS = (gga_fields[3][0] == 'N') ? 1 : 0; EW = (gga_fields[5][0] == 'W') ? 1 : 0; pGGA->NSEWind = EW | (NS<<4); // eg. Status = 000N000E = 00010000 gga_log_array[10] = pGGA->NSEWind; nos = 10*(gga_fields[7][0]-'0') + (gga_fields[7][1]-'0'); //***DEBUG: Output GGA data before gga_fields*** SODbg(DBG_USR2, "LOGGER GPS:\n"); for(j=0; j<11; j++) UARTPutChar(gga_log_array[j]); SODbg(DBG_USR2, "\n"); //***************************************** #endif return SUCCESS; } /****************************************************************************** * Packet received from GPS - ASCII msg * 1st byte in pkt is number of ascii bytes * async used only for testing *****************************************************************************/ //((((((((((((((This is a alternative way from the above)))))))))))))) /* event TOS_MsgPtr GpsReceive.receive(TOS_MsgPtr data) { //change to GPS packet!! uint8_t i; GPS_MsgPtr gps_data = (GPS_MsgPtr)data; //gps_data = (GPS_MsgPtr)data; call Leds.greenToggle(); //for (i = 0; i <= gps_data->data[0] ; i++) UARTPutChar(gps_data->data[i]); for (i = 0; i <= gps_data->length ; i++) UARTPutChar(gps_data->data[i]); SODbg(DBG_USR2, "\n"); call Timer2.start(TIMER_ONE_SHOT,300); return data; } */ event result_t GpsSend.sendDone(TOS_MsgPtr msg, result_t success) { return SUCCESS; } event result_t GpsCmd.SwitchesSet(uint8_t PowerState){ gps_active = TRUE; call Leds.yellowToggle(); SODbg(DBG_USR2, "Gps power on \n"); return SUCCESS; } #if 0 event result_t AccelCmd.SwitchesSet(uint8_t PowerState){ return SUCCESS; } #endif } --- NEW FILE: Makefile --- COMPONENT=FireBug SENSORBOARD=leadtek9546 include ../Makelocal include $(TOSROOT)/apps/Makerules |
From: <do...@us...> - 2003-12-17 13:06:58
|
Update of /cvsroot/firebug/firebug/project/src/FireBase In directory sc8-pr-cvs1:/tmp/cvs-serv4064 Added Files: .cvsignore FireBase.nc FireBaseM.nc Makefile Log Message: Added files for firebase. --- NEW FILE: .cvsignore --- build --- NEW FILE: FireBase.nc --- /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ /** * @author Terence Tong * @author Alec Woo * @author Max Min Chen * @author David M. Doolin */ includes RoutingStack; configuration FireBase { } implementation { components Main, FireBaseM, MHSender, TimerWrapper, LedsC, VirtualComm, ParentSelection; Main.StdControl -> FireBaseM.StdControl; Main.StdControl -> MHSender.StdControl; FireBaseM.MultiHopSend -> MHSender.MultiHopSend[RS_DATA_TYPE]; FireBaseM.Timer -> TimerWrapper.Timer[unique("Timer")]; FireBaseM.Leds -> LedsC; ParentSelection.InForwardReceive -> VirtualComm.ReceiveMsg[RS_DATA_TYPE]; } --- NEW FILE: FireBaseM.nc --- /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ /** * This is an example of a general application using * the Routing Stack to send message to * basestation. It store a message in its frame, call * getUsablePortion to get the right location * to add in its own data. passed the data down the * stack with the send command. A Send done * command will come back. A recommended way to send * another message is to have a one shot * Time. When the clock fired, we make another attempt to send again * * @author Terence Tong * @author Alec Woo * @author Max Min Chen * @author David M. Doolin */ includes RoutingStack; module FireBaseM { provides { interface StdControl; } uses { interface Send as MultiHopSend; interface Timer as Timer; interface Leds; } } #define DATA_FREQ 3000 implementation { TOS_Msg msgToSend; struct DataFormat_t { uint8_t addr; uint8_t cnt; uint8_t sampledata; }; uint8_t counter; uint8_t sending; command result_t StdControl.init() { return SUCCESS; } command result_t StdControl.start() { int i; counter = 0; for (i = 0; i < 29; i++) { msgToSend.data[i] = 0; } //call Timer.start(TIMER_REPEAT, DATA_FREQ); return SUCCESS; } command result_t StdControl.stop() { return SUCCESS; } /*////////////////////////////////////////////////////////*/ /** * When the clock fired we are ready to send, collectdata ask the stack * where in the data payload we can safely put our data. We then call * Multihop passed the pointer down the stack * @author: terence * @param: void * @return: always return success */ event result_t Timer.fired() { uint8_t result; // struct DataFormat_t *dataPortion; uint8_t *dataPortion; uint16_t availableLength = 0; struct DataFormat_t *df; if (sending == 1) return SUCCESS; dataPortion = call MultiHopSend.getBuffer(&msgToSend, &availableLength); df = (struct DataFormat_t *) dataPortion; df->addr = TOS_LOCAL_ADDRESS; df->cnt = counter++; df->sampledata=1; sending = 1; result = call MultiHopSend.send(&msgToSend, sizeof(struct DataFormat_t)); return SUCCESS; } /** * When a message is sent, send done event is trigger. We then schedule the * time to generate another message to send * * @author: terence * @param: void * @return: void */ event result_t MultiHopSend.sendDone(TOS_MsgPtr msg, uint8_t success) { sending = 0; return SUCCESS; } } --- NEW FILE: Makefile --- COMPONENT=FireBase SENSORBOARD=leadtek9546 include ../Makelocal include $(TOSROOT)/apps/Makerules |
From: <do...@us...> - 2003-12-17 13:05:01
|
Update of /cvsroot/firebug/firebug/project/src/multihop In directory sc8-pr-cvs1:/tmp/cvs-serv3687/multihop Modified Files: Makefile Log Message: Added FireBug directory and files for rewrite of CollectData application. Index: Makefile =================================================================== RCS file: /cvsroot/firebug/firebug/project/src/multihop/Makefile,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Makefile 5 Nov 2003 05:14:52 -0000 1.19 --- Makefile 17 Dec 2003 13:04:58 -0000 1.20 *************** *** 17,21 **** UISP_FLAGS = -dprog=dapa $(UISP_EXTRA_FLAGS) TOSROOT=/cygdrive/c/tinyos/cygwin/opt ! BLASTROOT=/cygdrive/c XBOWROOT = $(TOSROOT)/tinyos-1.x/contrib/xbow --- 17,21 ---- UISP_FLAGS = -dprog=dapa $(UISP_EXTRA_FLAGS) TOSROOT=/cygdrive/c/tinyos/cygwin/opt ! BLASTROOT=/cygdrive/c/cygwin/home/dave/local/Blast-0.1 XBOWROOT = $(TOSROOT)/tinyos-1.x/contrib/xbow *************** *** 26,34 **** #CC1000=-I/cygdrive/d/tinyos-1.x/tos/platform/mica2 ! INCLUDES=-I$(BLASTROOT)/Blast-0.11/Sender \ ! -I$(BLASTROOT)/Blast-0.11/Interface \ ! -I$(BLASTROOT)/Blast-0.11/DataStructure \ ! -I$(BLASTROOT)/Blast-0.11/VirtualComm \ ! -I$(BLASTROOT)/Blast-0.11/ParentSelection \ -I$(TOSROOT)/tinyos-1.x/tos \ -I$(XBOWROOT)/tos/platform \ --- 26,34 ---- #CC1000=-I/cygdrive/d/tinyos-1.x/tos/platform/mica2 ! INCLUDES=-I$(BLASTROOT)/Sender \ ! -I$(BLASTROOT)/Interface \ ! -I$(BLASTROOT)/DataStructure \ ! -I$(BLASTROOT)/VirtualComm \ ! -I$(BLASTROOT)/ParentSelection \ -I$(TOSROOT)/tinyos-1.x/tos \ -I$(XBOWROOT)/tos/platform \ |
From: <do...@us...> - 2003-12-17 13:01:41
|
Update of /cvsroot/firebug/firebug/project/src/FireBug In directory sc8-pr-cvs1:/tmp/cvs-serv3072/FireBug Log Message: Directory /cvsroot/firebug/firebug/project/src/FireBug added to the repository |