import urllib2
import socket
import time
import wpa_cli_mod

logger = logging.getLogger("hydrosys4." + __name__)

localwifisystem = networkdbmod.getAPSSID()
if localwifisystem == "":
    localwifisystem = "hydrosys4"
    print "error the name of AP not found, double check the hostapd configuration"
    logger.error(
        "error the name of AP not found, double check the hostapd configuration"
    )
LOCALPORT = 5020
PUBLICPORT = networkdbmod.getPORT()
WAITTOCONNECT = networkdbmod.getWAITTOCONNECT()
if WAITTOCONNECT == "":
    WAITTOCONNECT = 180  # should be 180 at least
    networkdbmod.changesavesetting(
        'APtime', WAITTOCONNECT)  # if field not present it will be added
IPADDRESS = networkdbmod.getIPaddress()
EXTERNALIPADDR = ""
DHCP_COUNTER = 0


def stopNTP():
    #sudo systemctl disable systemd-timesyncd.service
    #sudo service systemd-timesyncd stop
    logger.info("Stop NTP")
    print "Stop NTP (Network Time Protocol)"
示例#2
0
import shlex
import re
import urllib2
import socket
import time
import wpa_cli_mod

logger = logging.getLogger("hydrosys4."+__name__)

localwifisystem=networkdbmod.getAPSSID()
if localwifisystem=="":
	localwifisystem="hydrosys4"
	print "error the name of AP not found, double check the hostapd configuration"
	logger.error("error the name of AP not found, double check the hostapd configuration")
LOCALPORT=5020
PUBLICPORT=networkdbmod.getPORT()
WAITTOCONNECT=networkdbmod.getWAITTOCONNECT()
if WAITTOCONNECT=="":
	WAITTOCONNECT=180 # should be 180 at least
	networkdbmod.changesavesetting('APtime',WAITTOCONNECT) # if field not present it will be added
IPADDRESS =networkdbmod.getIPaddress()
EXTERNALIPADDR=""




	
def wifilist_ssid():
	# get all cells from the air
	ssids=[]
	network = wpa_cli_mod.get_networks("wlan0",2)