Changeset - d62f0f469869
[Not reviewed]
default
0 7 0
ethanzonca@CL-ENS241-08.cedarville.edu - 12 years ago 2013-01-15 18:53:48
ethanzonca@CL-ENS241-08.cedarville.edu
APRS tracking functional
7 files changed with 35 insertions and 7 deletions:
0 comments (0 inline, 0 general)
master/master/config.h
Show inline comments
 
@@ -81,7 +81,7 @@
 
// --------------------------------------------------------------------------
 

	
 
// TX delay in milliseconds
 
#define TX_DELAY      300
 
#define TX_DELAY      500
 

	
 
// Maximum packet delay
 
#define MAX_PACKET_LEN 512  // bytes
 
@@ -118,7 +118,7 @@
 
#define APRS_COMMENT    "CU HAB TEST"
 
 
// Transmit the APRS sentence every X milliseconds
 
#define APRS_TRANSMIT_PERIOD 10000
 
#define APRS_TRANSMIT_PERIOD 30000
 

	
 

	
 
// --------------------------------------------------------------------------
master/master/lib/aprs.c
Show inline comments
 
@@ -47,7 +47,8 @@ void aprs_send()
 
  ax25_send_header(addresses, sizeof(addresses)/sizeof(addresses[0]));
 
  ax25_send_byte('/');                // Report w/ timestamp, no APRS messaging. $ = NMEA raw data
 
  // ax25_send_string("021709z");     // 021709z = 2nd day of the month, 17:09 zulu (UTC/GMT)
 
  ax25_send_string(get_timestamp());         // 170915 = 17h:09m:15s zulu (not allowed in Status Reports)
 
  ax25_send_string(get_dayofmonth()); ///! Needs to be day hour minute        // 170915 = 17h:09m:15s zulu (not allowed in Status Reports)
 
  ax25_send_string(get_timestamp()); 
 
  ax25_send_byte('z'); // zulu time. h for nonzulu
 
  ax25_send_string(get_latitude());     // Lat: 38deg and 22.20 min (.20 are NOT seconds, but 1/100th of minutes)
 
  ax25_send_byte('N');
master/master/lib/serial.c
Show inline comments
 
@@ -39,6 +39,8 @@ void serial0_setup() {
 
 
 
 
 
 
void serial1_setup() {
 
//PROVEN in test project
 
 
@@ -54,6 +56,15 @@ void serial1_setup() {
 
	UCSR1B |= (1 << RXCIE1); // Enable interrupt
 
}
 
 
void serial1_ion() {
 
	UCSR1B |= (1<<RXEN1); // Enable rx
 
	UCSR1B |= (1 << RXCIE1); // Enable interrupt
 
}
 
void serial1_ioff() {
 
	UCSR1B &= ~(1<<RXEN1); // Disable rx
 
	UCSR1B &= ~(1 << RXCIE1); // Disable interrupt
 
}
 
 
void serial0_sendChar( unsigned char byte )
 
{
 
	while (!(UCSR0A & (1<<UDRE0)));
master/master/lib/serial.h
Show inline comments
 
@@ -31,5 +31,7 @@ void serial1_sendString(const char* stri
 
void serial_sendCommand( char moduleID, char sensorID, char* data );
 
void serial_sendResponseData();
 
 
void serial1_ion();
 
void serial1_ioff();
 
 
#endif /* SERIAL_H_ */
 
\ No newline at end of file
master/master/lib/trackuinoGPS/gpsMKa.c
Show inline comments
 
@@ -92,7 +92,11 @@ char* get_course() {
 
	return course;
 
}
 
	
 
char datestamp[9];	//ddmmyy
 
char dayofmonth[9];	//ddmmyy
 
char* get_dayofmonth() {
 
	return dayofmonth;
 
}
 

	
 
char variation[9];	//xxx.xb
 
int calculatedChecksum;
 
int receivedChecksum;
 
@@ -241,7 +245,7 @@ void parse_gps_transmission(void){
 
		{
 
			if (byte == ',') //end of this data type
 
			{
 
				timestamp[6] = 0x00; // Cut off at 6 for APRS
 
				timestamp[4] = 0x00; // Cut off at 4 (no seconds) for APRS
 
				setParserState(GGA_LATITUDE);
 
				skipBytes = 0; //prep for next phase of parse
 
				numBytes = 0;
 
@@ -610,7 +614,8 @@ void parse_gps_transmission(void){
 
		{
 
			if (byte == ',') //end of this data type
 
			{
 
				datestamp[numBytes] = 0x00;
 
				// Cut it off at day of month. Also has month and year if we ever need it.
 
				dayofmonth[2] = 0x00;
 
				setParserState(RMC_MAG_VARIATION);
 
				skipBytes = 0; //prep for next phase of parse
 
				numBytes = 0;
 
@@ -618,7 +623,7 @@ void parse_gps_transmission(void){
 
			else //store data
 
			{
 
				setParserState(RMC_DATE);
 
				datestamp[numBytes] = byte; //adjust number of bytes to fit array
 
				dayofmonth[numBytes] = byte; //adjust number of bytes to fit array
 
				numBytes++;
 
			}
 
		}
master/master/lib/trackuinoGPS/gpsMKa.h
Show inline comments
 
@@ -19,5 +19,6 @@ char* get_speedKnots();
 
char* get_course();
 
char* get_hdop();
 
char* getNumSatelites();
 
char* get_dayofmonth();
 
 
#endif /* GPSMKA_H_ */
 
\ No newline at end of file
master/master/master.c
Show inline comments
 
@@ -78,6 +78,7 @@ int main(void)
 
	
 
	uint8_t ctr = 0;
 
	void spin() {
 
		
 
		if(ctr == 0) {
 
			led_on(LED_ACT0);
 
			led_off(LED_ACT1);
 
@@ -105,12 +106,17 @@ int main(void)
 
		ctr = (ctr + 1) % 4;
 
	}
 
	
 
	serial1_ioff();
 
	
 
	while(1)
 
    {
 
		
 
		// Periodic: LED execution indicator
 
		if(time_millis() - lastLedCycle > LEDCYCLE_RATE) {
 
			spin();
 
			
 
			if(!afsk_busy())
 
				serial1_ion();
 
			lastLedCycle = time_millis();	
 
		}
 
		
 
@@ -119,6 +125,7 @@ int main(void)
 
		{
 
			led_on(LED_CYCLE);
 
			
 
			
 
			// Print out GPS debug
 
			snprintf(debugBuf, 128, "GPS> time: %s lat: %s lon: %s speed: %s hdop: %s course: %s\r\n",
 
			get_timestamp(),get_latitude(),get_longitude(),get_speedKnots(),get_hdop(), get_course());
 
@@ -142,6 +149,7 @@ int main(void)
 
		if(time_millis() - lastAprsBroadcast > APRS_TRANSMIT_PERIOD) 
 
		{
 
			while(afsk_busy());
 
			serial1_ioff();
 
			aprs_send(); // non-blocking
 
			
 
			//serial0_sendString("Initiating APRS transmission...\r\n");
0 comments (0 inline, 0 general)