Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connecting Error #50

Open
vkudak opened this issue Apr 5, 2023 · 0 comments
Open

Connecting Error #50

vkudak opened this issue Apr 5, 2023 · 0 comments

Comments

@vkudak
Copy link

vkudak commented Apr 5, 2023

Python 3.10
Kernel 5.15.0-69-generic

Cannot init device or do something else

python example.py --mac E7:39:2F:DB:D9:E1 --init
2023-04-05 14:49:49,299 MiBand2 (INFO) > Connecting to E7:39:2F:DB:D9:E1
2023-04-05 14:49:50,739 MiBand2 (INFO) > Connected
2023-04-05 14:50:02,146 MiBand2 (INFO) > Enabling Auth Service notifications status...
2023-04-05 14:50:02,388 MiBand2 (INFO) > Sending Key...
2023-04-05 14:50:03,788 MiBand2 (INFO) > Requesting random number...
2023-04-05 14:50:03,938 MiBand2 (INFO) > Sending encrypted random number
Traceback (most recent call last):
File "/home/vkudak/software/MiBand2/MiBand2-master/example.py", line 23, in
if band.initialize():
File "/home/vkudak/software/MiBand2/MiBand2-master/base.py", line 308, in initialize
self.waitForNotifications(0.1)
File "/usr/local/lib/python3.10/dist-packages/bluepy/btle.py", line 560, in waitForNotifications
resp = self._getResp(['ntfy','ind'], timeout)
File "/usr/local/lib/python3.10/dist-packages/bluepy/btle.py", line 416, in _getResp
self.delegate.handleNotification(hnd, data)
File "/home/vkudak/software/MiBand2/MiBand2-master/base.py", line 28, in handleNotification
self.device._req_rdn()
File "/home/vkudak/software/MiBand2/MiBand2-master/base.py", line 208, in _req_rdn
self.waitForNotifications(self.timeout)
File "/usr/local/lib/python3.10/dist-packages/bluepy/btle.py", line 560, in waitForNotifications
resp = self._getResp(['ntfy','ind'], timeout)
File "/usr/local/lib/python3.10/dist-packages/bluepy/btle.py", line 416, in _getResp
self.delegate.handleNotification(hnd, data)
File "/home/vkudak/software/MiBand2/MiBand2-master/base.py", line 34, in handleNotification
self.device._send_enc_rdn(random_nr)
File "/home/vkudak/software/MiBand2/MiBand2-master/base.py", line 212, in _send_enc_rdn
cmd = self._send_enc_key + self._encrypt(data)
File "/home/vkudak/software/MiBand2/MiBand2-master/base.py", line 197, in _encrypt
aes = AES.new(self._KEY, AES.MODE_ECB)
File "/usr/local/lib/python3.10/dist-packages/Crypto/Cipher/AES.py", line 95, in new
return AESCipher(key, *args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/Crypto/Cipher/AES.py", line 59, in init
blockalgo.BlockAlgo.init(self, _AES, key, *args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/Crypto/Cipher/blockalgo.py", line 141, in init
self._cipher = factory.new(key, *args, **kwargs)
SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant