#!/usr/bin/python3 import time import json import paho.mqtt.client as mqtt circleOpacity=0.2 useLeafletLocal=1 MAPBOXTOKEN="pk.eyJ1IjoieWFuaWtjYXdpZHJvbmUiLCJhIjoiY2p4dmlheGtzMDN0dTNoa2R2b2sxZndkNSJ9.Tfd-xcohTT4x7nEe5_6Rxg" # Leaflet # https://unpkg.com/leaflet@1.7.1/dist/leaflet.js # https://unpkg.com/leaflet@1.7.1/dist/leaflet.css def networkSurveyColor(rssi): color="#888" if float(rssi) < -105: color="#f00" elif float(rssi) < -95: color="#ff6600" elif float(rssi) < -85: color="#ffa500" elif float(rssi) < -80: color="#ffab40" else: color="#15ab00" return color def networkSurveyAddLeaflet(): global useLeafletLocal leaflet="" leafletCssPath="leaflet.css" leafletJsPath="leaflet.js" if useLeafletLocal is 0: leafletCssPath="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css" leafletJsPath="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css" leaflet+=" \n" leaflet+=" \n" return leaflet def networkSurveySetMapboxApiToken(): global MAPBOXTOKEN return MAPBOXTOKEN def networkSurvey(filename, subId): global circleOpacity start_time = time.time() htmlOutput="\n" htmlOutput+="\n" htmlOutput+="
\n" htmlOutput+="Took: "+str(deltaTime)+" seconds
\n" if countRaw != 0: #print(lastLine) part=lastLine.split(',') lastOutput="\n" lastOutput+="