From 00700c4fbd9e7a55e85a1eaa01cd9639c4a18b58 Mon Sep 17 00:00:00 2001 From: Matthias Prinke <83612361+matthias-bs@users.noreply.github.com> Date: Thu, 6 Jun 2024 20:20:28 +0200 Subject: [PATCH] Added maximum payload size input, info and modified check for size limit (#54) --- extras/confighelper/confighelper.html | 31 +++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/extras/confighelper/confighelper.html b/extras/confighelper/confighelper.html index 2e4f7f9..9148082 100644 --- a/extras/confighelper/confighelper.html +++ b/extras/confighelper/confighelper.html @@ -1,5 +1,6 @@ @@ -200,6 +203,9 @@ document.getElementById('bleInput').style.display = this.checked ? 'inline' : 'none'; }); + // Initialize the maximum size field + document.getElementById('maxSize').value = PAYLOAD_SIZE_LIMIT; + // Initialize the size field document.getElementById('size').value = 0; @@ -429,11 +435,16 @@ } } - // Check if size exceeds PAYLOAD_SIZE_LIMIT - if (totalSize > PAYLOAD_SIZE_LIMIT) { - document.getElementById('size').style.border = '3px solid red'; + // Get the maximum size + let maxSize = document.getElementById('maxSize').value; + + // Check if size exceeds maxSize + if (totalSize > maxSize) { + //document.getElementById('size').style.border = '3px solid red'; + document.getElementById('size').style.boxShadow = '0 0 3px #CC0000'; } else { - document.getElementById('size').style.border = 'none'; + //document.getElementById('size').style.border = '1px solid black'; + document.getElementById('size').style.boxShadow = ''; } // Update the size field document.getElementById('size').value = totalSize; @@ -547,6 +558,18 @@

Welcome to Config Helper



+

+ +
+ The maximum payload size is essentialy limited by the maximum permitted air time, which is mandated by
+ the LoRaWAN Regional Parameters and potentially a LoRaWAN Network Service Provider's fair use + policy.

+ See Airtime calculator for + LoRaWAN. +

+
+

+