Skip to content

Instantly share code, notes, and snippets.

@dodysw
Created July 7, 2014 06:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dodysw/070a04fce79858a4a0e4 to your computer and use it in GitHub Desktop.
Save dodysw/070a04fce79858a4a0e4 to your computer and use it in GitHub Desktop.
Bolt! Super 4G LTE modem restart script. Why? 1) I'm not sure why this works. Unbased explanation: This modem type frequently stucked to a bad signal probably coming from a far BTS. Restarting forces it to reacquire 4G signals, hopefuly getting a closer BTS.
#!/usr/bin/env python
# Bolt! Super 4G LTE modem restart script.
# Why? 1) I'm not sure why this works. Unbased explanation: This modem type frequently stucked to a bad signal probably coming from a far BTS. Restarting forces it to reacquire 4G signals, hopefuly getting a closer BTS.
# Copyright 2014 Dody Suria Wijaya <dodysw@gmail.com>
import urllib, urllib2, base64
PASSWORD = 'admin'
MODEM_IP = '192.168.1.1'
dataLogin = dict(isTest='false', goformId='LOGIN', password=base64.b64encode(PASSWORD))
dataRestart = dict(isTest='false', goformId='REBOOT_DEVICE')
url = "http://%s/goform/goform_set_cmd_process" % MODEM_IP
headers = dict(Referer="http://%s/index.html" % MODEM_IP)
urllib2.urlopen(urllib2.Request(url, urllib.urlencode(dataLogin), headers)).read()
urllib2.urlopen(urllib2.Request(url, urllib.urlencode(dataRestart), headers)).read()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment