UKHAS Wiki

UK High Altitude Society

User Tools

Site Tools


communication:protocol

This is an old revision of the document!


Communications Protocol

This is the typical protocol used by UKHAS members to transmit GPS data balloon to ground on the unlicensed bands, although any custom data may be tacked onto the end of the string.

This doesn't have to be strictly adhered to, since we can easily set up different rules via dl-fldigi's ability to automatically configure itself (upon request).

$$<CALL SIGN>,<COUNTER D>,<TIME HH:MM:SS>,<LATITUDE DD.DDDDDD>,<LONGITUDE DD.DDDDDD>,<ALTITUDE METRES MMMMM>,<O SPEED KM/H DDDD.DD>,<O BEARING DDD.DD>,<O TEMPERATURE INTERNAL C D.DD>,<O TEMPERATURE EXTERNAL C D.DD>,<O TEMPERATURE CAMERA C D.DD>,<O BAROMETRIC PRESSURE hPa(millibars)>,<O CUSTOM DATA>*<CHECKSUM><NEWLINE>
  • <CALL SIGN> simply identifies your balloon - doesn't have to be a real, licensed callsign.
  • <INCREMENTAL COUNTER ID> also helps people receiving many transmissions at once. This should go up for each new transmission. It can go up 1, 2, 3, or be the milliseconds since poweron, or whatever you want. It just has to increase each time a new string is sent.
  • The checksum is optional, but not for much longer! :). It must either be the NMEA XOR format or the CRC16_CITT
  • After “<ALTITUDE>,” the distributed tracker or anyone else not prepared for your custom data will not plot your data however the DL system will log the data for review. If you want to send anything else down, you can do so in that space.
  • The newline at the end IS required. It does make the protocol much more easier to human-read, and dl-fldigi looks for that character to terminate the string.
  • Here are example strings:
$$ALIEN1,1,12:13:11,50.904072,00.026106,09001,temperature: 14
$$icarus,12342,12:34:17,52.345645,-1.02342,10232,21.35,192.3,15.4,-22.34,-18.27,1232
$$icarus,12342,12:34:17,52.345645,-1.02342,10232,21.35,192.3,15.4,-22.34,-18.27,1232,Blah;Blah;Blah*00

Useful code to calculate NMEA xor checksum

sprintf (checksum, "*%02X\n",gps_checksum(string));

unsigned int gps_checksum (char * string)
{
	unsigned int i;
	unsigned int XOR;
	unsigned int c;

	XOR = 0;

	// Calculate checksum ignoring the first two $s
	for (i = 2; i < strlen(string); i++)
	{
		c = (unsigned char) string[i];
		XOR ^= c;
	}

	return XOR;
	
}

Useful code to calculate CRC16_CCITT checksum on the AVR

#include <util/crc16.h>

unsigned int gps_CRC16_checksum (char * string)
{
	unsigned int i;
	unsigned int crc;

	crc = 0xFFFF;

	// Calculate checksum ignoring the first two $s
	for (i = 2; i < strlen(string); i++)
	{
		crc = _crc_xmodem_update (crc,(uint8_t)string[i]);
	}

	return crc;
}
communication/protocol.1271454083.txt.gz · Last modified: 2010/04/16 21:41 by danielrichman