hspdev / huawei-e5180-api Goto Github PK
View Code? Open in Web Editor NEWLet's you interface with some of the functions on the Huawei E5180 Cube, through it's existing API.
License: MIT License
Let's you interface with some of the functions on the Huawei E5180 Cube, through it's existing API.
License: MIT License
Been looking at gaining access the some more operations, wanted to find out if you could share some of your documentation or point me in the right direction as i've been searching on the net with no luck. so far i only got to this site
Hey I don't have the same exact router I have a 4g 3 pro. However for me the api seems somewhat similar. The bars for me are as follows:
-H 'Connection: keep-alive' \
-H 'Accept: */*' \
-H 'DNT: 1' \
-H 'X-Requested-With: XMLHttpRequest' \
-H 'Update-Cookie: UpdateCookie' \
-H '_ResponseSource: Broswer' \
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36' \
-H 'Referer: http://192.168.8.1/html/content.html' \
-H 'Accept-Language: en-GB,en;q=0.9' \
-H 'Cookie: SessionID=blah' \
--compressed \
--insecure```
The response is:
```<?xml version="1.0" encoding="UTF-8"?>
<response>
<ConnectionStatus>901</ConnectionStatus>
<WifiConnectionStatus></WifiConnectionStatus>
<SignalStrength></SignalStrength>
<SignalIcon>2</SignalIcon>
<CurrentNetworkType>19</CurrentNetworkType>
<CurrentServiceDomain>3</CurrentServiceDomain>
<RoamingStatus>0</RoamingStatus>
<BatteryStatus></BatteryStatus>
<BatteryLevel></BatteryLevel>
<BatteryPercent></BatteryPercent>
<simlockStatus>0</simlockStatus>
<PrimaryDns>217.171.132.0</PrimaryDns>
<SecondaryDns>217.171.135.0</SecondaryDns>
<PrimaryIPv6Dns></PrimaryIPv6Dns>
<SecondaryIPv6Dns></SecondaryIPv6Dns>
<CurrentWifiUser>1</CurrentWifiUser>
<TotalWifiUser>64</TotalWifiUser>
<currenttotalwifiuser>64</currenttotalwifiuser>
<ServiceStatus>2</ServiceStatus>
<SimStatus>1</SimStatus>
<WifiStatus>1</WifiStatus>
<CurrentNetworkTypeEx>1011</CurrentNetworkTypeEx>
<maxsignal>5</maxsignal>
<wifiindooronly>0</wifiindooronly>
<wififrequence>1</wififrequence>
<classify>cpe</classify>
<flymode>0</flymode>
<cellroam>1</cellroam>
<usbup>0</usbup>
<wifiswitchstatus>1</wifiswitchstatus>
<hvdcp_online>0</hvdcp_online>
</response>
The bars are from 0 to and it's under SignalIcon
Hope this helps!
is there a way to grab the outbox message index after an sms is sent?
also, if i want to grab the outbox items, is the boxtype simply 2?
private $sessionInfo = '';
private $tokenInfo = '';
I think this variables is not used, because it only use in "prepare" function in Router.php. There are no assigment value to that variables later.
You talk about an API to query for send status. Could you developp plz ?
Hi,
I've multiple USB modems, why the IP is the same for all the dongle?
Thank
Hello,
please update docs (add setDataSwitch()) and upload current version to packagist.
In the currenct composer version the setDataSwitch() method is missing.
Thank you very much!
Hi, I'm trying to recreate your script with bash but I got stuck at the login part, I keep getting:
<?xml version="1.0" encoding="UTF-8"?>
<error>
<code>100006</code>
<message></message>
</error>
Based on the error code, it's ERROR_PARAMETER_ERROR = 100006
Here's my script:
#!/bin/bash
username="admin"
password="admin"
E5577_auth() {
curl -sc '/tmp/E5577' 'http://192.168.8.1/html/home.html' > /dev/null
cookie=$(curl -sb /tmp/E5577 http://192.168.8.1/api/webserver/SesTokInfo | awk -F "[><]" '/SesInfo/ {print $3}')
token=$(curl -sb /tmp/E5577 http://192.168.8.1/api/webserver/SesTokInfo | awk -F "[><]" '/TokInfo/ {print $3}')
echo "Cookie: $cookie"
echo "Token: $token"
if [[ -z "$cookie" ]] || [[ -z "$token" ]]; then
echo "Authentication failed."
fi
}
login() {
E5577_auth
password=$(echo -n "$password" | sha256sum | cut -d ' ' -f 1 | sed ':a;N;$!ba;s/\n//g') # 1. Original password is hashed first
password=$(echo -n "$password" | base64 | sed ':a;N;$!ba;s/\n//g') # 2. Then the hashed password is encoded with base64
password=$(echo -n "$username$password$token" | sed ':a;N;$!ba;s/\n//g') # 3. Append both username & token
password=$(echo -n "$password" | sha256sum | cut -d ' ' -f 1 | sed ':a;N;$!ba;s/\n//g') # 4. hash again
password=$(echo -n "$password" | base64 | sed ':a;N;$!ba;s/\n//g') # 5. encode again
echo "Password: $password"
data="<?xml version=\"1.0\" encoding=\"UTF-8\"?><request><Username>$username</Username><password_type>4</password_type><Password>$password</Password></request>"
curl -s 'http://192.168.8.1/api/user/login' -H "Cookie: $cookie" -H "__RequestVerificationToken: $token" --data "$data"
}
login
Can you help me fix it ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.