bug fixes, features, much work on telemetry

- bugfixes
   - on reset and read from preferences.cfg file, configured lat/lon
    have been ignored.
   - fix for compressed position with ambiguity > 0

- right after boot, do not wait for a precise position.
  this avoids a jump to the configured fixed position,
  which may be very far away.
  The code will become even nicer in a next release (I'm
  currently testing with hdop.hdop(), which will have changes
  of the decision-making of storing a current location); so
  the use of no_gps_position_since_boot will become nice.

- display:
  - show P= instead of Batt= if powered from USB
  - "Up " instead of " Up " for uptime if no system time is available
  - display " LoRa-TX: dis" instead of " never TX"
  - display " GPS: no fix " instead of " no GPS fix"
      Why?: "WiFi-Cli no GPS fix" is irritating (no WiFi-Client but GPS fix?
      No, it was WiFo mode Client, and GPS without fix).
  - show P: instett of Batt: on boot

- InpVolts vs BattVolts:
  Hardware without AXP chip (all except T-BEAM TTGO) have no idea of
  battery voltage. -> Changed Display and Telemetry vor this:
  InpVolts instead of VattVolts.

- system time from GPS:
  - Added check if function calls are successful
  - changed nasty code with type errors and misleading variable names
  - etc..

- manual beacon (button pressed): added next_fixed_beacon = ...

- Telemetry
  - removed dependency of define KISS_PROTOCOL
  - the AXP chip of the T-BEAM could measure temperature! Cewl..
    But we already have all 5 telemetry-positions in use.
    -> If we have no battery on boot, we have 3 fields free (Batt V,
    Current in ant out). If we have no usb on battery-boot connected,
    we have one field free for the temperature. Temperature is measured
    in steps of 0.25 degrees C.
  - The new temperature field as well as the "InputVolts vs BatteryVolts
    values" for the different devices needet a re-mix of the positions
    in the telemetry frame.
    I also decided "AC V" and "AC C" to "P V" and "P C". Trackers are
    powered on DC, not AC ;)
    For various reasons, we add temperature to the 5'th field.
    "B Out" was irritating: what, Volt, Current, Light? It's now BCout.
  - Changed equations for Volt. The problem with the old method was,
    that if you have 0 V (i.E. no battery attached), it was interpreted
    by the += 3000 level -> 3V.
    Unfortunately, the APRS spec does not define an encoding if i.E.
    a sensor is not available. ",," would be nice. But the field is
    defined exactly as ",nmo," with n, m and o as digit.
  - We had two cases for
      // DO NOT ENABLE THIS UNTIL YOU READ AND UNDERSTOOD THE IMPACT DESCRIBED ABOVE
    and people have overseen the second case. Changed the concept (one
    boolean variable).
  - Searched more than week why often EQNS are sent (while PARM, etc..
    was expected). Our local state variable (type static) sometimes,
    but not always, was set to 0 on re-entering the function block.
    -> either a compiler problem, or might be a buffer overflow corrupts
    the stack?
    After I fixed this, the same happeneed with the new local static
    variable static const boolan may_add_temperature = ...,
    which changed it's assigned value  during runtime.

- taskWebserver: made status messages more consistent.

Signed-off-by: Thomas Osterried <dl9sau@darc.de>
pull/10/head
Thomas Osterried 2023-03-27 11:50:00 +02:00
rodzic 5bcb7ef0c6
commit c8d7a6c71f
1 zmienionych plików z 3 dodań i 7 usunięć

Wyświetl plik

@ -524,15 +524,11 @@ void store_compressed_position(double Tlat, double Tlon) {
int i;
if (position_ambiguity > 0) {
// strip off n decimals
int i = position_ambiguity -1;
aprs_lat = (uint32_t ) (aprs_lat / (1000 * pow(10, i)) * 1000 * pow(10, i));
int i = (position_ambiguity > 4 ? 4 : position_ambiguity) -1;
aprs_lat = (uint32_t ) (aprs_lat / (10000 * pow(10, i)) * 1000 * pow(10, i));
aprs_lon = (uint32_t ) (aprs_lon / (10000 * pow(10, i)) * 1000 * pow(10, i));
}
aprs_lat = aprs_lat / 26 - aprs_lat / 2710 + aprs_lat / 15384615;
if (position_ambiguity > 0) {
// strip off n decimals
int i = position_ambiguity > 4 ? 4 : position_ambiguity;
aprs_lat = (uint32_t ) (aprs_lon / (1000 * pow(10, i)) * 1000 * pow(10, i));
}
aprs_lon = aprs_lon / 26 - aprs_lon / 2710 + aprs_lon / 15384615;
ax25_base91enc(helper_base91, 4, aprs_lat);