diff --git a/dashboard-frontend/src/pages/Reference.tsx b/dashboard-frontend/src/pages/Reference.tsx index 59db92b..1d47611 100644 --- a/dashboard-frontend/src/pages/Reference.tsx +++ b/dashboard-frontend/src/pages/Reference.tsx @@ -1,972 +1,1076 @@ -import { useState, useEffect, useRef } from 'react' -import { useLocation } from 'react-router-dom' -import { - Search, Droplets, Flame, Satellite, CloudLightning, Sun, - Radio, Mountain, Car, Construction, Activity, Bell, Terminal, - Code, ExternalLink -} from 'lucide-react' - -// Topic definitions -const TOPICS = [ - { id: 'stream-gauges', label: 'Stream Gauges', icon: Droplets }, - { id: 'wildfire', label: 'Wildfire', icon: Flame }, - { id: 'firms', label: 'Satellite Fire Detection (FIRMS)', icon: Satellite }, - { id: 'weather-alerts', label: 'Weather Alerts', icon: CloudLightning }, - { id: 'solar', label: 'Solar & Geomagnetic', icon: Sun }, - { id: 'ducting', label: 'Tropospheric Ducting', icon: Radio }, - { id: 'avalanche', label: 'Avalanche Danger', icon: Mountain }, - { id: 'traffic', label: 'Traffic Flow', icon: Car }, - { id: 'roads-511', label: 'Road Conditions (511)', icon: Construction }, - { id: 'mesh-health', label: 'Mesh Health', icon: Activity }, - { id: 'notifications', label: 'Notifications', icon: Bell }, - { id: 'commands', label: 'Commands', icon: Terminal }, - { id: 'api', label: 'API Reference', icon: Code }, -] - -// Status indicator component for colored dots -function StatusDot({ color }: { color: 'green' | 'yellow' | 'orange' | 'red' | 'black' }) { - const colorClasses = { - green: 'bg-green-500', - yellow: 'bg-yellow-500', - orange: 'bg-orange-500', - red: 'bg-red-500', - black: 'bg-slate-800 border border-slate-600', - } - return -} - -// Table component styled for dark theme -function RefTable({ headers, rows }: { headers: string[]; rows: (string | React.ReactNode)[][] }) { - return ( -
| {h} | - ))} -
|---|
| {cell} | - ))} -
{children}
-}
-
-// Topic section wrapper
-function TopicSection({ id, title, children }: { id: string; title: string; children: React.ReactNode }) {
- return (
- - Everything you need to understand and configure MeshAI's monitoring and alerting systems. -
- - {/* Stream Gauges */} -- MeshAI watches river and stream levels at gauges you configure. Each gauge reports two things: -
-- Water Level (Gage Height) — how high the water is, measured in feet. Important: this is NOT the depth of the river. It's the height above a fixed measuring point that's different at every gauge. A reading of "10 feet" at one gauge means something completely different than "10 feet" at another. You can only compare readings from the SAME gauge over time. -
-- Flow (Discharge) — how much water is moving past the gauge, in cubic feet per second (CFS). Think of it as the river's "throughput." For scale: -
-- Flood levels are set by the National Weather Service, not USGS. NWS looks at each specific gauge location and decides "at what water level does the road flood? At what level do buildings get water?" Those levels are different everywhere. -
-Action Stage — water is rising, time to start paying attention. Usually still inside the riverbanks.
-Minor Flood — low-lying roads start getting water on them. NWS issues a Flood Advisory.
-Moderate Flood — water in buildings near the river. Some people need to evacuate. NWS issues a Flood Warning.
-Major Flood — widespread flooding. Many people evacuating. Serious property damage.
-- MeshAI automatically looks up the flood levels for your gauge from NWS when you add a site. Some remote gauges don't have flood levels assigned — for those, you set them manually if you know what water levels cause problems in your area. -
- -- There's no official "drought stage" for most gauges. If you need to monitor low water (irrigation, fish habitat), set a manual low-water threshold based on what you know about your local river. -
- -If NWS flood levels don't populate, your gauge may not have them. Set manual thresholds if you know your local conditions.
- -- MeshAI tracks active wildfire perimeters from the National Interagency Fire Center (NIFC). For each fire, you see the name, size, how much is contained, and how far it is from your mesh nodes. -
- -For reference, 1,000 acres is about 1.5 square miles.
- -- Containment means the percentage of the fire's edge where firefighters have built a control line (a cleared strip to stop the fire from spreading further). It does NOT mean the fire is out inside that line. -
-- How fast can a fire travel? In grass with wind: up to 14 mph. In heavy timber: 1-6 mph. A fire 10 miles away could theoretically reach you in 1-2 hours under worst-case conditions, but typical spread is much slower. -
- -- Distance is the immediate concern. A small uncontained fire 10 km away is more dangerous right now than a huge fire 50 km away. But big fires have more energy and can grow fast under wind shifts — keep watching them. -
- -
- Just configure your state code (like
- NASA's VIIRS satellites orbit the Earth and look for heat signatures on the ground. When they see something hot — a fire, a factory, a sunlit building — they flag it as a "hotspot." MeshAI checks these detections for your area. -
-- Why this matters: satellite hotspots show up hours before official fire perimeters are mapped. If a new fire starts near your mesh, the satellite might see it before anyone on the ground reports it. -
- -Each detection gets a confidence rating:
-- Recommendation: Set the filter to "Nominal + High." If you include "Low" you'll get alerts for every hot parking lot on a summer day. -
- -FRP (Fire Radiative Power) measures the heat output in megawatts. Think of it as "how hot is this thing":
-Setting the minimum FRP to 5 MW filters out most industrial and agricultural false alarms.
- -- MeshAI cross-references satellite hotspots against known NIFC fire perimeters. If a hotspot is NOT near any known fire, it gets flagged as a potential new ignition — maybe a new fire just started. These get elevated priority regardless of confidence level. -
- -- Satellite data arrives 1-3 hours after the satellite passes overhead. Each location gets observed about 6 times per day across all satellites, so there are multi-hour gaps. This is not real-time — it's "pretty recent." -
- -- MeshAI watches for NWS (National Weather Service) alerts affecting your area — warnings, watches, and advisories. -
- -- A single alert has all three. A hurricane warning for next week is "Severe + Future + Likely." A tornado spotted on the ground is "Extreme + Immediate + Observed." An air quality advisory is "Minor + Expected + Possible." -
- -- Moderate is recommended. It catches Watches (advance warning that conditions may worsen) and Advisories (conditions exist but aren't severe) while filtering out the informational stuff. -
- -- NWS wants to know who's using their API — not for approval, just so they can contact you if something breaks. You make it up: -
-No registration. No waiting. Just type it in.
- -- MeshAI tracks space weather — solar activity and its effects on Earth's magnetic field. This matters for radio operators because the sun directly controls how well HF radio works, and major solar events can affect all radio communications. -
- -Think of SFI as a "how active is the sun" number. Higher = better for HF radio, but also higher risk of solar flares.
-Quick rule: SFI above 90 and Kp below 4 = good day for HF radio.
- -Kp measures how disturbed Earth's magnetic field is, on a 0-9 scale. Higher = more disturbance = worse for HF radio but better for aurora viewing.
-NOAA's shorthand for three types of space weather events:
-- Bz measures the direction of the solar wind's magnetic field. When it points south (negative values), the solar wind can dump energy into Earth's magnetic field, causing storms. -
-Bz can change fast — minute to minute. What matters is whether it stays negative for hours, not brief dips.
- -- Sometimes the atmosphere creates an invisible "pipe" that traps radio signals and carries them much farther than normal. This is called tropospheric ducting. It mostly affects VHF and UHF frequencies. -
-- MeshAI watches for these conditions by analyzing weather data (temperature and humidity at different altitudes) over your mesh area. -
- -MeshAI reports a "condition" based on the atmospheric profile:
-When ducting happens on your mesh:
-The dashboard shows a "dM/dz" value in "M-units/km." You don't need to understand the math — just know:
-- Just configure the latitude and longitude of the center of your mesh area in Config → Environmental → Ducting. MeshAI checks the atmospheric conditions there every 3 hours using free weather model data. No API key needed. -
- -- MeshAI pulls avalanche forecasts from your regional avalanche center during winter months. The danger scale has 5 levels and it's the same across all of North America. -
- -- Level 3 (Considerable) kills more people than any other level. People look at "3 out of 5" and think "middle of the road, probably okay." In reality, the risk roughly doubles at each step up the scale. Level 3 is where dangerous conditions overlap with people thinking they can handle it. -
- -- MeshAI only checks avalanche conditions during winter months (configurable, default December through April). Outside season, it shows "off season" and saves API calls. -
- -
- Go to
- MeshAI monitors traffic speed on road segments you configure, using data from TomTom (real vehicles with navigation apps reporting their speed). -
- -MeshAI compares current speed to "free-flow speed" (what traffic normally does when the road is empty). The ratio tells you how congested it is:
-- Note: "free-flow speed" is NOT the speed limit. It's what traffic actually does on that road when nobody's in the way. Drivers often exceed speed limits on open highways. -
- -TomTom's confidence score tells you how much of the reading comes from real vehicles right now vs historical averages:
-Set minimum confidence to 0.7 to avoid false congestion alerts at night or on rural roads where few probe vehicles drive.
- -Each "corridor" is a point on a road you want to monitor. To add one:
-- 511 systems report road closures, construction, weather events, mountain pass conditions, and incidents. Every state runs their own 511 system — there is no national API. -
- -- You need to find YOUR state's 511 developer API. MeshAI does not include a default URL because every state is different. Some states have free public APIs, some require registration, and some don't have developer APIs at all. -
-Configure in Config → Environmental → 511:
-Check your state's 511 or DOT website for developer information.
-MeshAI computes a 0-100 health score for your mesh network by looking at five areas:
-- Meshtastic radios share one LoRa channel. If too many nodes are transmitting too often, they step on each other and messages get lost. -
-- ⚠️ "Packet flooding" means a node sending too many RADIO PACKETS. This has nothing to do with water flooding. -
-- A normal Meshtastic node sends a packet every few minutes (announcing itself, reporting telemetry, updating position). If a node starts blasting packets every few seconds, something is wrong — firmware bug, stuck transmitter, or misconfiguration. -
-- Most Meshtastic radios (T-Beam, RAK4631, Heltec V3) use a single lithium battery cell. The voltage tells you how much charge is left: -
-- USB-powered nodes report 100% battery even if there's no battery installed. Battery alerts only matter for nodes actually running on battery power. -
- -- MeshAI marks a node as "offline" when it hasn't been heard for a configurable time period. Different node types need different thresholds: -
-- Rule of thumb: set the threshold to about 4× the node's beacon interval. Too tight and nodes will constantly flap "offline/online" from normal gaps. Too loose and real outages go unnoticed. -
-Each rule answers three questions:
-- Use "Add from Template" to start with a pre-built rule and customize it, or build from scratch with "Add Rule." -
- -- "Warning" is the sweet spot for most rules. You get alerted when something actually needs your attention without being overwhelmed by every minor event. -
- -- When enabled, non-emergency notifications are held during sleeping hours (default 10pm-6am). Emergency alerts and rules marked "Override Quiet Hours" always get through. -
-You can turn quiet hours off entirely if you don't want them.
- -- A webhook sends your alert as an HTTP POST to any URL. This one delivery method works with: -
-- MeshAI doesn't need to know what's on the other end. Give it the URL and it works. -
-
- All commands use the
- MeshAI isn't just commands — you can ask it questions in plain English. "How's the mesh doing?" "Is there any ducting?" "What's the fire situation?" "How's traffic on I-84?" It uses the live environmental data and mesh health data to answer. -
-
- MeshAI's REST API is available at
| {h} | + ))} +
|---|
| {cell} | + ))} +
{children}
+}
+
+// Topic section wrapper
+function TopicSection({ id, title, children }: { id: string; title: string; children: React.ReactNode }) {
+ return (
+ + Everything you need to understand and configure MeshAI's monitoring and alerting systems. +
+ + {/* Stream Gauges */} ++ MeshAI watches river and stream levels at gauges you configure. Each gauge reports two things: +
++ Water Level (Gage Height) — how high the water is, measured in feet. Important: this is NOT the depth of the river. It's the height above a fixed measuring point that's different at every gauge. A reading of "10 feet" at one gauge means something completely different than "10 feet" at another. You can only compare readings from the SAME gauge over time. +
++ Flow (Discharge) — how much water is moving past the gauge, in cubic feet per second (CFS). Think of it as the river's "throughput." For scale: +
++ Flood levels are set by the National Weather Service, not USGS. NWS looks at each specific gauge location and decides "at what water level does the road flood? At what level do buildings get water?" Those levels are different everywhere. +
+Action Stage — water is rising, time to start paying attention. Usually still inside the riverbanks.
+Minor Flood — low-lying roads start getting water on them. NWS issues a Flood Advisory.
+Moderate Flood — water in buildings near the river. Some people need to evacuate. NWS issues a Flood Warning.
+Major Flood — widespread flooding. Many people evacuating. Serious property damage.
++ MeshAI automatically looks up the flood levels for your gauge from NWS when you add a site. Some remote gauges don't have flood levels assigned — for those, you set them manually if you know what water levels cause problems in your area. +
+ ++ There's no official "drought stage" for most gauges. If you need to monitor low water (irrigation, fish habitat), set a manual low-water threshold based on what you know about your local river. +
+ +If NWS flood levels don't populate, your gauge may not have them. Set manual thresholds if you know your local conditions.
+ ++ MeshAI tracks active wildfire perimeters from the National Interagency Fire Center (NIFC). For each fire, you see the name, size, how much is contained, and how far it is from your mesh nodes. +
+ +For reference, 1,000 acres is about 1.5 square miles.
+ ++ Containment means the percentage of the fire's edge where firefighters have built a control line (a cleared strip to stop the fire from spreading further). It does NOT mean the fire is out inside that line. +
++ How fast can a fire travel? In grass with wind: up to 14 mph. In heavy timber: 1-6 mph. A fire 10 miles away could theoretically reach you in 1-2 hours under worst-case conditions, but typical spread is much slower. +
+ ++ Distance is the immediate concern. A small uncontained fire 10 km away is more dangerous right now than a huge fire 50 km away. But big fires have more energy and can grow fast under wind shifts — keep watching them. +
+ +
+ Just configure your state code (like
+ NASA's VIIRS satellites orbit the Earth and look for heat signatures on the ground. When they see something hot — a fire, a factory, a sunlit building — they flag it as a "hotspot." MeshAI checks these detections for your area. +
++ Why this matters: satellite hotspots show up hours before official fire perimeters are mapped. If a new fire starts near your mesh, the satellite might see it before anyone on the ground reports it. +
+ +Each detection gets a confidence rating:
++ Recommendation: Set the filter to "Nominal + High." If you include "Low" you'll get alerts for every hot parking lot on a summer day. +
+ +FRP (Fire Radiative Power) measures the heat output in megawatts. Think of it as "how hot is this thing":
+Setting the minimum FRP to 5 MW filters out most industrial and agricultural false alarms.
+ ++ MeshAI cross-references satellite hotspots against known NIFC fire perimeters. If a hotspot is NOT near any known fire, it gets flagged as a potential new ignition — maybe a new fire just started. These get elevated priority regardless of confidence level. +
+ ++ Satellite data arrives 1-3 hours after the satellite passes overhead. Each location gets observed about 6 times per day across all satellites, so there are multi-hour gaps. This is not real-time — it's "pretty recent." +
+ ++ MeshAI watches for NWS (National Weather Service) alerts affecting your area — warnings, watches, and advisories. +
+ ++ A single alert has all three. A hurricane warning for next week is "Severe + Future + Likely." A tornado spotted on the ground is "Extreme + Immediate + Observed." An air quality advisory is "Minor + Expected + Possible." +
+ ++ Moderate is recommended. It catches Watches (advance warning that conditions may worsen) and Advisories (conditions exist but aren't severe) while filtering out the informational stuff. +
+ ++ NWS wants to know who's using their API — not for approval, just so they can contact you if something breaks. You make it up: +
+No registration. No waiting. Just type it in.
+ ++ MeshAI tracks space weather — solar activity and its effects on Earth's magnetic field. This matters for radio operators because the sun directly controls how well HF radio works, and major solar events can affect all radio communications. +
+ +Think of SFI as a "how active is the sun" number. Higher = better for HF radio, but also higher risk of solar flares.
+Quick rule: SFI above 90 and Kp below 4 = good day for HF radio.
+ +Kp measures how disturbed Earth's magnetic field is, on a 0-9 scale. Higher = more disturbance = worse for HF radio but better for aurora viewing.
+NOAA's shorthand for three types of space weather events:
++ Bz measures the direction of the solar wind's magnetic field. When it points south (negative values), the solar wind can dump energy into Earth's magnetic field, causing storms. +
+Bz can change fast — minute to minute. What matters is whether it stays negative for hours, not brief dips.
+ ++ Sometimes the atmosphere creates an invisible "pipe" that traps radio signals and carries them much farther than normal. This is called tropospheric ducting. It mostly affects VHF and UHF frequencies. +
++ MeshAI watches for these conditions by analyzing weather data (temperature and humidity at different altitudes) over your mesh area. +
+ +MeshAI reports a "condition" based on the atmospheric profile:
+When ducting happens on your mesh:
+The dashboard shows a "dM/dz" value in "M-units/km." You don't need to understand the math — just know:
++ Just configure the latitude and longitude of the center of your mesh area in Config → Environmental → Ducting. MeshAI checks the atmospheric conditions there every 3 hours using free weather model data. No API key needed. +
+ ++ MeshAI pulls avalanche forecasts from your regional avalanche center during winter months. The danger scale has 5 levels and it's the same across all of North America. +
+ ++ Level 3 (Considerable) kills more people than any other level. People look at "3 out of 5" and think "middle of the road, probably okay." In reality, the risk roughly doubles at each step up the scale. Level 3 is where dangerous conditions overlap with people thinking they can handle it. +
+ ++ MeshAI only checks avalanche conditions during winter months (configurable, default December through April). Outside season, it shows "off season" and saves API calls. +
+ +
+ Go to
+ MeshAI monitors traffic speed on road segments you configure, using data from TomTom (real vehicles with navigation apps reporting their speed). +
+ +MeshAI compares current speed to "free-flow speed" (what traffic normally does when the road is empty). The ratio tells you how congested it is:
++ Note: "free-flow speed" is NOT the speed limit. It's what traffic actually does on that road when nobody's in the way. Drivers often exceed speed limits on open highways. +
+ +TomTom's confidence score tells you how much of the reading comes from real vehicles right now vs historical averages:
+Set minimum confidence to 0.7 to avoid false congestion alerts at night or on rural roads where few probe vehicles drive.
+ +Each "corridor" is a point on a road you want to monitor. To add one:
++ 511 systems report road closures, construction, weather events, mountain pass conditions, and incidents. Every state runs their own 511 system — there is no national API. +
+ ++ You need to find YOUR state's 511 developer API. MeshAI does not include a default URL because every state is different. Some states have free public APIs, some require registration, and some don't have developer APIs at all. +
+Configure in Config → Environmental → 511:
+Check your state's 511 or DOT website for developer information.
+MeshAI computes a 0-100 health score for your mesh network by looking at five areas, each weighted differently:
+The overall score is the weighted sum:
++ Score = (Infrastructure × 30%) + (Utilization × 25%) + (Coverage × 20%) + (Behavior × 15%) + (Power × 10%) +
+ ++ This is the simplest pillar — what percentage of your infrastructure nodes are currently online? +
++ (routers online ÷ total routers) × 100 +
+
+ Only nodes with the
+ Special case: If you have no routers at all (all clients), this pillar scores 100. You're not penalized for not having infrastructure — you just don't have any to track. +
+ ++ Estimates how much of the radio channel's airtime is being used. MeshAI can't measure airtime directly, so it estimates based on packet counts over the last 24 hours. +
+
+ packets_per_hour = non_text_packets ÷ 24
+ airtime_estimate = (packets_per_hour × 200ms) ÷ 3,600,000ms × 100%
+
+ The 200ms is an approximation for the MediumFast radio preset — each LoRa packet takes roughly 200ms of airtime. Text messages don't count toward utilization (chatting is the point of a mesh). +
++ Special case: If MeshAI doesn't have packet data (no sources reporting packet counts), this pillar scores 100. You're not penalized for missing data. +
+ ++ Measures gateway redundancy — how many of your data sources can "see" each node. A node reported by all 3 of your gateways has full coverage. A node only seen by 1 gateway is a single point of failure. +
+
+ coverage_ratio = average_gateways_per_node ÷ total_sources
+ single_gw_penalty = (single_gateway_nodes ÷ total_nodes) × 40
+
+ If a node is seen by 2 out of 3 sources, its coverage ratio is 0.67. Infrastructure nodes with only single-gateway coverage get an extra penalty — they're critical but have no backup path. +
++ Special case: With only 1 data source, this pillar can't score well — there's no redundancy to measure. Coverage becomes meaningful when you have 2+ sources (MeshMonitor + MQTT, multiple gateways, etc.). +
+ ++ Counts how many nodes are sending an unusually high number of non-text packets. This catches firmware bugs, stuck transmitters, and misconfigured nodes that are flooding the channel. +
++ What counts as flooding: More than 500 non-text packets in 24 hours. Text messages don't count — the behavior pillar only flags telemetry, position, and routing packet floods. +
++ A single misbehaving node only drops the score to 80. It takes multiple problem nodes to seriously hurt the behavior pillar. +
+ ++ Measures what fraction of battery-powered nodes are below the warning threshold (default 20%). +
++ 100 × (1 − low_battery_nodes ÷ total_battery_nodes) +
++ If 2 out of 10 battery nodes are below 20%, power scores 80. +
++ Important: USB-powered nodes are excluded from this calculation. Many nodes report 100% battery even when running on wall power with no battery installed. Only nodes actually running on batteries affect this pillar. +
+ ++ Meshtastic radios share one LoRa channel. If too many nodes are transmitting too often, they step on each other and messages get lost. +
++ ⚠️ "Packet flooding" means a node sending too many RADIO PACKETS. This has nothing to do with water flooding. +
++ A normal Meshtastic node sends a packet every few minutes (announcing itself, reporting telemetry, updating position). If a node starts blasting packets every few seconds, something is wrong — firmware bug, stuck transmitter, or misconfiguration. +
++ Most Meshtastic radios (T-Beam, RAK4631, Heltec V3) use a single lithium battery cell. The voltage tells you how much charge is left: +
++ USB-powered nodes report 100% battery even if there's no battery installed. Battery alerts only matter for nodes actually running on battery power. +
+ ++ MeshAI marks a node as "offline" when it hasn't been heard for a configurable time period. Different node types need different thresholds: +
++ Rule of thumb: set the threshold to about 4× the node's beacon interval. Too tight and nodes will constantly flap "offline/online" from normal gaps. Too loose and real outages go unnoticed. +
+Each rule answers three questions:
++ Use "Add from Template" to start with a pre-built rule and customize it, or build from scratch with "Add Rule." +
+ ++ "Warning" is the sweet spot for most rules. You get alerted when something actually needs your attention without being overwhelmed by every minor event. +
+ ++ When enabled, non-emergency notifications are held during sleeping hours (default 10pm-6am). Emergency alerts and rules marked "Override Quiet Hours" always get through. +
+You can turn quiet hours off entirely if you don't want them.
+ ++ A webhook sends your alert as an HTTP POST to any URL. This one delivery method works with: +
++ MeshAI doesn't need to know what's on the other end. Give it the URL and it works. +
+
+ All commands use the
+ MeshAI isn't just commands — you can ask it questions in plain English. "How's the mesh doing?" "Is there any ducting?" "What's the fire situation?" "How's traffic on I-84?" It uses the live environmental data and mesh health data to answer. +
+
+ MeshAI's REST API is available at