diff --git a/LightAPRS-pico-balloon/LightAPRS-pico-balloon.ino b/LightAPRS-pico-balloon/LightAPRS-pico-balloon.ino index 0b59032..bdd11ae 100644 --- a/LightAPRS-pico-balloon/LightAPRS-pico-balloon.ino +++ b/LightAPRS-pico-balloon/LightAPRS-pico-balloon.ino @@ -41,7 +41,7 @@ char Symbol='O'; // '/O' for balloon, '/>' for car, for more info : http://www. bool alternateSymbolTable = false ; //false = '/' , true = '\' char comment[50] = "http://www.lightaprs.com"; // Max 50 char -char StatusMessage[50] = "LightAPRS by TA9OHC & TA2MUN"; +char StatusMessage[50] = "LightAPRS by TA2NHP & TA2MUN"; //***************************************************************************** @@ -120,6 +120,8 @@ void setup() { APRS_setPath2("WIDE2", Wide2); APRS_useAlternateSymbolTable(alternateSymbolTable); APRS_setSymbol(Symbol); + //increase following value (for example to 500UL) if you experience packet loss/decode issues. + APRS_setPreamble(350UL); APRS_setPathSize(pathSize); AprsPinInput; @@ -386,7 +388,19 @@ void updateTelemetry() { telemetry_buff[7] = '/'; telemetry_buff[8] = 'A'; telemetry_buff[9] = '='; - sprintf(telemetry_buff + 10, "%06lu", (long)gps.altitude.feet()); + //sprintf(telemetry_buff + 10, "%06lu", (long)gps.altitude.feet()); + + //fixing negative altitude values causing display bug on aprs.fi + float tempAltitude = gps.altitude.feet(); + + if (tempAltitude>0){ + //for positive values + sprintf(telemetry_buff + 10, "%06lu", (long)tempAltitude); + } else{ + //for negative values + sprintf(telemetry_buff + 10, "%06d", (long)tempAltitude); + } + telemetry_buff[16] = ' '; sprintf(telemetry_buff + 17, "%03d", TxCount); telemetry_buff[20] = 'T'; diff --git a/libraries/LightAPRS_Geofence/GEOFENCE.cpp b/libraries/LightAPRS_Geofence/GEOFENCE.cpp index fb0f479..3e2b97a 100755 --- a/libraries/LightAPRS_Geofence/GEOFENCE.cpp +++ b/libraries/LightAPRS_Geofence/GEOFENCE.cpp @@ -101,10 +101,11 @@ int32_t pointInPolygonF(int32_t polyCorners, float * polygon, float latitude, fl Indonesia 144.390 Malaysia 144.390 - NO AIRBORNE APRS: - France + NO AIRBORNE APRS: Latvia + North Korea United Kingdom + Yemen Expected input FLOAT for latitude and longitude as in GPS_UBX_latitude_Float and GPS_UBX_longitude_Float. */ @@ -120,6 +121,7 @@ void GEOFENCE_position(float latitude, float longitude) { if(pointInPolygonF(9, UKF, latitude, longitude) == 1) {GEOFENCE_no_tx = 1;GEOFENCE_APRS_frequency = 144800000;} else if(pointInPolygonF(10, LatviaF, latitude, longitude) == 1) {GEOFENCE_no_tx = 1;GEOFENCE_APRS_frequency = 144800000;} + else if(pointInPolygonF(5, YemenF, latitude, longitude) == 1) {GEOFENCE_no_tx = 1;GEOFENCE_APRS_frequency = 144800000;} else {GEOFENCE_no_tx = 0; GEOFENCE_APRS_frequency = 144800000;} } @@ -158,9 +160,10 @@ void GEOFENCE_position(float latitude, float longitude) // S 1/2 if(latitude > 19.2) - { - if(pointInPolygonF(12, ChinaF, latitude, longitude) == 1) {GEOFENCE_no_tx = 0; GEOFENCE_APRS_frequency = 144640000;} - else if(pointInPolygonF(7, JapanF, latitude, longitude) == 1) {GEOFENCE_no_tx = 0; GEOFENCE_APRS_frequency = 144660000;} + { + if(pointInPolygonF(6, North_KoreaF, latitude, longitude) == 1) {GEOFENCE_no_tx = 1; GEOFENCE_APRS_frequency = 144620000;} + else if(pointInPolygonF(12, ChinaF, latitude, longitude) == 1) {GEOFENCE_no_tx = 0; GEOFENCE_APRS_frequency = 144640000;} + else if(pointInPolygonF(7, JapanF, latitude, longitude) == 1) {GEOFENCE_no_tx = 0; GEOFENCE_APRS_frequency = 144660000;} else if(pointInPolygonF(5, South_KoreaF, latitude, longitude) == 1) {GEOFENCE_no_tx = 0; GEOFENCE_APRS_frequency = 144620000;} else if(pointInPolygonF(5, ThailandF, latitude, longitude) == 1) {GEOFENCE_no_tx = 0; GEOFENCE_APRS_frequency = 145525000;} else {GEOFENCE_no_tx = 0; GEOFENCE_APRS_frequency = 144800000;} diff --git a/libraries/LightAPRS_Geofence/GEOFENCE.h b/libraries/LightAPRS_Geofence/GEOFENCE.h index 2fb9503..4864810 100755 --- a/libraries/LightAPRS_Geofence/GEOFENCE.h +++ b/libraries/LightAPRS_Geofence/GEOFENCE.h @@ -114,6 +114,15 @@ static float RomaniaF[] = { 27.12520, 47.95310 }; +static float North_KoreaF[] = { + 130.14189, 4321627, + 124.03574, 39.8949, + 125.18292, 37.39202, + 128.47240, 38.66888, + 130.69478, 42.3274, + 130.14189, 43.21627 +}; + static float South_KoreaF[] = { 132.17653, 41.01310, 124.61794, 36.70367, @@ -152,6 +161,13 @@ static float VenezuelaF[] = { -66.65410, 0.18680 }; +static float YemenF[] = { + 52.20302, 19.48287, + 41.92009, 17.42198, + 43.59620, 12.27820, + 53.68201, 15.80024, + 52.20302, 19.48287 +}; // VARIABLES extern uint32_t GEOFENCE_APRS_frequency;