Skip to content

Commit 7b99eda

Browse files
author
Dennis Braun
committed
Update thresholds.json with exact VFKD forum values
- SNR: exact values from forum (256QAM >33, 64QAM >27, 1024QAM >39) - US Power: split by DOCSIS version (3.0 vs 3.1) - Fritz!Box DOCSIS 3.1 US offset: -6 dB applied to thresholds - US assessment now uses DOCSIS version instead of modulation - Source: vodafonekabelforum.de/viewtopic.php?t=39941 (all 3 sections)
1 parent b43ce2f commit 7b99eda

File tree

2 files changed

+39
-37
lines changed

2 files changed

+39
-37
lines changed

app/analyzer.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,17 @@ def _get_ds_power_thresholds(modulation=None):
4141
}
4242

4343

44-
def _get_us_power_thresholds(modulation=None):
45-
"""Get US power thresholds for a given modulation."""
44+
def _get_us_power_thresholds(docsis_version=None):
45+
"""Get US power thresholds for a given DOCSIS version."""
4646
us = _thresholds.get("upstream_power", {})
47-
default_mod = us.get("_default", "64QAM")
48-
mod = modulation if modulation in us else default_mod
49-
t = us.get(mod, {})
47+
default_ver = us.get("_default", "EuroDOCSIS 3.0")
48+
# Map version strings
49+
ver = default_ver
50+
if docsis_version in ("3.1", "DOCSIS 3.1"):
51+
ver = "DOCSIS 3.1"
52+
elif docsis_version in ("3.0", "EuroDOCSIS 3.0"):
53+
ver = "EuroDOCSIS 3.0"
54+
t = us.get(ver, us.get(default_ver, {}))
5055
return {
5156
"good_min": t.get("good_min", 41.0),
5257
"good_max": t.get("good_max", 47.0),
@@ -126,13 +131,12 @@ def _assess_ds_channel(ch, docsis_ver):
126131
return _channel_health(issues), _health_detail(issues)
127132

128133

129-
def _assess_us_channel(ch):
134+
def _assess_us_channel(ch, docsis_ver="3.0"):
130135
"""Assess a single upstream channel. Returns (health, health_detail)."""
131136
issues = []
132137
power = _parse_float(ch.get("powerLevel"))
133-
modulation = (ch.get("modulation") or ch.get("type") or "").upper().replace("-", "")
134138

135-
pt = _get_us_power_thresholds(modulation)
139+
pt = _get_us_power_thresholds(docsis_ver)
136140
if power < pt["crit_min"] or power > pt["crit_max"]:
137141
issues.append("power critical")
138142
elif power < pt["good_min"] or power > pt["good_max"]:
@@ -197,7 +201,7 @@ def analyze(data: dict) -> dict:
197201
# --- Parse upstream channels ---
198202
us_channels = []
199203
for ch in us30:
200-
health, health_detail = _assess_us_channel(ch)
204+
health, health_detail = _assess_us_channel(ch, "3.0")
201205
us_channels.append({
202206
"channel_id": ch.get("channelID", 0),
203207
"frequency": ch.get("frequency", ""),
@@ -209,7 +213,7 @@ def analyze(data: dict) -> dict:
209213
"health_detail": health_detail,
210214
})
211215
for ch in us31:
212-
health, health_detail = _assess_us_channel(ch)
216+
health, health_detail = _assess_us_channel(ch, "3.1")
213217
us_channels.append({
214218
"channel_id": ch.get("channelID", 0),
215219
"frequency": ch.get("frequency", ""),

app/thresholds.json

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"_source": "Vodafone Kabel Deutschland (VFKD) guidelines, vodafonekabelforum.de/viewtopic.php?t=39941",
3-
"_note": "All power values in dBmV (as shown by Fritz!Box). SNR/MER in dB.",
3+
"_note": "All power values in dBmV (as shown by Fritz!Box). SNR/MER in dB (absolute values).",
44

55
"downstream_power": {
6+
"_comment": "Asymmetric ranges per modulation",
67
"256QAM": {
78
"good_min": -3.9, "good_max": 13.0,
89
"tolerated_min": -5.9, "tolerated_max": 18.0,
@@ -25,45 +26,42 @@
2526
},
2627

2728
"upstream_power": {
28-
"64QAM": {
29+
"_comment_fritz": "Fritz!Box shows DOCSIS 3.1 upstream 6 dB lower than actual. Values here are as displayed by Fritz!Box.",
30+
"EuroDOCSIS 3.0": {
2931
"good_min": 41.1, "good_max": 47.0,
30-
"tolerated_min": 38.1, "tolerated_max": 50.0,
32+
"tolerated_min": 37.1, "tolerated_max": 51.0,
3133
"monthly_min": 35.1, "monthly_max": 53.0,
3234
"immediate_min": 35.0, "immediate_max": 53.0
3335
},
34-
"128QAM": {
35-
"good_min": 44.1, "good_max": 47.0,
36-
"tolerated_min": 41.1, "tolerated_max": 50.0,
37-
"monthly_min": 38.1, "monthly_max": 53.0,
38-
"immediate_min": 38.0, "immediate_max": 53.0
36+
"DOCSIS 3.1": {
37+
"_comment": "Values adjusted for Fritz!Box display (-6 dB from actual). Actual regelkonform: 44.1-47.0",
38+
"good_min": 38.1, "good_max": 41.0,
39+
"tolerated_min": 34.1, "tolerated_max": 44.0,
40+
"monthly_min": 32.1, "monthly_max": 50.0,
41+
"immediate_min": 32.0, "immediate_max": 50.0
3942
},
40-
"_default": "64QAM"
43+
"_default": "EuroDOCSIS 3.0"
4144
},
4245

4346
"snr": {
47+
"_comment": "Values as absolute dB (Fritz!Box shows MSE as negative, DOCSight uses abs())",
4448
"256QAM": {
45-
"good_min": 33.1,
46-
"tolerated_min": 31.1,
47-
"monthly_min": 29.1,
48-
"immediate_min": 29.0
49+
"good_min": 33.0,
50+
"tolerated_min": 32.0,
51+
"monthly_min": 30.0,
52+
"immediate_min": 30.0
4953
},
5054
"64QAM": {
51-
"good_min": 27.1,
52-
"tolerated_min": 25.1,
53-
"monthly_min": 23.1,
54-
"immediate_min": 23.0
55+
"good_min": 27.0,
56+
"tolerated_min": 26.0,
57+
"monthly_min": 24.0,
58+
"immediate_min": 24.0
5559
},
5660
"1024QAM": {
57-
"good_min": 37.1,
58-
"tolerated_min": 35.1,
59-
"monthly_min": 33.1,
60-
"immediate_min": 33.0
61-
},
62-
"4096QAM": {
63-
"good_min": 45.1,
64-
"tolerated_min": 43.1,
65-
"monthly_min": 41.1,
66-
"immediate_min": 41.0
61+
"good_min": 39.0,
62+
"tolerated_min": 38.0,
63+
"monthly_min": 36.0,
64+
"immediate_min": 36.0
6765
},
6866
"_default": "256QAM"
6967
},

0 commit comments

Comments
 (0)