Skip to content

Instantly share code, notes, and snippets.

Forked from lukpueh/
Last active November 8, 2022 23:26
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Script to help me position my `Alcatel Linkhub HH40v` LTE modem for the best signal strength
#!/usr/bin/env python
<Program Name>
Lukas Puehringer <>
James White <>
Script to help me position my `Alcatel Linkhub HH40v` LTE modem for the
best signal strength.
If a change in signal strength is detected, it uses the OS X command line
tool `say` to say the new signal strength.
1. Connect your computer to your Alcatel Linkhub's WiFi
2. Open a browser and go to the admin page at ``
3. Open your browser's developer tools, go to the `network` tab and look
for requests to ``
4. Take any request, copy the value of the header
`_TclRequestVerificationKey` and assign it to below variable
5. Turn up the volume of your computer and run the script
6. Walk your Alcatel Linkhub around your apartment (long extension cord is
helpful) and place it at where your computer tells you a high signal.
import time
import requests
import subprocess
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('requestKey', help='_TclRequestVerificationKey header')
parser.add_argument('routerIPAddress', help='The LAN IP of your router', nargs='?', default='')
parser.add_argument('jrdId', help='ID value used with JSON-RPC API calls', nargs='?', type=int, default=1)
args = parser.parse_args()
URL = 'http://' + args.routerIPAddress + '/jrd/webapi'
# JSON rpc request to get information such as signal strength
"id": str(args.jrdId),
"jsonrpc": "2.0",
"method": "GetSystemStatus",
"params": {}
# Headers required to authenticate with JSON rpc (assessed by trial and error)
"_TclRequestVerificationKey": args.requestKey,
"Referer": "http://" + args.routerIPAddress + "/index.html"
def main():
""" Run indefinitely to (at an interval of 1 second)
- print requested signal strength to command line, and
- if signal strength changes, `say` the new strength.
last = None
while True:
r =, json=JSON_REQUEST, headers=HEADERS)
strength = r.json().get("result", {}).get("SignalStrength")
print "Signal Strength:", strength
if strength != last:
process = subprocess.Popen(["say", 'Signal strength is now ' + str(strength)],
last = strength
if __name__ == "__main__":
Copy link

Genda1ph commented Feb 5, 2022

Thank you, I'm cannibalizing this to monitor my bandwidth usage 😄
Keywords: IK41 web api bandwidth traffic

jrdId is the id you see in response, so for my device I use GetUsageSettings, which contains UsedData and it has "id": "7.3".
I hope _TclRequestVerificationToken is constant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment