communication:protocol
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
communication:protocol [2010/04/16 22:18] – danielrichman | communication:protocol [2015/04/03 09:49] (current) – removed eroneous , at the end of the example mfa298 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Communications Protocol ====== | ====== 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 is the typical protocol used by UKHAS members to transmit GPS data balloon to ground on the unlicensed bands. Parsing is handled by [[http:// |
- | This doesn' | + | < |
- | | + | |
+ | * CALLSIGN simply identifies your balloon - doesn' | ||
+ | * sentence_id (sometimes known as count, sequence, incremental counter...) 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 power on, or whatever you want. It just has to increase each time a new string is sent. | ||
+ | * latitude and longitude can either be in decimal degrees (DD.dddd) or the NMEA format (DDMM.mmmm). If using decimal degrees take care that your conversion code does not break if it crosses the meridian. While the NMEA format is accepted you will still need to parse whether it its NSEW and use +/- appropriately. | ||
+ | * The checksum is very strongly recommended. We support CRC16_CCITT, NMEA XOR and a couple of variants of Fletcher 16 checksums; however: the CRC16_CCITT is the most popular and is far better than xor, which is mainly supported for old payloads. There have actually been real xor collisions. | ||
+ | * 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. Although both will work, please use ' | ||
+ | | ||
- | | + | |
- | | + | |
- | * The checksum is optional, but not for much longer! :). It must either be the NMEA XOR format or the CRC16_CITT | + | |
- | * After "< | + | |
- | | + | |
- | | + | |
+ | $$hadie, | ||
- | $$ALIEN1,1,12:13:11,50.904072,00.026106,09001,temperature: | + | |
+ | | ||
- | $$icarus, | + | **Usage example for the below two functions** |
+ | <code c># | ||
+ | #include <stdint.h> | ||
+ | #include <string.h> | ||
- | | + | char s[100]; |
+ | |||
+ | void make_string(struct information i) | ||
+ | { | ||
+ | char checksum[10]; | ||
+ | |||
+ | snprintf(s, | ||
+ | |||
+ | snprintf(checksum, sizeof(checksum), " | ||
+ | // or snprintf(checksum, sizeof(checksum), " | ||
+ | |||
+ | // It would be much more efficient to use the return value of snprintf here, rather than strlen | ||
+ | |||
+ | if (strlen(s) > sizeof(s) | ||
+ | { | ||
+ | // Don't overflow the buffer. You should have made it bigger. | ||
+ | return; | ||
+ | } | ||
+ | |||
+ | // Also copy checksum' | ||
+ | memcpy(s + strlen(s), checksum, strlen(checksum) + 1); | ||
+ | }</ | ||
**Useful code to calculate NMEA xor checksum** | **Useful code to calculate NMEA xor checksum** | ||
+ | |||
+ | Please note: The use of xor checksum for payload telemetry is not advised, this code is useful for checking sentences sent by the GPS. The CCITT checksum below has much better performance and is preferred for payload telemetry | ||
<code c># | <code c># | ||
Line 27: | Line 58: | ||
#include < | #include < | ||
- | // Usage example: sprintf (checksum, " | + | uint8_t |
- | + | ||
- | uint8_t | + | |
{ | { | ||
size_t i; | size_t i; | ||
Line 48: | Line 77: | ||
**Useful code to calculate CRC16_CCITT checksum on the AVR** | **Useful code to calculate CRC16_CCITT checksum on the AVR** | ||
+ | |||
+ | (Refer to [[http:// | ||
<code c># | <code c># | ||
Line 54: | Line 85: | ||
#include < | #include < | ||
- | // Usage example: sprintf(checksum, | + | uint16_t gps_CRC16_checksum (char *string) |
- | + | ||
- | uint16_t gps_CRC16_checksum (char * string) | + | |
{ | { | ||
size_t i; | size_t i; | ||
Line 73: | Line 102: | ||
return crc; | return crc; | ||
}</ | }</ | ||
+ | ====== Getting Your Payload On the Tracker ====== | ||
+ | You will need to fill out a flight document so the server can parse your telemetry strings and update the map.\\ | ||
+ | Fill out the form here : |
communication/protocol.1271456313.txt.gz · Last modified: 2010/04/16 22:18 by danielrichman