Scorpion Software

Project to send a balloon into lower space with payload
Post Reply
Rris
Posts: 66
Joined: Mon 12 Oct 12 2009 9:17 pm

Scorpion Software

Post by Rris » Thu 09 Dec 09 2010 1:20 pm

Thesea re my initial thoughts on a protocol for sending data down. It runs at 432bps at 1hz. At 2400bps comms rate, i'm using just 18% of it's capacity.

Code: Select all

General Packet Structure (12 bytes/96 bits)		
16	0x23,0x23	Sync
8	[byte]	Packet type (sequential enum value)
8	[byte]	Packet ID (sequentially numbered)
24	[ushort+byte]	Date/Time (see below)
16	[ushort]	Miliseconds (includes seconds.. eg 42.186 = 42186)
8	[byte]	Data Length (byte length)
?	[byte array]	Payload
8	[byte]	Checksum (A) - Fletcher Algorithm, which is used in the TCP standard (RFC 1145).
8	[byte]	Checksum (B)   Everything except sync bytes are checksummed
		
{0} System Health Packet (10 bytes/80 bits)		
8	[sbyte] 	MCU Temperature (no decimal value)
8	[sbyte] 	Board Temperature (no decimal value)
8	[sbyte] 	Outside Temperature (no decimal value)
8	[sbyte] 	Battery Temperature (no decimal value)
16	[ushort]	Current consumption (mAh)
16	[ushort]	Current usage (mA * 10)
16	[ushort]	Battery voltage (v * 1000)
		
		
{1} GPS Data Packet (20 bytes/160 bits)		
16	[ushort]	Altitude (m)
32	[uint]	Latitude (see below)
32	[unit]	Longitude (see below)
16	[ushort]	Ground Speed (m/h)
8	[byte]	satellite count
8	[byte]	Fix Type (enum flags)
16	[ushort]	PDOP (*100)
16	[ushort]	HDOP (*100)
16	[ushort]	VDOP (*100)
		
		
		
Date/Time is:		
5 bits Day		
4 Bits Month		
4 bits Year (double digit format)		
5 bits Hour (24hr)		
6 bits Minute		
		
WGS84 Coordinates (32 bit)		
First bit is Cardinal, 1-N, 0-S / 1-E, 0-W		
ddd * 1,000,000		
mm * 10,000		
ssss		


Rris
Posts: 66
Joined: Mon 12 Oct 12 2009 9:17 pm

Re: Scorpion Software

Post by Rris » Mon 03 Jan 03 2011 10:01 pm

Today I worked on the RF protocol some more. I now have a PC app sending data to a NetMF application via serial, or a NetMF app sending to PC. This has the full packet data implemented except using USB to TTL rather than the aerocomms. Everything is handle and debugged very well - it doesn't mind getting fragmented packets, it will recover. The code is very robust and extensible.

Once i've written some more code for sensors and GPS I'll be doing a range test with the aerocomms.

Daniel Wee
Site Admin
Posts: 2073
Joined: Wed 25 Feb 25 2009 8:00 pm

Re: Scorpion Software

Post by Daniel Wee » Mon 03 Jan 03 2011 10:59 pm

Is your code dependent on hand-shaking?

Daniel

Rris
Posts: 66
Joined: Mon 12 Oct 12 2009 9:17 pm

Re: Scorpion Software

Post by Rris » Tue 04 Jan 04 2011 5:24 pm

No it's not, it's simply send/receive. It doesn't even send an acknowledged packet as i'm not sure if the link will be maintained across the flight.

Post Reply