206 Commits
Author SHA1 Message Date
agessaman c8117ac980 docs(upgrade): cover the changes merged after the 1.2.0 cut
Add the single-instance lock, a terminal close now stopping a bot started from it, the systemd unit's --wait-for-lock (and that install-service.sh only replaces an existing unit with --upgrade), the heartbeat-based Docker healthcheck, and the {path_names} placeholder.
2026-11-14 09:30:41 -08:00
agessaman 1706b20785 Merge remote-tracking branch 'origin/main' into dev
Bring main's commits into dev ahead of the 1.2.0 release PR so it merges cleanly: the waev.app broker docs (#357) and the frontend-lint dependency bump (#308). The only conflict was CHANGELOG.md. The waev.app entry main had under Unreleased now ships in 1.2.0, and since 1.2.0 was never tagged, the entries merged after the cut (the {path_names} placeholder, the instance-lock and viewer fixes, the heartbeat healthcheck) move into its section too, dated 2026-11-14.
2026-11-14 09:28:45 -08:00
agessaman 0809618d3a feat(templates): add {path_names} placeholder for short repeater names
{path_names} renders a message's route as compact repeater names, BlackHls▸KalamaSum▸KelsoG3 instead of a1b2,c3d4,e5f6 (3 hops), for [Test_Command] response_format and [Keywords] replies. A hop gets a name only on a 2- or 3-byte path, and only when its prefix has a single recent repeater or a collision resolves with at least path_names_min_confidence (default 0.9). Every other hop keeps its hex prefix, so no hop shows a guessed name. A direct message renders Direct, like {path}.

Names come from the same candidate query and selection as the web viewer's path decode; the candidate query is now candidate_repeaters() in path_inference so both share it. modules/name_shortener.py compacts each name (ASCII fold, emoji and filler dropped, callsigns dropped when another word names the node, CamelCase, place-word abbreviations, then vowels and letters) and packs the route into path_names_max_bytes, eliding hops after the first when names alone can't shrink enough. The lookup only runs when the template contains {path_names}.
2026-11-14 08:45:08 -08:00
agessaman 8845a3f316 feat(docker): report event-loop liveness in the container healthcheck
The healthcheck only proved PID 1 existed, so a wedged event loop stayed healthy. The bot now touches <db_path>.heartbeat every 30 seconds from its event loop, starting before the radio wait, and python3 -m modules.healthcheck fails once the file is more than two minutes old. An offline radio does not make the container unhealthy, since the bot reconnects on its own. The check reads the config path from MESHCORE_BOT_CONFIG, which the add-on image sets to /config/config.ini.
2026-11-14 08:45:02 -08:00
agessaman 6ce2e597bd fix(service): wait for the instance lock instead of exiting under systemd
A service that found another instance running (a manual run during maintenance) exited three times inside the start limit and stayed failed after the other instance stopped. The new --wait-for-lock flag retries the single-instance lock every 5 seconds instead of exiting 1, announcing the wait once, and resolves db_path on every attempt so an edit during the wait is honored. The systemd unit and the Debian package's unit start the bot with it.
2026-11-14 08:45:02 -08:00
agessaman 8c5e16412d docs(scheduler): add a format reference for scheduled messages
One section with the whole entry format, a table of what each key field accepts, the value options, the message escapes and mesh-count placeholders (previously only in config.ini.example), and the forms the bot rejects with what to write instead. Also drop the paragraph that argued against an exact fortnight, which predates week=, and stop saying keys go straight to CronTrigger.from_crontab.
2026-11-11 22:07:33 -08:00
agessaman 5032bc2709 docs(release): prepare v1.2.0
Add the v1.1.0 to v1.2.0 upgrade notes, leading with the change that makes the Dashboard, Contacts, Mesh Graph and Multibyte pages public when a password is set, and listing the defaults that change what goes on air. Refresh BUGS.md to v1.2.0 and TODO.md's coverage figures from the v1.2.0 run (67%), dropping trace_runner and wx_command from the low-coverage list.
2026-11-11 21:42:46 -08:00
agessaman a47b8cba22 chore(release): bump version to 1.2.0
Cut the [1.2.0] changelog section from Unreleased, and bump pyproject, the Home Assistant add-on version (its image is tagged from the release), and the version examples in the docs and build-deb usage.
2026-11-11 21:28:56 -08:00
Adam Gessaman 863100ef37 Merge pull request #260 from agessaman/feat/flexible-scheduling
feat(scheduler): add positional day-of-month and date bounds
2026-11-11 21:28:30 -08:00
agessaman 615d9c77f2 Merge remote-tracking branch 'origin/dev' into feat/flexible-scheduling
# Conflicts:
#	CHANGELOG.md
2026-11-11 21:17:00 -08:00
agessaman 0c070bb281 Merge remote-tracking branch 'origin/dev' into feat/repeater-offline-reporting
# Conflicts:
#	modules/web_viewer/templates/base.html
2026-11-11 21:16:14 -08:00
Adam Gessaman adfbe20e85 Merge pull request #367 from agessaman/feat/home-assistant-addon
feat: Home Assistant add-on
2026-11-11 21:15:11 -08:00
agessaman 1c75249695 fix(bridges): match hashtag channels and log unmapped ones at info
Discord compared mapping names to the channel name exactly, ignoring case, so bridge.test never matched the #test channel. Telegram already ignored a leading #. Both bridges now share one matcher: an exact match ignoring case wins, otherwise a leading # is ignored on both sides.

A message from a channel with no mapping was dropped with only a debug log, so a mapping that never matched went unnoticed. The first message from each unmapped channel is now logged at info with the configured mappings; repeats stay at debug.
2026-11-10 19:19:36 +00:00
agessaman 7f1d9ad946 fix(core): keep retrying the radio at startup instead of exiting
A test under a real Home Assistant Supervisor showed the watchdog allows 10 restarts per 30 minutes. The bot exited about a second after a refused connection, so a radio that wasn't ready after a reboot used all 10 in about 11 seconds and left the add-on down for half an hour. A failed first connect now falls back to the existing reconnect loop and its [Connection] settings; the bot exits 1 only when reconnect_max_retries runs out, and a shutdown while waiting exits 0.

Also from that test:
- The manifest maps app_config, the name Supervisor 2026.11 uses; addon_config logged a legacy warning. The CI linter accepts both.
- The docs say to turn on Show in sidebar, which the Supervisor leaves off.
- The second start_viewer() call logs at debug instead of warning on every start.
2026-11-09 23:48:38 -08:00
agessaman 12e9db0fdd docs(ha_addon): make the add-on's DOCS.md the single source
The mkdocs page now covers install and points at the add-on documentation instead of repeating it. DOCS.md gains an options table and matches what the entrypoint does. Changelog entries for ha_ingress and the startup exit status.
2026-11-09 20:07:31 -08:00
agessaman 3177134cf8 fix(core): exit 1 when the radio is unreachable at startup
A failed startup connection used to end the process with status 0, which launchd (KeepAlive SuccessfulExit=false) and the Home Assistant watchdog both read as an intentional stop, so neither restarted the bot. start() now returns whether the bot ran, and the entrypoint exits 1 when it didn't. Shutdown by signal still exits 0.
2026-11-09 20:04:40 -08:00
agessaman c017337a44 fix(ha_addon): seed, escape, and win over the local overlay
- Ship config.ini.example in the image so a fresh install can seed config.ini.
- Double % in written values; the bot reads config.ini with interpolation, so a password like abc%xyz used to break every read.
- Delete add-on-managed keys from <local_dir_path>/config.ini, which the bot merges over the base file and would otherwise override them.
- Move local_dir_path to /config/local so custom plugins and translations are reachable from File Editor or Samba.
- Rename the ble_address option to ble_device_name to match the config key.
2026-11-09 19:56:20 -08:00
agessaman 9ff8dcc7f2 feat: add a Home Assistant add-on
Adds repository.yaml and homeassistant/meshcore_bot/ so the repo can be added to the Home Assistant add-on store. The add-on runs a 64-bit image built FROM the release image (Dockerfile.ha). On start, modules/ha_addon.py seeds config.ini, applies add-on options and fixed paths from one mapping table, records which keys Home Assistant owns, and execs the bot. Unset options leave config.ini alone.

CI builds and pushes the add-on image for amd64 and arm64 after the base image and lints the manifest. update_ini_values gains backup_dir so add-on backups land under /data.

Refs #366
2026-11-09 19:26:13 -08:00
agessaman e71c1a71b3 feat(repeater_watch): report watched repeaters that go offline
Adds [Repeater_Watch] and a Settings → Repeater Watch page (#353). A watched repeater counts as offline once it has gone offline_after_hours with no advert and no relayed traffic; relaying is matched by public key, or by a 2- or 3-byte prefix no other known repeater shares, and never by one byte. One notice goes out when it goes offline and one when it is heard again, to channels, DMs, Discord and Telegram.

The bot only judges silence it was listening for: the clock starts at startup, reconnect or radio recovery (a quick restart keeps it), and checks are skipped while the radio is down or the bot has heard no node for two hours. State and recent outages persist in bot_metadata so a restart doesn't repeat a notice. Settings are read on every tick, so saving the page applies without a restart.
2026-11-05 18:11:06 -08:00
agessaman 7af1f46fdd fix(scheduler): close the gaps the second review round found
- An end date closes at the last second before the next local day begins, worked out in UTC. "23:59:59" did not exist on a day whose DST change skips the last hour (America/Nuuk, 2027-03-27), and APScheduler moved it past midnight, letting the schedule fire on the following date.
- APScheduler reads "last" and the ordinals as prefixes, so "last--fri", "lastfri" or "last-" quietly meant the last day of the month. Anything starting with an ordinal must now be "last" or a full positional day. A positional day combined with a day-of-week ("1st-tue * mon") never matches and is rejected.
- A schedule with no future run is invalid in the editor and skipped with a reason at startup, not only when it has date bounds.
- An option with nothing after it ("start=2027-01-01") gets its own error, and a channel that would read as week= is refused like start= and end=.
- The editor resets every builder control on each open, so a new entry no longer inherits the last edited entry's days or monthly choice, and it recognizes the several-times-a-day and every-N modes when reopening an entry. The preview runs the save-time entry checks once channel and message are filled in. With one day a month, a note explains that Weeks skips most months.
- The every-other-week docs example no longer repeats an INI key, a weather-service link follows the moved section, and the changelog says plainly that a key written as last-fri changes meaning: it used to run on the month's last day.
2026-11-04 19:41:50 -08:00
agessaman a0a77a7ed2 feat(scheduler): add week=, a monthly builder mode and stricter parsing
Every-other-week schedules: week= on the value takes an APScheduler ISO week-number expression (week=*/2, week=2-53/2), for a strict fortnight that 1st-tue,3rd-tue cannot give. The schedule editor gains a Weeks setting, a "One day a month" mode (Nth or last weekday, or the Nth or last day) and opens an existing entry in whichever mode reproduces it exactly, falling back to Advanced. Invalid schedules now say why, in the editor and in the startup log. Scheduled messages move to their own docs page.

Review fixes:
- A positional day-of-month item must stand alone between commas. APScheduler silently dropped anything after one, so 1st-tue-3rd-tue and last-fri/2 saved and then fired only on the first match.
- A bound is a whole token ended by whitespace with no ":" in it, so a channel such as start=ops stays a channel, and a keyword with no usable value (start= Public:Hi, start =2027-01-01) is an error rather than a channel name.
- Dates must be exactly YYYY-MM-DD. date.fromisoformat also takes 20270101 and 2027-W01-1 on newer Pythons, which APScheduler then failed on with an error that blamed the cron key.
- The preview applies the same window check as saving, so an end before the start is invalid in both.
- An entry must read back as written: the editor refuses a channel that would parse as a bound and an unscoped message starting "#name:", which was read back as a scope.
- Legacy HHMM with a bad bound reports invalid instead of raising; the scheduler logs why a value was rejected; the create/update response includes start, end and week.
2026-11-04 19:41:49 -08:00
agessaman 081ec7c0a5 Merge branch 'dev' into feat/flexible-scheduling
Brings the branch up to date with dev. Conflicts in CHANGELOG.md and the schedule preview route in modules/web_viewer/app.py, resolved by keeping dev's version and adding the start/end arguments.
2026-11-04 19:41:49 -08:00
Adam Gessaman 716531a558 Merge pull request #359 from Treehouse-00/feat/status-packet-counters
feat(packet_capture): include the radio's packet counters in status stats
2026-11-04 17:58:48 -08:00
agessaman aa335b7938 fix(web_viewer): add a control for allow_local_smtp
allow_local_smtp lives in the bot database with the other SMTP settings, not config.ini, and the Email & Notifications panel never sent it, so there was no way to turn it on short of calling the API by hand. The panel now has a checkbox for it, and the upgrade notes say where the setting lives.

Fixes #361
2026-11-04 16:14:23 -08:00
Treehouse-00 f45124b6a6 feat(packet_capture): include the radio's packet counters in status stats
refresh_stats() asks the radio for core and radio stats only, so status
messages carry no packet counters, and dashboards that show an
observer's received and sent counts have none for the bot. The service
was ported from meshcore-packet-capture in December 2025;
packet-capture added packet stats in June 2026 (3699420), after the
port.

Fetch them with get_stats_packets() the same way as the other two, and
publish them as meshcore-packet-capture does: the library's own keys
(recv, sent, flood_tx, direct_tx, flood_rx, direct_rx, recv_errors)
plus packets_received and packets_sent, the names
meshcore-packet-capture and openhop_repeater publish. The status
example in docs/packet-capture.md showed rx_packets and tx_packets,
names the bot never published; it now shows the real ones.

get_stats_packets() is in every meshcore release the bot allows: it
arrived in 2.2.8 with the core and radio commands. Companion firmware
answers all three from 1.11.0. Older firmware rejects the request with
an immediate error, as it already rejects the other two.
2026-11-01 16:18:10 -08:00
agessaman d37403b221 docs(packet-capture): document a working waev.app MQTT broker
The guide only listed JWT timings. Record the broker block that connects,
and leave the same settings commented in the example config.
2026-10-25 16:42:31 -07:00
agessaman 2a1c2f86d8 feat(web_viewer): rebuild Real-time as one tape of what the radio heard
Real-time was three equal panels (commands, packets, messages) that each scrolled on their own, couldn't be held still, and showed the same transmission up to three times. It's now one tape with one row per transmission: a packet, the channel message decrypted from it and a command it triggered share a row, joined by packet hash, and the bot's reply hangs under the command with how many times a repeater was heard echoing it. Those echoes fold into the reply instead of getting rows of their own, and a packet heard several times is one row with a count and every reception (SNR, RSSI, hops, path) when opened.

A receiver strip at the top says whether the bot is listening or the radio is offline or not responding (from the banner poll base.html already runs, now published as a banner-status event), when it last heard a packet, the packet rate and a 10-minute activity bar. The tape holds still while you read it: Pause (P), scrolling down, a moving mouse pointer or keyboard focus queue new rows behind an "N new" button. Rows can be kept (safe from the 300-row limit and from Clear), filtered to messages or commands, by packet type or channel, and searched (/). Replayed history sits under a "Heard before you opened this page" divider, and adverts and keyed group text are decoded in the browser and labeled as such. Each row's glyph chip carries its packet type's icon in the dashboard chart's color for that type; decoded messages get a stronger tint, and the bot's commands and replies are violet.

Server side, command rows carry trigger_packet_hash (from the message's routing info) and, once the transmission tracker matches a repeat, reply_packet_hash. Replayed rows carry stream_ts and replayed, and live rows stream_ts. Commands stored before this pair with their message only on an exact sender, channel and text match within 20 seconds.

Real-time is admin-only now: its socket already was, so anonymous visitors got three "Admin login required" badges over spinners that never filled. They're redirected to login and the nav link is hidden from them.

The byte breakdown sliced multibyte paths by hop count, so 2- and 3-byte hops spilled into the payload; it uses the path's byte count and shows the raw path-length byte. Route types 0 and 2 were swapped, and the channel key store was often built before the decoder had loaded, so it never decrypted anything. js-sha256 is vendored under static/vendor instead of loading from cdnjs.
2026-10-17 19:40:23 -07:00
agessaman f5f3b6e52a fix(web_viewer): review fixes for plugin settings coverage and template previews
Fixes from a Codex review of the previous commit, plus the shared settings the rebase onto dev showed were still missing.

Settings that misstated or changed what runs:
- sports never read [Sports_Command] api_timeout (documented in the example config); the new field did nothing. It now sets the ESPN timeout.
- The path-byte requirement help on test, multitest and path said "bytes per hop"; the gate checks the path's total size (at least 2, or exactly 3).
- feed's allow_private_urls showed false while it inherited true from [Feed_Manager]. Fields can now name an inherit_section whose value they show when unset.
- notify_on_prefix_bytes was an int field for a value the service reads as a list (2,3), so the form refused a valid setting.
- The greeter's form defaults differed from the fallbacks it uses when the keys are missing. Both now come from shared constants.
- The MQTT weather limits accepted values the service clamps (payload 256 to 1 MiB, staleness 5 s to 7 days, length 64 to 4000).

Shared settings: the wx card now carries the [Weather] temperature, wind and precipitation units and the three temperature_*_format templates (with previews through format_temperature_high_low), next to wx's own [Wx_Command] unit overrides, which default to "Same as [Weather]". Two fields with one key in different sections are told apart as key@Section in the save payload; a bare key still resolves when only one field has it. An enum's "" option, like a blank number, removes the key. Packet capture brokers gain username, password, topic prefix, JWT timings and include_decoded; blank inheriting values are left out of block saves, since the service reads them with getint/getboolean when present.

Previews:
- They use the bot's saved config: a blank test format falls back to [Keywords] test, multitest lays out paths per condense_paths, and MQTT applies passthrough_max_length.
- A quoted empty template ("") counts as blank, as the commands strip the quotes first.
- A str.format width or precision over 500 isn't rendered, so `{sender:100000000}` can't make the endpoint build a huge string.
- The page invalidates an in-flight preview as soon as the field changes, and shows the server's note about fallbacks instead of guessing it.

The endpoint inventory golden gains the preview route (401 for anonymous requests when a password is set).
2026-10-04 15:55:17 -07:00
agessaman 7758403148 feat(web_viewer): cover every plugin setting, with a template reference and preview
The Plugins page now has a field for every setting the plugins read. I compared each plugin's settings_schema against config.ini.example and the keys the code reads; fourteen plugins had gaps (greeter, trace, stats, path, wx/gwx, rain, test, multitest, sports, worldcup, cmd, feed, the webhook, weather, packet capture, earthquake and prefix-collision services) and the World Cup service had no form at all. Webhook URLs, bot tokens and channel keys use the password field. A guard test needed four [Rain_Command] keys documented in config.ini.example.

Template fields get a { } button that opens a reference of the placeholders they take, with click-to-insert. Fields rendered by the piped engine (test's response_format, path's reply_prefix) also list the filters and conditionals. Every template field previews as you type: piped fields against a 2-byte, a 1-byte and a direct sample message, so a conditional's effect shows before saving, and the str.format fields (greeter, mesh info, multitest, MQTT weather) as their plugin renders them, including what it sends when the template has a mistake. The specs and renderers live in modules/template_reference.py; the preview endpoint only renders and never saves. The greeter's channel_greetings parser and multi-part split moved into module functions so the command and the preview share them.

Fixes the new fields would otherwise have exposed:
- Clearing a number field saved `key =`, which makes getint/getfloat raise and the plugin fail to load. A cleared number now removes the key.
- The weather service raised in __init__ when only some blitz_area_* corners were set. It now needs all four and logs a warning otherwise.
- A blank MQTT weather json_template saved an empty template, so every reply said no message had arrived. Blank now saves the default.
2026-10-04 15:41:45 -07:00
agessaman 6468ae03d4 Merge dev (#344) into feat/wx-openmeteo-fallback
Conflict in wx_command.py: the refactor split _get_weather_for_location_sync into _locate_*, _noaa_forecast_body and _with_noaa_alerts. The fallback now checks coverage after _locate_* and when _noaa_forecast_body returns its fetch error. _openmeteo_weather takes no address_info: a city's label comes from city_to_lat_lon again, answered from the geocoding cache the first lookup filled.
2026-10-04 11:20:00 -07:00
agessaman 0e7b9fef0f feat(wx): optional Open-Meteo fallback for places outside NWS coverage
[Weather] openmeteo_fallback (default false, only with weather_provider = noaa) answers wx from Open-Meteo when NWS reports a point as outside its coverage (HTTP 400/404 from /points), in gwx's format and labels and wx's units. Timeouts and server errors keep today's error. The point goes into the existing NWS no-coverage cache, so later requests skip NWS for 24 hours. wx <place> alerts there replies that alerts are not available.

gwx's per-point body moves into _weather_for_point so wx can reuse it without geocoding twice; gwx's output is unchanged.
2026-10-04 08:28:02 -07:00
agessaman ba293bb262 refactor(commands): keep the help TypeError retry for local plugins; fix two doc claims
Codex on 495df80e: choosing the help call by signature also dropped the TypeError retry for local plugins written as get_help_text(self, message=None), which used to fall back to generic help when the message call raised, and inspect.signature itself can raise TypeError on odd callables and then take the wrong branch. help_text_for now decides by where get_help_text is defined: bundled commands (defined under modules.) are called once with the message, so an error from their body propagates as it did before 7aba432b; anything else gets exactly the old call-then-retry. Tests pin both: a bundled body's TypeError runs once, a local plugin's is retried without the message. joke and rain stay the accepted residual (no retry for a TypeError inside their help bodies).

Codex also found two inaccuracies in b569ed5d's docs: ChannelBridgeBase subclasses must also supply _open_http_session and _init_queues, and an empty [Keywords] format means no reply.
2026-10-03 22:57:26 -07:00
agessaman b569ed5de6 docs(local-plugins): document the base class hooks the refactor added
Local plugin authors had no way to learn about enabled_attr, admin_only, keywords_format_key, the get_help_text(self, message=None) signature, translated_or, run_periodic, _cancel_tasks, _subscribe/_unsubscribe_all or ChannelBridgeBase short of reading the base classes. A new "Base class hooks" section lists what each does, with the facts checked against base_command.py, base_service.py and channel_bridge_utils.py.
2026-10-03 22:47:20 -07:00
agessaman de1df09d6f fix(trace): accept a late reply to an earlier attempt, and allow for repeater TX delay
Each attempt waited only for its own tag, so a reply that arrived after its attempt's timeout was dropped once the retry went out. On my test mesh a three-hop trace takes about nine seconds (each repeater waits its random TX delay before forwarding), against a 2.5 s timeout, so every trace failed even though the first attempt's full reply came back.

run_trace now subscribes to TRACE_DATA once, before the first send, and takes a reply to any of its tags until the last attempt's timeout runs out. A reply that lands during the retry delay ends the trace without sending again, and subscribing before the send also closes the window where a fast reply could arrive before wait_for_event was listening.

The timeout defaults go from 1.0 s base and 0.5 s per hop to 2.0 s and 1.5 s, matching the 1.5 s the trace command and its settings schema already used. Configs that set them keep their values.
2026-10-03 09:27:59 -07:00
agessaman f994171818 feat(weather): [Weather] always_show_location names the place in every wx/gwx reply
wx and gwx name the place only when it adds information: a city outside default_state or default_country, or a position. always_show_location (default false) names every place a lookup finds instead, including cities in the bot's own state and ZIP codes.

For a ZIP code, gwx now does a reverse lookup when the option is on (it skipped that since the name was never shown), and wx reuses the reverse lookup it already did for a companion position. A failed lookup leaves the reply unnamed rather than repeating the ZIP code. The prefix comes out of the message budget as before. The option is in the wx settings schema for the web viewer, the example config, the command reference and the changelog.
2026-10-02 07:55:18 -07:00
agessaman 1536f2a634 fix(weather): codex review of the whole branch
- A scheduled {cmd:gwx ...} or {cmd:wx ...} with a forecast and an alert slept out the TX pacing between them during capture; with bot_tx_rate_limit_seconds = 30 that passed the 30 s render timeout and the whole reply was lost. Pacing is skipped when the message has a capture_sink.
- gwx tomorrow ignored its byte budget (a Russian Reykjavik forecast was 99 bytes against 89). It now drops the precipitation amount, gusts, wind, the precipitation chance and the description, in that order. The Open-Meteo goldens give tomorrow runs a roomy budget, since their key-name translator makes the text much longer than real; trimming is tested with real catalogs in test_gwx_tomorrow_budget.
- Custom default sources (bare wx/gwx) still returned True after a refused send.
- An option without a location (wx hourly, gwx tomorrow, wx 5d) showed usage, since the fallback location was resolved before the option was parsed; the option now applies to the fallback, custom default sources included. The docs say how far each provider's forecast reaches.
- wx read its unit settings through get_config_value, whose [Weather] fallback logged a notice to move them into [Wx_Command] on every lookup (14 per reply); _unit_setting reads [Wx_Command], then [Weather], without it.
- NOAA forecasts that mention thunderstorms after sun ("Sunny then Slight Chance Showers And Thunderstorms") still got ☀️; thunderstorms now outrank sun.
- The catalog tests passed with keys removed, since a missing key differs from English; they now require each key and every wind point, with en-GB and Polish allowed to use the English letters.
2026-10-02 01:10:39 -07:00
agessaman 0853739f30 fix(weather): review follow-ups: warning units, wx localization, help text
A space bunny review of this branch's commits found:
- gwx's high-wind warning converted the speed to mph for every catalog, so on a km/h bot it read 49 next to a reply saying 80, and Polish (whose template said km/h) regressed in the merge. The threshold stays 30 mph; the warning shows the speed in the configured unit with a {unit} placeholder in every catalog.
- tomorrow_not_available, tomorrow_error, multiday_not_available and multiday_error were still English in seven catalogs; they are translated, and the catalog test now fails on any weather reply left in English.
- wx kept NOAA's English wind letters and English weekday letters while gwx's are translated, so one German bot showed NE and NO for the same wind. wx now translates both through the catalog (commands.wx.day_abbrev added); English output is byte-for-byte unchanged, which the goldens show (their stub translator gives English for these short labels, via tests.helpers.key_name_translate).
- Polish feels_like was ungrammatical (odczuwalna -> odczuwalnie), Russian's used a nonstandard abbreviation, and Russian gwx's MQTT subscriber error lacked wx's hint.
- The help text (commands.wx.description/usage, commands.gwx.usage) described wx as ZIP-only; it now lists cities, coordinates and the options, under 130 bytes in every language.
- The generated default config, the docs' default_state wording, _fit_tomorrow_parts' docstring and the CHANGELOG's stats claim were inaccurate.
2026-10-02 00:48:31 -07:00
agessaman 927a3746a8 docs(weather): describe wx and gwx as they now behave
The command reference described wx as ZIP-only and gwx as a list of fields. It now gives both commands' accepted locations, options (tomorrow, hourly, Nd, alerts), the order they fall back through when no location is given, the unit settings, when the reply names the place, what custom WXSIM and MQTT sources answer, and that both work in scheduled messages. The config example's default_state/default_country comments say how they affect the place name, the no-location comment lists default_city, and the weather service page lists the wind units that actually exist.
2026-10-01 23:35:48 -07:00
agessaman f893c7f00d feat(gwx): allow gwx in scheduled {cmd:...} messages
gwx was not render_safe, so {cmd:gwx ...} expanded to nothing, while {cmd:wx ...} already ran gwx through delegation when weather_provider = openmeteo. gwx sends every reply, including the two-part warning, through send_response, which is what render_safe requires. Tests render gwx (plain and two-part replies) through the real CommandManager capture and check nothing is transmitted.
2026-10-01 22:13:06 -07:00
Adam Gessaman 1c5e82ab79 Merge pull request #311 from agessaman/docs/region-scopes
docs: add a region scopes page
2026-10-01 18:40:05 -07:00
agessaman 278f78a10c docs(region-scopes): correct uncorrelated-message, device default and log line claims
Review follow-up. With * listed, an uncorrelated message is still answered globally when no scoped packet was heard around it; the radio's default scope does apply to sends the bot leaves unscoped; [Scheduled_Messages] needs the leading #; and the outbound log lines are quoted as they are actually printed, including that the global one is DEBUG.
2026-10-01 00:27:48 -07:00
agessaman 5a71a0efc8 fix(region-warnings): resolve and validate the warning scope before reserving a slot
Review follow-up. The scope read could raise (a bare '%' under interpolation) after the 'sent' row and mesh cooldown were reserved, and the rollback never ran, so the log showed a warning that never went on the air. The scope and body are now prepared before anything is reserved, and a failure is recorded as a failed attempt. [Region_Warnings] flood_scope is read raw and validated, because set_flood_scope's failure path sends anyway at whatever scope the radio holds. Dry runs now log the truncated body the live send would use.
2026-09-30 22:26:09 -07:00
agessaman ab5049a985 fix(region-warnings): send channel warnings at the bot's configured scope
Channel-delivered region warnings were hard-coded to scope='*', on the belief that a sender with no region could not hear a scoped message. That is not how MeshCore works: the companion firmware's filterRecvFloodPacket drops nothing, so a client accepts a regional flood whatever region it has set itself, and only repeaters decide how far it goes. The override only meant that a bot configured with outgoing_flood_scope_override flooded the whole mesh to tell someone not to, which is exactly what #306 reports (the log shows the override 'was not applied (explicit scope="*")').

The warning now resolves its scope like any other proactive channel send: [Region_Warnings] flood_scope, then flood_scope.<channel>, then outgoing_flood_scope_override, then global. Its body is sized with channel_body_budget so the regional overhead is accounted for, and the web viewer's byte limit reserves that overhead whenever a regional scope could apply. flood_scope = * restores the old behavior.
2026-09-30 22:20:02 -07:00
agessaman 2abc5ab920 docs: add a region scopes page explaining flood_scopes and reply mirroring
Region names have to be given to the bot before it can answer inside a sender's region, because the transport code is an HMAC over each packet's payload and cannot be turned back into a name. That was only spelled out in config.ini.example and a dense paragraph in configuration.md, which is how #296 came about. The new page covers how a scope works on the air, what each flood_scopes setting does to replies, the precedence for the bot's own messages, the Radio page, and the log lines that show whether a reply went out scoped.
2026-09-30 22:17:40 -07:00
agessaman 1e7951b3a5 docs: state that a blank flood_scopes list does not mirror region
A blank list still answers channel commands as ordinary global FLOOD. The web viewer text implied the reply would follow the sender's scope.
2026-09-22 16:56:08 -07:00
CoderNemesis 5175558dd7 fix(send): split oversized channel text before it stalls the radio (#299)
An oversized webhook or channel body was handed to the firmware whole. The device dropped it without an ack, retries stalled the transport, and the radio looked dead. Split to the frame budget, keep links intact, and tag multi-part sends so they can be reassembled.

Reserve the wx location prefix from that same budget, and let NOAA alert polling be turned off without disabling the rest of the weather service.
2026-09-22 16:21:54 -07:00
agessaman 31e56b3766 chore(release): prepare 1.1.0
Fold the Unreleased section into 1.1.0 and date it. The 1.1.0 heading was
written on 2026-09-13 but never tagged, so everything merged since belongs in
it; the section also carried two separate "### Added" headings from earlier
merges, now consolidated. All 79 entries preserved.

Extend the v1.0.0 -> v1.1.0 upgrade guide with the meshcore 2.3.14 requirement,
migration 24, and the configuration and behavior changes that landed after the
heading was first written.
2026-09-20 11:44:34 -07:00
agessaman cc6ca00b4e docs(keywords): say the newline escape is a backslash, not a slash (#277)
The report used /n and got two literal characters. The escape works the same in
every keyword path — I checked the test command's template engine too — so the
defect is that the instructions never said "backslash" and used `test` as their
example, which is the one keyword a built-in command owns. That command renders
through a different engine and silently drops the mesh-info placeholders listed
in the same block.

Also documents the configparser continuation form, which needs no escape, and
corrects two packet-capture examples that still showed a naive local timestamp
where the bot has published UTC with a Z suffix since v1.0.0 (#276).
2026-09-20 10:58:17 -07:00
agessaman b5e61306b2 Merge remote-tracking branch 'origin/dev' into feat/region-code-warnings
# Conflicts:
#	CHANGELOG.md
2026-09-20 10:43:24 -07:00
Gerard Hickey 0fe22d2b4f docs: Documentation for developing local commands (#259)
* docs: Documentation for developing local commands

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* Updated for developing using the local directory

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* Minor updates and corrections

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* Implementing recommendations from agessaman

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* Update CHANGELOG.md

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

---------

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>
2026-09-20 10:42:04 -07:00