Comments (6)
Hi!
You have too many bt-devices in the table? You mean it is hard to find desired device?
from huami-token.
No, I only have one device. What I am trying to say is that the script did not work out of the box for me, but only when modifying it to set my real BT address as device_id
from huami-token.
That's weird. Can you post the whole output of the script?
from huami-token.
Oh, interesting, now it works 😲 !
I do have some unrelated errors after my auth key
Downloading AGPS_ALM...
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/urllib3/connection.py", line 159, in _new_conn
conn = connection.create_connection(
File "/usr/lib/python3.8/site-packages/urllib3/util/connection.py", line 61, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "/usr/lib/python3.8/socket.py", line 918, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -5] No address associated with hostname
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/urllib3/connectionpool.py", line 670, in urlopen
httplib_response = self._make_request(
File "/usr/lib/python3.8/site-packages/urllib3/connectionpool.py", line 381, in _make_request
self._validate_conn(conn)
File "/usr/lib/python3.8/site-packages/urllib3/connectionpool.py", line 978, in _validate_conn
conn.connect()
File "/usr/lib/python3.8/site-packages/urllib3/connection.py", line 309, in connect
conn = self._new_conn()
File "/usr/lib/python3.8/site-packages/urllib3/connection.py", line 171, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7fe414460df0>: Failed to establish a new connection: [Errno -5] No address associated with hostname
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "/usr/lib/python3.8/site-packages/urllib3/connectionpool.py", line 726, in urlopen
retries = retries.increment(
File "/usr/lib/python3.8/site-packages/urllib3/util/retry.py", line 439, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='s3.us-west-2.amazonaws.com', port=443): Max retries exceeded with url: /huami-public-us2/AGPS_FILES/2020-10-18/1603032007862cep_alm_pak.zip (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fe414460df0>: Failed to establish a new connection: [Errno -5] No address associated with hostname'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "huami_token.py", line 229, in <module>
device.get_gps_data()
File "huami_token.py", line 175, in get_gps_data
with requests.get(agps_result['fileUrl'], stream=True) as r:
File "/usr/lib/python3.8/site-packages/requests/api.py", line 76, in get
return request('get', url, params=params, **kwargs)
File "/usr/lib/python3.8/site-packages/requests/api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/lib/python3.8/site-packages/requests/sessions.py", line 530, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python3.8/site-packages/requests/sessions.py", line 643, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python3.8/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='s3.us-west-2.amazonaws.com', port=443): Max retries exceeded with url: /huami-public-us2/AGPS_FILES/2020-10-18/1603032007862cep_alm_pak.zip (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fe414460df0>: Failed to establish a new connection: [Errno -5] No address associated with hostname'))
I think you can close this ticket, if somebody observes this situation I was in maybe he or she can make the same modifications as me:
--- a/huami_token.py
+++ b/huami_token.py
@@ -32,10 +32,10 @@ class HuamiAmazfit:
self.r = str(uuid.uuid4())
# IMEI or something unique
- self.device_id = "02:00:00:%02x:%02x:%02x" % (random.randint(0, 255),
- random.randint(0, 255),
- random.randint(0, 255))
-
+ # self.device_id = "02:00:00:%02x:%02x:%02x" % (random.randint(0, 255),
+ # random.randint(0, 255),
+ # random.randint(0, 255))
+ self.device_id = "TH:ER:EA:AL:BT:ID"
def get_access_token(self):
print(f"Getting access token with {self.method} login method...")
from huami-token.
To summarize: if device_id
is random, no keys are returned, but if you set device_id
to your phone mac address, key is returned?
from huami-token.
yes, but not phone mac, but watch Bluetooth address
And I was not able to reproduce. so it may have been some other glitch..
from huami-token.
Related Issues (20)
- ModuleNotFound HOT 8
- 我已经注册了小米的账号 还是一直报这个问题
- Questions about Xiaomi Wear liteApp HOT 3
- no mac or auth_key analyzed HOT 4
- please,help me fix it!!!! HOT 3
- 404 Error after logged by XIaomi Account HOT 6
- Unable to start getting AuthKey using Xiaomi account HOT 1
- method amazfit - ValueError: Wrong E-mail or Password.Error: ['401'] HOT 3
- huami-token
- Please add support for mi wear lite (now known as Mi fitness)
- Pls add support for mi wear lite(now known as mi fitness)
- Error when bind Mi account HOT 4
- 最后一步获取认证key为0x00 HOT 1
- Error 401 when correct details are inputted (Amazfit Method)
- ValueError: Login error. Error: 0125
- No linked wearables HOT 4
- ValueError: Login error. Error: 0121 HOT 1
- Mi band 5
- Xiaomi Mi Band 7 Pro
- Same
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from huami-token.