Skip to content
Snippets Groups Projects
Commit b70a69c3 authored by David Mondou's avatar David Mondou
Browse files

ES-324 Create custom ssid for Wireless Access Point

parent bfc729e1
No related branches found
No related tags found
1 merge request!6ES-324 Create custom ssid for Wireless Access Point
......@@ -177,7 +177,7 @@ def changeName(newName):
if WSREGEX.search(newName):
print "New name contains whitespaces. Ignoring"
return
_changeHostName(newName)
#_changeHostName(newName)
#_changeP2PSSID(newName)
_changeAPSSID(newName)
......@@ -188,9 +188,10 @@ def _changeHostName(newName):
subprocess.call("hostname -F /etc/hostname", shell=True)
def _changeAPSSID(newName):
saveDefaultSSID()
#saveDefaultSSID()
subprocess.call(["sed", "-i", "s/^ssid=.*/ssid=" + re.escape(newName) + "/", "/etc/hostapd.conf"])
subprocess.call("/etc/init.d/avahi-daemon restart && sleep 2", shell=True)
#subprocess.call("/etc/init.d/avahi-daemon restart && sleep 2", shell=True)
def _changeP2PSSID(newName):
subprocess.call(["sed", "-i", "s/^p2p_ssid_postfix=.*/p2p_ssid_postfix=" + re.escape(newName) + "/", "/etc/wpa_supplicant/p2p_supplicant.conf"])
......@@ -647,6 +648,11 @@ def getDefaultSSID():
def enableOneTimeSetup(persist):
subprocess.call("/usr/rigado/scripts/led_control.sh green flash", shell=True)
#create unique ssid for Wireless Access Point
unit_number=subprocess.check_output(["unit_serial_number"]).rstrip()
ssid_AP="IoT-Gateway-Setup"+unit_number[-6:]
_changeAPSSID(ssid_AP)
hostname = subprocess.check_output('hostname').strip()
print "Scanning and saving WiFi networks..."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment