GPS working with LoRa code - can't transmit faster that once every 6 seconds

Dependencies:   mbed LoRaWAN-lib_gps_lora SingleFrequencyLora

Committer:
Rishin
Date:
Wed Nov 29 15:01:09 2017 +0000
Revision:
15:b4d11baea8bc
Parent:
13:66d854ad31d8
publishining gps with lora

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Rishin 5:850a9db98a41 1 /*
Rishin 5:850a9db98a41 2 * l86.h
Rishin 5:850a9db98a41 3 * Author: Rishin Amin
Rishin 5:850a9db98a41 4 * library header file for communication with the Quectel L86 MT33 GPS module
Rishin 5:850a9db98a41 5 *
Rishin 5:850a9db98a41 6 */
Rishin 5:850a9db98a41 7
Rishin 5:850a9db98a41 8 #ifndef l86_hpp
Rishin 5:850a9db98a41 9 #define l86_hpp
Rishin 5:850a9db98a41 10
Rishin 5:850a9db98a41 11 #define DEBUGGER // uncomment to output serial data to PC
Rishin 5:850a9db98a41 12
Rishin 15:b4d11baea8bc 13
Rishin 15:b4d11baea8bc 14 #define TEST_NODE_ID "666"
Rishin 15:b4d11baea8bc 15 #define TEST_NODE_TYPE "R"
Rishin 15:b4d11baea8bc 16
Rishin 6:670ff1507ff4 17 /* PIN DEFINITIONS */
Rishin 13:66d854ad31d8 18 // #define RESET_PIN PB_14
Rishin 13:66d854ad31d8 19 // #define FORCE_ON_PIN PB_15
Rishin 13:66d854ad31d8 20 // #define ONEPPS_PIN PA_8
Rishin 6:670ff1507ff4 21 #define GPS_RX PA_10
Rishin 6:670ff1507ff4 22 #define GPS_TX PA_9
Rishin 6:670ff1507ff4 23 #define PC_RX PC_5
Rishin 6:670ff1507ff4 24 #define PC_TX PC_4
Rishin 6:670ff1507ff4 25 #define GPS_STATUS_LED LED1
Rishin 6:670ff1507ff4 26
Rishin 6:670ff1507ff4 27 /* PMTK MMESSAGE DEFINITIONS */
Rishin 6:670ff1507ff4 28 #define MAX_NMEA_LENGTH 82 // maximum length of an NMEA sentence
Rishin 5:850a9db98a41 29 #define PMTK_SET_NMEA_OUTPUT_RMC "$PMTK314,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29\r\n"
Rishin 5:850a9db98a41 30 #define PMTK_SET_UPDATE_F_2HZ "$PMTK300,500,0,0,0,0*28\r\n"
Rishin 6:670ff1507ff4 31 #define PMTK_COLD_RESTART "$PMTK104*37\r\n"
Rishin 6:670ff1507ff4 32 #define PMTK_WARM_START "$PMTK102*31\r\n"
Rishin 6:670ff1507ff4 33 #define PMTK_HOT_START "$PMTK101*32\r\n"
Rishin 6:670ff1507ff4 34 #define PMTK_ALWAYS_LOCATE_STANDDBY "$PMTK225,8*23\r\n"
Rishin 6:670ff1507ff4 35 #define PMTK_ALWAYS_LOCATE_BACKUP "$PMTK225,922\r\n*"
Rishin 7:1c90f51096fe 36 #define PMTK_STANDBY_MODE "$PMTK161,0*28\r\n" // Any UART data will retrun to Full-on mode
Rishin 6:670ff1507ff4 37 #define PMTK_BACKUP_MODE "$PMTK225,4*2F\r\n" // Force_on must be low before entering backup mode!
Rishin 6:670ff1507ff4 38 // Pull Force_on high to exit backup mode
Rishin 6:670ff1507ff4 39
Rishin 6:670ff1507ff4 40
Rishin 5:850a9db98a41 41
Rishin 5:850a9db98a41 42 static const char GPRMC_Tag[] = "$GPRMC";
Rishin 5:850a9db98a41 43 static const char GNRMC_Tag[] = "$GNRMC";
Rishin 5:850a9db98a41 44
Rishin 5:850a9db98a41 45 typedef struct RMC_data
Rishin 5:850a9db98a41 46 {
Rishin 5:850a9db98a41 47 char Message[MAX_NMEA_LENGTH]; /* Un-parsed NMEA sentence */
Rishin 5:850a9db98a41 48 char Message_ID[7]; /* RMC Protocol header */
Rishin 5:850a9db98a41 49 char UTC_Time[11]; /* hhmmss.sss */
Rishin 5:850a9db98a41 50 char Status[2]; /* A = data valid, V = data NOT valid */
Rishin 5:850a9db98a41 51 char Latitude[10]; /* ddmm.mmmm */
Rishin 5:850a9db98a41 52 char N_S_Indicator[3]; /* N = North, S = South */
Rishin 5:850a9db98a41 53 char Longitude[11]; /* dddmm.mmmm */
Rishin 5:850a9db98a41 54 char E_W_Indicator[3]; /* E = East, W = West */
Rishin 5:850a9db98a41 55 char Speed_Over_Ground[5]; /* In Knots */
Rishin 5:850a9db98a41 56 char Course_Over_Ground[7]; /* Degrees */
Rishin 5:850a9db98a41 57 char Date[7]; /* ddmmyy */
Rishin 6:670ff1507ff4 58 char Mode[5]; /* N = No Fix, A = autonomous mode, D = Differential mode + checksum */
Rishin 7:1c90f51096fe 59 }RMC_data;
Rishin 5:850a9db98a41 60
Rishin 10:0b5a507b4a4d 61 typedef struct GPS_data
Rishin 10:0b5a507b4a4d 62 {
Rishin 11:f2a7f98cc9bf 63 char UTC_Time[11];
Rishin 11:f2a7f98cc9bf 64 char Latitude[11];
Rishin 11:f2a7f98cc9bf 65 char Longitude[12];
Rishin 11:f2a7f98cc9bf 66 char Speed_Over_Ground[5];
Rishin 11:f2a7f98cc9bf 67 char Course_Over_Ground[7];
Rishin 15:b4d11baea8bc 68 // char Date[7];
Rishin 10:0b5a507b4a4d 69 char Valid[2];
Rishin 15:b4d11baea8bc 70 char Node_ID[4];
Rishin 15:b4d11baea8bc 71 char Node_Type[2];
Rishin 10:0b5a507b4a4d 72 }GPS_data;
Rishin 10:0b5a507b4a4d 73
Rishin 10:0b5a507b4a4d 74 RMC_data Parse_RMC_sentence(char RMC_sentence[MAX_NMEA_LENGTH]);
Rishin 7:1c90f51096fe 75 void Print_RMC_data(RMC_data *RMC_data_print);
Rishin 10:0b5a507b4a4d 76 GPS_data Parse_RMC_data(RMC_data RMC_parsed);
Rishin 10:0b5a507b4a4d 77 void Print_GPS_data(GPS_data GPS_data_print);
Rishin 5:850a9db98a41 78
Rishin 5:850a9db98a41 79 #endif
Rishin 5:850a9db98a41 80