Skip to content

Instantly share code, notes, and snippets.



Created Nov 14, 2013
What would you like to do?
Python: Network Registration for ERGWAVE Wi-Fi
import urllib
import urllib2
import socket
import uuid
macaddr = ':'.join(['{:02x}'.format((uuid.getnode() >> i) & 0xff) for i in range(0,8*6,8)][::-1])
ipaddr = socket.gethostbyname(socket.getfqdn())
url = '{0}&ip={1}&essid=%20'.format(macaddr, ipaddr)
query_args = {'user':'YOUR_USER_NAME', 'password':'YOUR_PASSWORD', 'fqdn':'YOUR_DEPARTMENT'}
data = urllib.urlencode(query_args)
request = urllib2.Request(url, data)
response = urllib2.urlopen(request)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment