JamoDevNich / SuperHub3-CLI

A command-line interface for managing the VM SuperHub 3/ARRIS TG2492S/CE router. Allows listing current/past connected devices, toggle private/guest WLAN, rebooting and viewing router status
17 stars 2 forks source link

HTTP/1.1 Response Code 401 Received #1

Closed patkszen closed 6 years ago

patkszen commented 6 years ago

`Yarde Superhub Client API (Part of the Wifi Doorbell Transponder Project) by Nicholas Elliott Version 0.1.4

Searching for superhub (192.168.0.1)... Logging in... Validating login... --! HTTP/1.1 Response Code 401 Received Traceback (most recent call last): File "superhubclientsapi.py", line 232, in main(); File "superhubclientsapi.py", line 221, in main raise Exception("The login could not be validated. Retrying usually fixes this random error."); Exception: The login could not be validated. Retrying usually fixes this random error. `

JamoDevNich commented 6 years ago

Try setting up the authentication variables using the instructions here.

First, you'll need to navigate to http://192.168.0.1 and enter your login details, but don't login yet.

Image showing VM router login screen

Open your browser's development console to capture the GET request, after clicking the 'Next' button:

Image showing how to capture GET request

The keys from the GET request are then edited into the code of the SuperHub python file, there are three variables there, one for each respective key. You only need to do this capture procedure once; the python script will be able to log into your router automatically in future unless the router's password is changed.

I'll be looking further into the hub's interface code some more soon so I can get the superhub client to authenticate with passwords.

patkszen commented 6 years ago

Hi Jamo

I got that error after placing keys 1,2 and 3 into your code. I've only omitted = sign at the end of the first key - I've tried with it as well, sent result

JamoDevNich commented 6 years ago

Oh I see. The = sign at the end is a part of the key so that's necessary. Are there any space characters etc. present in the key variables? If you're still having problems then I'll look into getting passwords working on the utility.

patkszen commented 6 years ago

There were no spaces, I've just copy/pasted keys from the get request. I will double check once I'm back.

JamoDevNich commented 6 years ago

I've added the ability for the script to accept passwords in the version 0.1.5, let me know if that works for you.

https://github.com/JamoDevNich/ClientsAPI-SuperHub3/releases/tag/0.1.5