Wykres commitów

65 Commity (master)

Autor SHA1 Wiadomość Data
Thomas Osterried d25692b209 Fixes and improvements: preamble, gps powersaving mode, LH, ..
- web:
  - preamble: A bit more detailed description, with suggestion to try
    value 12 (default is 8)
    Assurance in taskWebserver that value is >= 8.
  - sb_angle: min is 5 but text said Range 0 to 360.
  - GPS: new "GPS powersaving mode".
    Still testing. "Made GPS may sleep when running on battery" default.

- GPS powersaving mode:
  If you have problems, set it to "Ignore this feature".
  While looking at the power consumption, GPS has a quite high power
  consumption.
  If we have no fix for 10min, we go to sleep mode. Interval
  Sleep  1min, 2min, 4min, 8min, 1min, 2min, ..
  Awake  120, next: 60s, next: 40, next: 30s
  After 4 rounds, we run GPS 10min again (better chance to refresh the
  almanach).
  During sleep, taskGPS is suspended and gps chip is powered off.
  -> This algorithm saves reduces the power consumption of the GPS chip to
     ~30%.
  If it behaves good, more fine-tuning can be done (i.E. switching it earlier
  off if you don't move. Reduce the initial fix-loss-time of 10min, ..)
  LCD shows "GPS: sleep" when GPS is in power saving mode. If it awakes
  and has no fix, it shows (as usual) GPS: age nnn".

- preamble changes:
  - TX setting:
    Now only affects main qrg. Perhaps it's wiser to be able to set it
    in more detail: Main, Secondary, Both. Or with different values
    for the different frequencies.
  - RX setting:
    moved to loraSend(), where default rx values are reset after TX

- LCD:
  - "GPS: sleep" as described above
  - Tried to improve the readibility of the LastHeard lines. Need to verify

Signed-off-by: Thomas Osterried <dl9sau@darc.de>
2024-04-24 13:36:39 +02:00
Piotr Lewandowski 88c7994e47 tx preamle len settings, extended rx timeout 2024-04-20 13:15:02 +02:00
Thomas Osterried c68cf822e6 local aprsis-filter, bugfix, vers_xxshort_bn, no gif
1.1 local aprsis-filter

1.1 Filter type (local, optional)

Local aprsis-filter incoming for packet-types.
We observed that if you have a server-site filter, i.e. for receive private
messages only, 20km around you (t/m/MYCALL/20), aprsis sends also some
location positions of users (if you heard them on RF), and even if \>20km
away.  Also we have seen packets of type objects telemetry, etc.
With this option, you can filter incoming aprsis-packets localy in order
to prevent them from gating to RF. Valid filters are poimqstunwb (Position
packets, objects, items, message, query, status, telemetry, user-defined,
NWS, weather, bulletin (bulletins are aprs-messages prefixed with BLN').
You can invert the filter ('all except ...') by adding a leading '-',
i.e. '-mws'.
If you leave this field empty, aprsis local filter is disabled.
=> [-]poimqstunwb

1.2 Filter 'words' (local, optional)

Local aprsis-filter incoming for 'words': if this word is part of the header
or message body of a packet coming from aprsis, the packet is filtered out.
You can sepearate multiple word-filters by space.
Leave empty to disable a word filter.

Many thanks go to Tomasz SP2ATJ for this idea and nice discussions
and intensively testing.

2. bugfix

During "save" of the config via web-interface, we call
setup_phase2_soft_reconfiguration()
String Tcall is changed. OledHdr had a reference to Tcall.
OledHdr needs to be updated. Else there's a very rare race condition
(only observed one time in 3 years) where
writedisplaytext(OledHdr,OledLine1,OledLine2,OledLine3,OledLine4,OledLine5);
crashed during accessing OledHdr.
OledHdr = String(Tcall); sould make a local copy.
OledLines1-5 are also set explicit to "" now.

3. VERS_XXSHORT_BN

buildscript_versioning.py generates BUILD_NUMBER, VERSION, VERSION_SHORT, etc.

We compute the build_nr with base62 (0-9, a-z, A-Z)
This gives us room for (62**2)-1 = 3843 builds between git commits. Should be
enough.
git_id short is 7 bytes.  length of 5 has hopefully enough entropy.
VERS_XXSHORT_BN may also be sent on RF -> We keep it short. 8 bytes now,
(5 bytes git id, 2 bytes base62-encoded build_no) instead of typically
3 bytes before.

Why we need both?
1. git-id: you can determine which was the git head when you checked out,
   and what has changed since then
2. During developmment / testing, build-nr increases each compiler run -
   but the git id only changes after git push. build_no helps you to
   distinguish, which version of a compler run you currently use.

VERSION had a date resolution of 1 microsecond. -> now cutting string after
the minute value.

4. style.css

I decided to remove the #logo ("background-image"), which is a base64-
encoded inline gif.
We need space for the flash, because the code reached 100% of it's size!!
If we have a solution, the logo comes back.

Other options:
  - don't compile with -DENABLE_SYSLOG, or the like
  - re-partition. Other firmmware-developers did this. But I'm a bit
    sceptical to do this.

Signed-off-by: Thomas Osterried <dl9sau@darc.de>
2024-03-17 05:42:21 +01:00
Thomas Osterried 08997f5720 Many new features. bug fixes and improvements
New features
------------

- personal text messages addressed to the tracker
  - are now recognized and stay local -> will not be digipeated or sent to aprsis
     see handle_aprs_messsage_addressed_to_us(), used in the main program (for
     rf-received packets) and in taskWebServer for packets received from aprs-is
     It also displays the message
        +      writedisplaytext(" ((MSG))","",String(msg_from) + String(": ") + String(header_normal_or_third_party_end + 11+1),"","","");
     for 30s:
        +      display_dont_update_until = millis() + 30000L;
     We display the msg in favour of the RX packet.
  - we send an ACK when a message-ID is present
  - This is also useful for the winlink feature described below

- Winlink feature
  - if enabled, your device will add the word @winlink to the position beacon text
    every hour (Refresh interval at winlink is two hours).
    You can choose if it is sent always, or only if a bluetooth device (i.e. aprsdroid)
    is connected.
    Winlink documented that you could send a "status packet" instead. This would be
    really nice and I implemented it - but they ignore it. -> I've commented
    it our (for not loosing it), and switched to the position comment approach.
  - If we get a notification, a "W" is in the display as indicator that new messages
    are waiting for you.
    The W is displayed for 24h. Because winlink only informs every 24 hours, and the
    tracker does not know if you read the message at the winlink system

- Powerdown:
  - If you disconnect external power (USB) from the TTGO device, it can shutdown if
    you configured the shutdown delay. This is useful when operating in the car and
    you park. Someone configured a shutdown delay of 1h. -> Shutdown info is displayed
    a few seconds (you can interrupt the shutdown by pressing the middle button), and
    info is displayed again a few seconds right before the actual shutdown (also with
    the option do interrupt the shutdown by pressing the middle button).
  - On shutdown, a message QRT status message could be sent automatically, if configured

- LoRa APRS digipeating: you can configure now an alias reacting as digipeater
  (kenwood names it "UITRACE". We react only on this call if it's in the first
  position of the path and has no digipeated flag.

- Serial console tnc cli:
  - Show reboot and halt info also at the display if you issue the reboot or shutdown command
    And send a status packet if configured (see new status packet feature described above)

Bug fixes
---------
- Fix for AXP2101 on T-Beam V1.2:
  In setup() (setup_phase2_soft_reconfiguration()), we needed to add
    +        axp.setButtonBatteryChargeVoltage(3300);                             // enable charge of the gps battery
    +        axp.enableButtonBatteryCharge();
  else the button battery (which is a capacitor) never became loaded. This lead
  to a time of 10 min to get a GPS fix after powering on (because it needed to wait
  for the almanach)
- Fix and improve of smartbeaconing computation. Sometimes the timer went too fast down,
  sometimes it went up to max again -> we mostly relied on the course-change event.
  You will really notice the improvement.
- Wrong info if lora TX is enabled and current state of dont_send_own_position_packets
  is true. Display showed "LoRa-TX; dis", but only the active sending of the
  beacon is stopped:
    -  if (dont_send_own_position_packets || !(lora_tx_enabled || aprsis_enabled)) {
    +  if (dont_send_own_position_packets) {
    +    OledLine2 = wifi_info + " Own Bcn: dis";
    +  } else if (!(lora_tx_enabled || aprsis_enabled)) {
         OledLine2 = wifi_info + " LoRa-TX: dis";
- Beautifying the lines in the display output (indents for different speed units,
  missing blank if no "p" or "P", etc.
  I had developed that with the device with-display-and-no-GPS and saw the indent
  errors at the moment I used my new-device-with-display-and-GPS
- During debugging, I was not able to send a packet with digipeated flag via serial
  console converse mode: typo (q instead of p check):
    -          if (! (*p == '-' || *p == '>' || *p == ',' || *q == '*' || (*p >= 'A' && *p <= 'Z') || (*p >= '0' && *p <= '9')))
    +          if (! (*p == '-' || *p == '>' || *p == ',' || *p == '*' || (*p >= 'A' && *p <= 'Z') || (*p >= '0' && *p <= '9')))
  ;))
- Moved update_speed_from_gps() higher, before gps.speed() calls, because update_speed_from_gps()
  implicitly changes the gps.speed.isUpdated() value during his calls. This lead to unexpected fewer conditions of speed updates
- Improved gps location / speed / ... handling:
  Work on bestHdop section. You know, gps jumps at low speeds, and it's hard to find a good value
  between needed updates and wrong-positives. I left old values commented-out in the code. In my test, it now behaves much better.
  If situation is "p" (had a fix, but lost it), not only set aprsPresetShown "p" but also call displayInvalidGPS();
  If situation is " ": we had no gps fix, but we now have a fix:
           // No GPS signal for a long time? Enforce tx:
    +      if ((millis() - lastPositionTX) > ((sb_max_interval - sb_min_interval) / 2))
    +        nextTX = sb_min_interval;
  Sounds good?
- removed time_to_refresh = millis() + showRXTime from handle_usb_serial_input(), KISSTX, TX-Xdigi, ..
  because this value is only intended for the time of displaying ((RX)-packets and must not be
  overloaded by other stuff. See also new variable display_dont_update_until.
- taskWebServer send_queue_to_aprsis():
  While \r is a valid char in an aprs message text (for separating lines), it must not be
    sent to aprs-is, because they interpret \r, \n, \r\n as EOL. That means, the rest of the
    line will be interpreted and may lead to a disconnect due to garbled input.
    -> +  data.replace("\r", " "); data.replace("\n", " "); data.replace("\0", " ");
- is_call_blacklisted(): moved strcat after length check:
    -      // our ssid filter construct: -0 means search for call with ssid 0 zero.
    -      if (!(r = strchr(buf, '-')))
    -        strcat(buf, "-0");
           // after modifications above, is len(buf) still < 10 (space for ',' and \0)?
           if (strlen(buf) > 10)
             return 0;
    +      // our ssid filter construct: -0 means search for call with ssid 0 zero.
    +      if (!(r = strchr(buf, '-')))
    +        strcat(buf, "-0");
- Fixed: average_speed array: last field was always zero (%4 instead of %5)
    -  average_speed[point_avg_speed] = (((curr_hdop < 1.5 && curr_sats >= 3 && curr_kmph <= 16.0) || (curr_hdop < 4.0 && curr_sats >= 3 && curr_kmph > 16.0)) ? curr_kmph : average_speed[(point_avg_speed-1) % 4]);   // calculate smart beaconing. Even a not-updated old speed is ok here.
    +  average_speed[point_avg_speed] = ((curr_kmph < 1.8 || (curr_hdop < 1.5 && curr_sats >= 3 && curr_kmph <= 16.0) || (curr_hdop < 4.0 && curr_sats >= 3 && curr_kmph > 16.0)) ? curr_kmph : average_speed[(point_avg_speed-1) % 5]);   // calculate smart beaconing. Even a not-updated old speed is ok here.

average_speed_final = (average_speed[0]+average_speed[1]+average_speed[2]+average_speed[3]+average_speed[4])/5;

Other changes
-------------

- Instead of
    if (enable_bluetooth && SerialBT.hasClient()){
  we now have
    if (serial_bt_client_is_connected){
  in TTGO_T-Beam_LoRa_APRS.ino, taskWebServer.cpp and taskTNC.cpp
  and the current state is checked in the main loop.
  This way we also learn if a new serial_bt_client is connected
- Oled: new display_dont_update_until prevents display changes -> important messages
  are not interrupted
- Better space handling for beacon text additions like "@winlink" "Batt=", "P=", " !W..!"
- nextTX and next_fixed_beacon adjustments moved now in sendpacket(), because
  they need to be adjusted (and only then) after calling this function:
    +  lastPositionTX = millis();
    +  // reset timer for automatic fixed beacon after manual beacon
    +  next_fixed_beacon = millis() + fix_beacon_interval;
    +  nextTX = sb_max_interval;
- enableOled_now() enforces Oled to be on (without waiting for the next loop in main loop).
  display_dont_update_until is set to the needed values
- variable name lastTX changed to lastPositionTX because this variable is only needed
  in the context of the last position transmission. -> the name lastTX was misleading.
- is_call_blacklisted():
  whitelist call "WLNK", because it has to be valid for winlink communication
- at various places in the code:
  moved display routines like writedisplaytext("((KISSTX))","",inputBuf,"","",""); to the
  place before loraSend -> more time for the user to read the message
- Middle button code:
    - fillDisplayLines3to5(0) added to MAN TX / FIX TX part
    - handle the power-off-timer condition (-> timeslots for being able to abort the poweroff)
- variables t_last_smart_beacon_sent and lastPositionTX had the same meaning.
  -> Abandoned t_last_smart_beacon_sent.
- New tmp_t_since_last_sb_tx in the loop: avoid unnecessary recomputations of
  millis() - lastPositionTX at various places afterwards in the loop.
- taskWebserver:
  - On shutdown or reboot, send statusPacket if configured.
    And set a delay for do_send_status_message_about_shutdown_to_aprsis()
  - code beautify in handle_SaveAPRSCfg() and read_from_aprsis() (here: changed
    log message read_from_aprs to the more correct read_from_aprsis).
  - aprs-message ack-handling (described above)
  - renamed send_to_aprsis() to send_queue_to_aprsis(), because we have in  TTGO_T-Beam_LoRa_APRS.ino
    the same function (which only fills the queue, which is handled by send_queue_to_aprsis() in
    taskWebServer.cpp).
  - More comprehensible:
      -                        <label for="aprs_llfgps">Use lat/lon of current GPS position</label>
      +                        <label for="aprs_llfgps">Instead, store current GPS position</label>

Signed-off-by: Thomas Osterried <dl9sau@darc.de>
2024-02-24 12:29:10 +01:00
Thomas Osterried d833835e16 Fixes and improvements:
- platform.ini: changed env:xxx-1.0 to xxx-1_0, because latest
  platformio complains about the dot.

- Optional: send beacon as object
  This is recommended if you like an aps icon like L, while using
  your normal ssid like DL9SAU-12
  You can set it in the webinterface, of by compile time in platform.ini
- if you really insist in adding SSID -L4 to your callsign,
  your RF TX will be disabled. You can connect with that call to to aprs-is.

- renamed function name compute_locator() to locator_to_lat_lon(),
  because it's more clear

- GPS accuracy:
  GPS becomes inaccurate if you move very slow or halt.
  These jumps may have a distance of more than 100m.
  If we take hdop and visible satellites into acount, the situation
  improves significant.
  A measured height needs even more sats and better vdop.
  Beacons are also triggered by course change. Speed is not a good
  indicator, because speed is computed by location change. And if
  you jump 200m in between 5s, then you speed is interpreted as 144km/h.
  This leads to wrong assumptions about course change.
  As far as we know, our changes have no impact to the quality of the
  positions and the course change detection for smart-beaconing.
  hdop and sat values for exacter location, course, speed,
  and altitude have been testet by experiment. If you like, you
  may find better values.

After this commit, we'll test extensively. Then it will become
a release dedicated to HAMRADIO 2023 ;)

Signed-off-by: Thomas Osterried <dl9sau@darc.de>
2023-06-15 20:42:49 +02:00
Thomas Osterried 38387dc189 Major changes. Hard work on this new releae.
Improvements
- Even more intelligent behavior in "Allow failback Mode AP"
- Webserver: Current GPS location can be stored as current lat/lon;
             And fixed a not-so-nice down-rounding from i.e.
             53.2100N to 53.2099N
- Webserver: better input handling for ap password, remoteAP ssid and
  password, syslog and ntp server
- Webserver: fixed typos in tooltip texts, and improved documentation,
  especially for the new features
- Position ambiguity and higher precision
  You can choose now between
    - compressed position (also when fixed position).
    - uncompressed aprs position
    - uncompressed aprs position with higher precision (DAO W and w)
  Improvement for unknown position: encode it according to aprs spec
- OLED: more variants to display lat/lon positions.
  Displayed lat/lon resolution depends on setting and if you move,
  and current gps hdop.
  You can also configure if maidenhead grid locator is shown (always,
  never, in intervals). Locator could be shown as RR99XX, RR99XX99
  or RR99XX99xx - you can choose which variant you like.
- Oled Lines: one-liners now cut at end of display-length;
  except for line2 (if line3-5 are empty).
  Oled display.display() is called only if display is on.
  Improvement for fillDisplayLines3to5 (may be forced)
- Serial output on boot: Warn for unser preference variables only once,
  and set them accordingly
- Digipeating / Gate handling. Don't send 3rd-party packets
  back to aprsis. Digipeat telemetry only do secondary qrg.
- aprs-is:
    - 3rd-party traffic: it's not seldom that igates use
  lowercase calls. Don't tread this as (minor) error anymore.
    - aprs-is: improved filters according to aprsis spec
- digipeating:
  - if we are a WIDE1 (= fill-in) digi and if a packet is in
  lora_TXBUF_for_digipeating and we hear a repeated one with same
  source-address and content, we clear it from queue.
  Improved viscous-delay.

For development (compile time): different debug-verbose levels

Fixes
- aprsLatPreset (etc..) variables are now changed from their temporary
  variable names at once. Reading from preferences, a separate
  variable is filled. This mitigates a smp problem between webserver
  and main threads
- aprsis login messages missed word "vers " placed before the version string
- Small fix for aprsis 3rd party traffic encoding according to the spec.
- Some numbers with decimals are now shown complete (instead of cut'ed
  to two decimals (default of String(floatVariable)).
- fixes for some buffer dimensions; detected two buffer overflow conditions
- Telemetry: assurance that values > 255 are ceiled and not start from 0 again
   (An analoge value must not exceet 255)

This dedicated to the three-country-edge SysOp meeting
in Engen 2023-02-11 ;)
LoRa was one topic..

Signed-off-by: DL3EL <dl3el@darc.de>
Signed-off-by: Thomas Osterried <dl9sau@darc.de>
2023-02-19 20:36:05 +01:00
Thomas Osterried b4fcb30f58 telemetry on rf is bad on slow lora.
But since we got several requests, here's the approach:
- only on secondary qrg
- only in mode >= 1200 (comparable to 1k2 AFSK APRS on 2m)
- no digipeater in the path

Signed-off-by: Thomas Osterried <dl9sau@darc.de>
2023-01-27 18:40:20 +01:00
Thomas Osterried 58322019ca Texting new wifi AP array.
..and other smaller new features.

Signed-off-by: Thomas Osterried <dl9sau@darc.de>
2022-12-15 09:16:37 +01:00
Thomas Osterried fa05b426d9 Testing: units for display (km/h, mph, kn), ..
Signed-off-by: Thomas Osterried <dl9sau@darc.de>
2022-12-14 13:30:29 +01:00
Thomas Osterried f4d5d4496c New feature: usb-serial TNC-mode
usb-serial: 4 options: KISS, logging, tnc-format-trace, logging AND tnc-format-trace,
                       almost no logging

Test: platform.ini: enabled syslog for all devides

Moved spiffs config reading to the place before starting the webserver

Serial.println() uses obviously CRLF. Some Serial.printf() functions only \n;
changed them to \r\n.

Moved do_send_status_message_to_aprsis to connect_to_aprsis; displayed
fixes tries counter.

Signed-off-by: Thomas Osterried <dl9sau@darc.de>
2022-09-25 09:02:08 +02:00
Thomas Osterried cc437ec79c Impportant changes to the last commit (broke things9
Signed-off-by: Thomas Osterried <dl9sau@darc.de>
2022-09-19 22:57:36 +02:00
Thomas Osterried 4b497ca2d2 Many Fixes. Still need testing.
Better docu in webinterface.

Signed-off-by: Thomas Osterried <dl9sau@darc.de>
2022-09-19 16:57:29 +02:00
Thomas Osterried bb1a5b6196 Many changes again. Cave: needs testing!
- internet connction logging (reboot, wifi- or internet-loss, ..)
  as aprsis-status-message
- better logging logging
  - serial: try to don't corrupt serial kiss
  - syslog
  - both: wise choice of prefix for the log messages
- failback AP if you misconfigured your device.
  Edit data/wifi.cfg to your needs and upload it via pio ... -t uploadfs
  This file is on the device and survives the reset of preferences.
  Thanks to Thomaas dl3el

serial log and syslog are now configurable via web.
In the future, syslog compiled in by default for all devices in preferences.ini

Signed-off-by: Thomas Osterried <dl9sau@darc.de>
2022-09-17 23:35:44 +02:00
Thomas Osterried c02f35f153 Still testing
Mode AP / Mode STA

And fix for mheard list

Signed-off-by: Thomas Osterried <dl9sau@darc.de>
2022-08-31 15:08:32 +02:00
Thomas Osterried 41e5b27ecd Many fixes, improvements and new features
- new web option
  - Otion Send Course/Speed along with Altitude.
    Removed option "Show Altitude in compressed position" removed.
- Added hint for min/max values in tooltip
- Tips for reducing power

- platformio.ini:
  - enabled ENABLE_TNC_SELF_TELEMETRY.
    Reason: imho, no really need for telemetry. But code is not much.
    Tried to configure it in web-iface for debug purpose and it had no effect:
    because it was not compiled in.

- always_send_cseSpd_AND_altitude feature (see also webconfig)
- sendpacket() now gets information (flags) why / for what it is called
  This is for deciding if you send altitude with each transmission
  (then course/speed is always sent in compressed format, and /A=......
  is added to the message text). [Vice versa is not allowed due to spec]
  If disabled, one transmission has course/speed and the next one
  altitude (depending on altitude ratio). Pretty cewl ;)

- improvements on display output

- improvements for handling gps state change valid/invalid.
  Lesser (better) cpu-consuming storage of last position.
  It's now handled in one routine at start of the main loop.

- mheard list: json list was cuted.
  -> -  DynamicJsonDocument doc(MAX_RECEIVED_LIST_SIZE * 500);
     +  DynamicJsonDocument doc(MAX_RECEIVED_LIST_SIZE * 1000);
  But we still face the problem of empty mheard lists in the webinterface.
  -> STILL NEED FOR FIX

- webserver
  - wifi client / AP:
    Fix. If you loose connection to the AP, we now go to the
    algorithm again for reconnect, or start own AP. And if no client
    is associated in AP mode, we also try to re-determine.
    -> moved to new function restart_AP_or_STA()

    Reconnect also if we are STA and got no IP address by dhcp
    (there are some known compatibility issues with some dhcp-serrvers,
    where on dhcp refresh we lost the gateway):
    if (WiFi.getMode() == 1 && (WiFi.status() != WL_CONNECTED || WiFi.localIP() == IP_NULL || WiFi.subnetMask() == IP_SUBNET_NULL || WiFi.gatewayIP() == IP_GATEWAY_NULL))
  - wifi status now with one status variable, i.E.:
      wifi_connection_status = WIFI_RUNNING_AS_AP;
    Used in the main program for display routine.

===
dl3el's commit messages (newest on top)

- update time and sec of next beacon per second, even if rxshow is >0
- show gps time in OLED  show gps time in OLED
- smoothen speed in OLED. display current Position, Uptime & Satt Info on
  Website
- bug fix in WebServer: Enable Wifi menu did not show the currently selected
  value

- Features:
  - Change gps reception in main loop
  - do not accept gps data when hdop is > 10
  - when gps data is invalid, show gps.location.age
  - when beacon is send manually and reset the timer for fixed beacon
  - when oled is constantly on, refresh screen every second
  - "." blinks in the upper left corner to show system is working
  - show wifi mode on screen (CLI or AP, run or stopped)
  - show SSID & IP on screen when manual tx (button, web) and as boot message

  - Bugfixes:
  - manual send works now, when oled is constantly o

- fix output to Oled Display
- reenable GPS: show alt in Display delay first AUT TX if fixed beacon is on
- show Discharge mA in OLED for optimization
===

And finally, from the old changelog with changes since the last release:

Changelog of 2022-08-09:

Fix
- logical error for setting lora chip to sleep after tx;
  affected users with digipeating mode switched off. -> They did not receive
  any RF packets.

Improvements:
- hack for re-enabling webserver if it was switched off_
  moved from the short-pressed beacon button to the long-pressed GPS button.
  Thanks to Thomas Beiderwieden <dl3el> for the patch.

Feature
- If you press the GPS button, on your OLED display now your AP name and
  IP address are displayed.
  Thanks to Thomas Beiderwieden <dl3el> for the patch.

- Known issues
  The first Menu in the webinterface, "Enable WIFI", stores the chosen
  value. You can see it in the json config, and how boot-up behaves
  (-> correctly stored in the preferences).
  But: the chooser always displays Menu item 1 as active.

Signed-off-by: Thomas Osterried <dl9sau@darc.de>

Changelog of 2022-08-07:

 Major improvements and smaller bugfixes

- feature: option to disable wifi. Saves abt 80mA current
  3 options: 2 alaways on; 1 off if no bluetooth client is connected in between
  60s after boot (watch red oled button; goes off as soon as a
  bt client connects in the boot phase). 0 disable (re-enabl by pressing
  beacon button)
- pseudo csma/cd. ppersist / slottime as we know it from standard
  packet-radio / -APRS
  In loaSend. TODO: better concept with a tx-queue. But this is rather complex,
  because the queue must not grow too large, else we re-send old packts..
- feature to encode altitude in compressed position instead of /A=...
  compressed position can encode course/speed, altitude (and others). Option to
  send course/speed to 0%, 100% or something in between.
  altitude check button is obsolete. Switch off by setting alt ratio to 0.
- cross-digipeating: just for sure, clear rx queue after going back to main
  freq.
- if we are not a digipeater and we have no serial-bt-client, we may let the
  loraChip sleep (axp.setPowerOutPut(AXP192_LDO2, AXP202_OFF)) -> saves current
  (a bit)
- adjust_cpu_freq_to: change CPU frequency. May reduce cpu power consumption
  up to 20 %. Suggesting (and tested with) 80 MHz. USE WITH CARE! I.e.
  40 MHz or 20 MHz did not work with my device (boot phase never ended)
- options to start tncServer and gpsServer (if you don't need them, you
  may not like to expose these tcp ports to your LAN or HAMNET)
- changed preferences.getString(PREFxxxxx) to
  preferences.getString(PREFxxxxx, ""), because if variable is not set,
  the preferences library returns "the variable name itself" - wtf!.
  In the case of PREF_NTP_SERVER, we saw log messages that ntp server
  with fqdn "ntp_server" could not be resolved; it had no impact, because
  it did a failback to the compiled-in default.  Changed call for
  PREF_WIFI_PASSWORD, PREF_AP_PASSWORD, etc.. too.
- wifi-AP: is set to esp_wifi_set_max_tx_power(8) (for lesser power
  consumption of the devie). 8 dBm are too less fore some cases.
  -> New web config for setting max_tx_power in AP- and STA- modes.
- Fix: In mode wifi-client, it did not reconnect if association was lost.
- small improvement for comment-text ratelimiting

BG_RF95.cpp: BG_RF95::SignalDetected feature (needed for pseudo csma/cd)

Signed-off-by: Thomas Osterried <dl9sau@darc.de>
2022-08-20 08:34:28 +02:00
Thomas Osterried e489b57205 Major improvements and smaller bugfixes
- feature: option to disable wifi. Saves abt 80mA current
  3 options: 2 alaways on; 1 off if no bluetooth client is connected in between
  60s after boot (watch red oled button; goes off as soon as a
  bt client connects in the boot phase). 0 disable (re-enabl by pressing
  beacon button)
- pseudo csma/cd. ppersist / slottime as we know it from standard
  packet-radio / -APRS
  In loaSend. TODO: better concept with a tx-queue. But this is rather complex,
  because the queue must not grow too large, else we re-send old packts..
- feature to encode altitude in compressed position instead of /A=...
  compressed position can encode course/speed, altitude (and others). Option to
  send course/speed to 0%, 100% or something in between.
  altitude check button is obsolete. Switch off by setting alt ratio to 0.
- cross-digipeating: just for sure, clear rx queue after going back to main
  freq.
- if we are not a digipeater and we have no serial-bt-client, we may let the
  loraChip sleep (axp.setPowerOutPut(AXP192_LDO2, AXP202_OFF)) -> saves current
  (a bit)
- adjust_cpu_freq_to: change CPU frequency. May reduce cpu power consumption
  up to 20 %. Suggesting (and tested with) 80 MHz. USE WITH CARE! I.e.
  40 MHz or 20 MHz did not work with my device (boot phase never ended)
- options to start tncServer and gpsServer (if you don't need them, you
  may not like to expose these tcp ports to your LAN or HAMNET)
- changed preferences.getString(PREFxxxxx) to
  preferences.getString(PREFxxxxx, ""), because if variable is not set,
  the preferences library returns "the variable name itself" - wtf!.
  In the case of PREF_NTP_SERVER, we saw log messages that ntp server
  with fqdn "ntp_server" could not be resolved; it had no impact, because
  it did a failback to the compiled-in default.  Changed call for
  PREF_WIFI_PASSWORD, PREF_AP_PASSWORD, etc.. too.
- wifi-AP: is set to esp_wifi_set_max_tx_power(8) (for lesser power
  consumption of the devie). 8 dBm are too less fore some cases.
  -> New web config for setting max_tx_power in AP- and STA- modes.
- Fix: In mode wifi-client, it did not reconnect if association was lost.
- small improvement for comment-text ratelimiting

BG_RF95.cpp: BG_RF95::SignalDetected feature (needed for pseudo csma/cd)

Signed-off-by: Thomas Osterried <dl9sau@darc.de>
2022-08-07 20:01:24 +02:00
Thomas Osterried fbb0ecf374 New features and bugfixes
Bugffix
  - apris-is filter argument was ignored

New features
  - We make use of hardware watchdog for esp32.
    -> Measurement against bugs or mis-behaviour
  - automatic reboot affter n hours (i.e. if the wifi client does not reconnect)
  - In Wen handle_Cfg we now show System Uptime (in resolution of a minute)

Documentation:
  - improved description for apris-filter

Signed-off-by: Thomas Osterried <dl9sau@darc.de>
2022-03-24 23:56:22 +01:00
Thomas Osterried 5164857e4b Added config option ntp server
You can now configure an ntp server.

If left empty: Auto-choice between pool.ntp.org and ntp.hc.r1.ampr.org according your IP address.

Signed-off-by: Thomas Osterried <dl9sau@darc.de>
2022-03-10 00:54:12 +01:00
Thomas Osterried b741836646 Small fixes and features (around beacons to aprs-is and to RF)
Fix:
if lora tx is disabled, and you are connected to aprs-is, you like to see your beacons there (useful if you are a rx-only igate)

New feature:
- option "TX our beacon to APRS-IS":
  TX our beacon from this device or from-kiss to APRS-IS. You may like to disable this i.e. if you are a portable hotspot togehther your mobile, but like others
than you yourself gate your own packets to APRS-IS -> you'll see at APRS-IS who heard you.
- option "TX our beacon from this device or from-kiss to frequencies":
  Don't send our beacon on RF (but only to kiss and to APRS-IS)

Signed-off-by: Thomas Osterried <dl9sau@darc.de>
2022-03-09 23:38:49 +01:00
Thomas Osterried b02e41714b A hand full features and improvements
Major upgrade

- SNR/RSSI encoding (Q...) feature:
  - changed default preference for SNR/RSSI encoding (Q...) to
    lora_add_snr_rssi_to_path = (FLAG_ADD_SNR_RSSI_FOR_KISS |
                 _FLAG_ADD_SNR_RSSI_FOR_APRSIS__ONLY_IF_HEARD_DIRECT)
    ..HEARD_DIRECT is a new feature
  - user may request SNR/RSSI trace by adding to path 'Q' (digis who hear
    him direct add SNR/RSSI), or 'QQ' (every digi adds - useful for
         local RF network trace)
  - more config options in Web-Interface
- Relay-Path: check for invalid input. More tips how to configure.
  Auto-suggest "WIDE1-1" if unexperienced user enters "WIDE1"
- Fixed location setting of Latitude / Longitude:
  Previously, a user had to know the correct notation of APRS spec.
  Now, we are pretty smart and can handle different notations,
  inclusive MAIDENHEAD GRID ;)
- blacklist filter for src-calls and calls in digi path
  - if you have a digipeater or user which behaves bad
  - against mis-use of our infrastructure
- config option for switching of lora RX
- MY_APRS_DEST_IDENTIFYER = ... as one global string instead of multible
  occourences in the code
- improved packet validation
- web-interface input validation (trim() to strip leading/trailing spaces),
  i.e. att callsign, relay path, aprs-is-server-name, -call and -password, ..
- third-partytraffic: changed dstcall from "APRS" to MY_APRS_DEST_IDENTIFYER

..and a test to circumvent github firmware download bug that came in end 2021

Signed-off-by: Thomas Osterried <dl9sau@github>
2022-03-03 16:10:23 +01:00
Thomas Osterried a2db80ab04 Many new features: rx on both frequencies. APRS-IS igate.
New features:
- rx on main qrg, secondary qrg or both. (If we are not configured as WIDE1 or WIDE2 digi). QSY time depends on amount of other users heard, in  10min qindow.
- tx_qrg for beacon (if we ae configured as WIDE1 or WIDE2 digi)
- tx_power configurable on second frequency
- long waited aprs-is igtate feature. We provide a bid-direcional gateway.
- snr-in-path-encoding compatible for aprs-is (optional)

- added new parameter lora_SPEED to function loraSend()

Signed-off-by: Thomas Osterried <dl9sau@darc.de>
2022-01-19 10:37:07 +01:00
Thomas Osterried 84644e0579 New features: configuarable txpower, and disable lora tx, and Link for downloading configuration
New features:
  - txpower configurable (previously only compile time option in platform.ini)
    If not configured in platform.ini (previously necessary), it now defaults to 23.0
  - New Enable LoRa TX variable. If disabled, it's assured that TX will never happen
    (i.e. in order to protect rx amplifier)
    This option is also definable in platformio.ini, if you comment out:
      ;-D 'TXDISABLE'
    If set, it also enforces txpower 0.

    =>

    #ifdef TXDISABLE               // define TXDISABLE if you like to ensure that we never
TX (i.e. if we are behind an rx-amplifier)
    boolean lora_tx_enabled = false;
    uint8_t txPower = 0;
    #else
    boolean lora_tx_enabled = true;
    #ifdef TXdbmW
     uint8_t txPower = TXdbmW;
    #else
     uint8_t txPower = 23;
    #endif
    endif

    ;))

  - Web-Interface: Link to /cfg (-> make it easier for users to show the json and
    store the current configuration). This is better than making screenshots of
    the website ;)
    If could be done better (download link, ..). And possibility to upload
    the configuration from backup. Who likes to implement this?

Signed-off-by: Thomas Osterried <dl9sau@darc.de>
2021-12-19 14:31:36 +01:00
Thomas Osterried f4f8a721de Web-interface works now. Found the bugs, fixed them, and testet inensively.
In TTGO_T-Beam_LoRa_APRS.ino I removed unused variable
lora_old_speed
which was still there after removing my debug code which showed previous / current value ;)

Signed-off-by: Thomas Osterried <dl9sau@darc.de>
2021-11-25 09:04:57 +01:00
Thomas Osterried 30f9b4a94e This commit brings many enhancements (like digipeating), fixes, and cosmetic changes.
(c) 2021 Thomas Osterried dl9sau, License GPL

CAVE:
webconfig does not work properly. This needs to be fixed before the changes could go upstream!
Until then, you can hardcode values in TTGO_T-Beam_LoRa_APRS.ino after the
  "// enforce valid transmissions even on wrong configurations"
  section.
For examples, see appendix 1.

New features

Changes
- improved automatic CodeRate adaption
- Concept for adding SNR+RSSI in packet path. Q23073* means, 23 dB SNR, -73 dB RSSI.
- full smart-beaconing implementation, with default parameters from kenwood / yaesu devices

Changed files:

1. data_embed/index.html
------------------------
- cosmetic changes
- added configuration options for new features described above
- description how to configure DST-call-path-addressing
- make configurable
  - automatic coderate adaption
  - rate limiting comment text
  - My recent "Accept own positions via KISS" feature
  - My recent "Allow GPS sleep while own positions received via KISS" feature
  - LoRa Digipeating
  - LoRa cross-digipeating (Mode, frequency, speed)

2. preference_storage.h
-----------------------
definitions for the new configuration variables

3. platformio.ini
------------------k

Variable MAX_TIME_TO_NEXT_TXT commented out. Was not implemented, and needs not be configured anymore.
Default enabling of
  ENABLE_TNC_SELF_TELEMETRY
switched off because most people do not need this

DIGI_PATH="1": suggestion to make this default

"FIXED_BEACON_EN": switched off, because if you have a tracker with GPS, you do smart-beaconing.
Or if you have no GPS, you need to configure LAT/LONG before enabling fixed beaconing.

"SHOW_BATT": if you really need this, enable it.

"SPEED_1200": most regions use 300.

Typo:
LATIDUDE_PRESET -> changed to LATITUDE_PRESET (also in TTGO_T-Beam_LoRa_APRS.ino)

4. TTGO_T-Beam_LoRa_APRS.ino
----------------------------

global variables:
- -D SPEED_1200 had not effekt. Added appropriete #ifdef.
   Perhaps, "LORA_SPEED_LOW" or "LORA_SPEED_FAST" (like mentioned in the web interface) would be a better approach
- gps state: set default on only at devices with GPS-RX
- New smartbeaconing:
  - values like sb_turn_slope and sb_turn_time
  - if -D SB_ALGO_KENWOOD, use those defaults. Scales better at low speed.

- my new featerus:
  - lora_speed_cross_digi
  - lora_freq_cross_digi

  - lora_automatic_cr_adaption
  - lora_digipeating_mode
  - lora_add_snr_rssi_to_path
  - lora_cross_digipeating_mode
  - acceptOwnLocationReportsViaKiss
  - allow_gps_sleep_while_kiss
  - acceptOwnPositionReportsViaKiss
  - gps_allow_sleep_while_kiss

- added code for new preferences values

- in prepareAPRSFrame()
  - beautified DST-path addition on outString
  - better comment-ratelimiting computation

- loraSend(): small change.
  - If lora freq was changed for sending one packet on another frequency (cross digi mode):
  +  // cross-digipeating may have altered our RX-frequency. Revert frequency change needed for this transmission.
  +  if (lora_FREQ != lora_freq)
  +    rf95.setFrequency(lora_freq);

  - FEATURE request:
    // Feauture request: add param lora_speed. Currently, we need a variable for storing the old speed, and affer loraSend(), we have to revert :(
    I did not change the function parametes without asking

- new sanity check:

  +// enforce valid transmissions even on wrong configurations
  +if (aprsSymbolTable.length() != 1)
  +  aprsSymbolTable = String("/");
  +if (aprsSymbol.length() != 1)
  +  aprsSymbol = String("[");
  +if (aprsLatPreset.length() != 8 || !(aprsLatPreset.endsWith("N") || aprsLatPreset.endsWith("S")) || aprsLatPreset.c_str()[4] != '.')
  +  aprsLatPreset = String("0000.00N");
  +if (aprsLonPreset.length() != 9 || !(aprsLonPreset.endsWith("E") || aprsLonPreset.endsWith("W")) || aprsLonPreset.c_str()[5] != '.')
  +  aprsLonPreset = String("00000.00E");

  -> Without this, and if unconfigured, invalid packets without position in the position-part of the AX.25 packets could occur. Saw this happens, at findu.com ;)

- encode_snr_rssi_in_path():
  My idea of coding SNR and RSSI in packet path. Instead of modifying user's comment text (which some digi software does, and is a really bad idea)
- add_element_to_path():
  a quick, string based option to add a digi element to the AX.25 header
- tnc_format_to_ax25_frame(): header parser, needed for handle_lora_frame_for_lora_digipeating
- handle_lora_frame_for_lora_digipeating: does header rewrite for digipeating
- implemented digipeating and cross-digipeating
- redesignt automatic cr-adatpion
- improved smart-beaconing decisions

5. taskWebServer.cpp:
---------------------
- added code for new preferences values

Appendix 1
----------

I.e. my enforced test settings in  TTGO_T-Beam_LoRa_APRS.ino behind
the block
  "// enforce valid transmissions even on wrong configurations"
were:
  lora_speed = 180;
  lora_digipeating_mode = 2;
  lora_cross_digipeating_mode = 0;
  sb_min_interval = 90000L;
  sb_max_interval = 1800000L;
  lora_automatic_cr_adaption = true;
  lora_speed_cross_digi = 1200;
  lora_freq_cross_digi = 433.900;
  sb_max_speed = 20;
  sb_turn_slope = 11;
  rate_limit_message_text = true;
  acceptOwnPositionReportsViaKiss = true;
  lora_add_snr_rssi_to_path = true;

And in platformio.ini:
       		-D 'KISS_PROTOCOL'				; leave enabled
			-D 'CALLSIGN="DL9SAU-12"'			; can be set from www interface
			-D 'DIGI_PATH="1"'				; can be set from www interface
			; -D 'FIXED_BEACON_EN'			; can be set from www interface
			-D 'SB_ALGO_KENWOOD'				; Kenwood skales better on lower speed.
			-D 'LATITUDE_PRESET="0000.00N"'			; can be set from www interface
			-D 'LONGITUDE_PRESET="00000.00E"'		; can be set from www interface
			-D 'APRS_SYMBOL_TABLE="/"'			; can be set from www interface
			-D 'APRS_SYMBOL="["'				; can be set from www interface
			-D 'MY_COMMENT="/145.500MHz d023/Thomas D23. TTGO-T-Beam LoRa 70cm; KISS-Test"'		; can be set from www interface
			-D 'SHOW_ALT'					; can be set from www interface
			; -D 'SHOW_BATT'				; can be set from www interface
			-D 'SHOW_RX_PACKET'				; can be set from www interface
			-D 'SHOW_RX_TIME=10000' 			; can be set from www interface
			-D 'TXFREQ=433.775'			; set operating frequency
			; -D 'LORA_SPEED_1200'			; comment out to set 300baud
			-D 'TXdbmW=23'				; set power
			; -D 'ENABLE_OLED'				; can be set from www interface
			-D 'ENABLE_LED_SIGNALING'			; can be set from www interface
			-D 'NETWORK_TNC_PORT=8001'		; default KISS TCP port
			; -D 'MAX_TIME_TO_NEXT_TX=120000L'		; can be set from www interface -- not implemented
			-D 'FIX_BEACON_INTERVAL=1800000L'		; can be set from www interface
			-D 'NETWORK_GPS_PORT=10110'		; GPS NMEA Port
			; -D 'ENABLE_TNC_SELF_TELEMETRY'		; can be set from www interface
			-D 'TNC_SELF_TELEMETRY_INTERVAL=3600L'		; can be set from www interface (seconds)
			-D 'SHOW_OLED_TIME=15000'			; an be set from www interface (OLED Timeout)

Signed-off-by: Thomas Osterried <dl9sau@github>
2021-11-24 13:34:04 +01:00
mattbk 0e9ac97753
Merge branch 'SQ9MDD:master' into telemetry-path 2021-09-19 15:51:05 -05:00
Matt 58cef88e9d Stub out changes without testing. 2021-09-19 09:57:43 -05:00
LucaIU2FRL b760fd9a23 Trying to reduce power consumption 2021-09-19 16:54:50 +02:00
Rysiek Labus (SQ9MDD) 00b08722b5
Merge pull request #75 from mattbk/telemetry-www
Clean up telemetry and add option(s) to www interface (TTGO T-beam v.1.0 )
2021-09-19 10:20:27 +02:00
Matt eb25ea2cbf Add www option for MIC telemetry sequence. 2021-09-18 16:51:51 -05:00
Sottosistema W10 87d8dbc558 Added images.h for future development 2021-09-17 20:53:54 +02:00
mattbk eb43b0baf1
Merge branch 'master' into telemetry-www 2021-09-16 14:29:55 -05:00
Matt 36c1a09bdd Number telemetry sequence correctly. 2021-09-16 13:42:36 -05:00
Sottosistema W10 16aae406b2 Added configurable AP password as in #51. Improved battery reading on T-Beam 0.7 as in #65. Fixed AP detection in serial printing. Updated readme.md 2021-09-16 19:54:14 +02:00
Sottosistema W10 be5bc1da6d Working on OLED Timeout settings in html 2021-09-15 19:56:09 +02:00
Sottosistema W10 fdd634eadc FIX OLED Timeout at startup. Begin OLED Timeout settings in html 2021-09-15 19:03:44 +02:00
Matt 5c055cbd16 Shelve. 2021-09-11 22:58:56 -05:00
Matt 967c1d0e8d Get working telemetry switch in www interface. 2021-09-11 21:46:51 -05:00
SQ5RWU b279a3c198 Merge 2021-08-11 18:21:43 +02:00
gorzynsk 8df220ad1b Adds angle setting to web configuration of Smart Beaconing 2021-08-10 19:04:18 +02:00
gorzynsk 1a44bea515 Allows to configure LoRa frequency and speed on the web interface 2021-08-03 18:11:18 +02:00
gorzynsk f17c773e7e Adds Smart Beaconing settings 2021-07-11 11:54:11 +02:00
Łukasz Nidecki 0e0aee1cd3 Added missing files 2021-06-11 03:39:44 +02:00
Łukasz Nidecki edee67e798 Experimental GPS output on TCP port 10110 2021-06-11 03:35:59 +02:00
Łukasz Nidecki 45f827611c Put rf95 to sleep when starting update 2021-06-11 00:52:49 +02:00
Łukasz Nidecki bd6a99373c RTC time. Received time on rx list 2021-04-26 14:45:29 +02:00
Łukasz Nidecki 5ff9a350d2 List 50 recently received frames + rssi + snr on website. 2021-04-26 13:41:12 +02:00
Łukasz Nidecki 8070392996 Move preferences code to spearate cpp/h files.
Fixed saving GPS enable status
Developer option for syslog logging
2021-04-25 16:29:07 +02:00
Rysiek Labus cd1a4c4252 Moving config to platformio.ini.
Set baud rate to 1200
2021-04-21 20:32:49 +02:00
Łukasz Nidecki 725794ac23 Merge branch 'master' of https://github.com/SQ9MDD/TTGO-T-Beam-LoRa-APRS into master_sq9mdd 2021-03-22 18:35:01 +01:00
Rysiek Labus 41b20ba518 auto shutdown option 2021-03-13 13:50:04 +01:00