Hotspot IP-Belegung am Mobilphone prüfen

  • Belegte IPs am Hotspot herausfinden mit einer HTML-Seite

    Wenn auf ein Handy-Hotspot mehrere Tasmota-Geräte innerhalb weniger Tage zugreifen dürfen, werden verschiedene IPs belegt.

    Achtung! Quelltextlinks werden durch das Forum-System geändert (Teilübernahme aus dem Bild erforderlich)

    <!DOCTYPE html>
    <html lang="de">
    <head>
    <meta charset="UTF-8">
    <title>IP-Scan in meinem Netz</title>

    <style>
    body { font-family: Arial, sans-serif; padding: 20px; }
    .ip { margin-bottom: 6px; }
    .active { color: green; }
    .inactive { color: red; }
    a { margin-left: 10px; font-size: 0.9em; }
    </style>
    </head>
    <body>
    <h2> Netz 172.20.10.1–10</h2>
    <div id="results"></div>

    <script>

    // const baseIP = '192.168.178.';
    const baseIP = '172.20.10.';


    const resultsDiv = document.getElementById('results');
    const delay = 150; // ms zwischen Checks, um Überlastung zu vermeiden

    function checkIP(ip) {
    const iframe = document.createElement('iframe');
    iframe.style.display = 'none';
    iframe.src = `https://forum.creationx.de/?%24%7BDate.now()}`;

    const result = document.createElement('div');
    result.className = 'ip';
    result.textContent = `Prüfe ${ip} ...`;
    resultsDiv.appendChild(result);

    const timeout = setTimeout(() => {
    result.textContent = `${ip} ist inaktiv (keine Web-System erreichbar)`;
    result.classList.add('inactive');
    iframe.remove();
    }, 3000);

    iframe.onload = () => {
    clearTimeout(timeout);
    result.textContent = `${ip} ist aktiv `;
    result.classList.add('active');

    const link = document.createElement('a');
    link.href = `https://forum.creationx.de/?`;
    link.target = '_blank';
    link.textContent = 'Seite öffnen';
    result.appendChild(link);

    iframe.remove();
    };

    document.body.appendChild(iframe);
    }

    // Schleife mit Verzögerung (damit der Browser nicht einfriert)
    let i = 1;
    function runNext() {
    if (i >= 11) return; // nur 10 (IOS-Hotspot) oder 255
    const ip = baseIP + i;
    checkIP(ip);
    i++;
    setTimeout(runNext, delay);
    }

    runNext(); // Start
    </script>
    </body>
    </html>


    Ersetzen von

    iframe.src = `https://forum.creationx.de/?%24%7BDate.now()}`;

    link.href = `https://forum.creationx.de/?`;

    auf

Teilen