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

I can't find pid #2

Open
noelesther opened this issue Nov 22, 2019 · 3 comments
Open

I can't find pid #2

noelesther opened this issue Nov 22, 2019 · 3 comments

Comments

@noelesther
Copy link

hello.

I tried to find pid 1-1000 manually.

but, I can't find it.

I entered this code. 1 to 1000

python3 demo.py connect B8:7C:6F:35:98:39 1

I got these messages.

DEBUG:mikettle.mikettle:Init Mikettle with mac B8:7C:6F:35:98:39 and pid 1
Authenticating
Getting data from mi Kettle
Traceback (most recent call last):
File "demo.py", line 78, in
main()
File "demo.py", line 74, in main
args.func(args)
File "demo.py", line 46, in connect
print("FW: {}".format(kettle.firmware_version()))
File "/home/pi/mi/mikettle/mikettle.py", line 98, in firmware_version
self.auth()
File "/home/pi/mi/mikettle/mikettle.py", line 177, in auth
auth_service = self._p.getServiceByUUID(_UUID_SERVICE_KETTLE)
File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 488, in getServiceByUUID
rsp = self._getResp('find')
File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 407, in _getResp
resp = self._waitResp(wantType + ['ntfy', 'ind'], timeout)
File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 368, in _waitResp
raise BTLEGattError("Bluetooth command failed", resp)
bluepy.btle.BTLEGattError: Bluetooth command failed (code: 14, error: Request attribute has encountered an unlikely error)

DEBUG:mikettle.mikettle:Init Mikettle with mac B8:7C:6F:35:98:39 and pid 3
Authenticating
Getting data from mi Kettle
Traceback (most recent call last):
File "demo.py", line 78, in
main()
File "demo.py", line 74, in main
args.func(args)
File "demo.py", line 46, in connect
print("FW: {}".format(kettle.firmware_version()))
File "/home/pi/mi/mikettle/mikettle.py", line 98, in firmware_version
self.auth()
File "/home/pi/mi/mikettle/mikettle.py", line 177, in auth
auth_service = self._p.getServiceByUUID(_UUID_SERVICE_KETTLE)
File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 488, in getServiceByUUID
rsp = self._getResp('find')
File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 407, in _getResp
resp = self._waitResp(wantType + ['ntfy', 'ind'], timeout)
File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 362, in _waitResp
raise BTLEDisconnectError("Device disconnected", resp)
bluepy.btle.BTLEDisconnectError: Device disconnected

DEBUG:mikettle.mikettle:Init Mikettle with mac B8:7C:6F:35:98:39 and pid 9
Authenticating
Getting data from mi Kettle
Traceback (most recent call last):
File "demo.py", line 78, in
main()
File "demo.py", line 74, in main
args.func(args)
File "demo.py", line 46, in connect
print("FW: {}".format(kettle.firmware_version()))
File "/home/pi/mi/mikettle/mikettle.py", line 97, in firmware_version
self.connect()
File "/home/pi/mi/mikettle/mikettle.py", line 81, in connect
self._p = Peripheral(self._mac)
File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 391, in init
self._connect(deviceAddr, addrType, iface)
File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 439, in _connect
raise BTLEDisconnectError("Failed to connect to peripheral %s, addr type: %s" % (addr, addrType), rsp)
bluepy.btle.BTLEDisconnectError: Failed to connect to peripheral B8:7C:6F:35:98:39, addr type: public

DEBUG:mikettle.mikettle:Init Mikettle with mac B8:7C:6F:35:98:39 and pid 11
Authenticating
Getting data from mi Kettle
Traceback (most recent call last):
File "demo.py", line 78, in
main()
File "demo.py", line 74, in main
args.func(args)
File "demo.py", line 46, in connect
print("FW: {}".format(kettle.firmware_version()))
File "/home/pi/mi/mikettle/mikettle.py", line 98, in firmware_version
self.auth()
File "/home/pi/mi/mikettle/mikettle.py", line 177, in auth
auth_service = self._p.getServiceByUUID(_UUID_SERVICE_KETTLE)
File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 488, in getServiceByUUID
rsp = self._getResp('find')
File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 407, in _getResp
resp = self._waitResp(wantType + ['ntfy', 'ind'], timeout)
File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 361, in _waitResp
self._stopHelper()
File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 293, in _stopHelper
self._helper.stdin.flush()
BrokenPipeError: [Errno 32] Broken pipe
Exception ignored in: <function Peripheral.del at 0x764fc978>
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 630, in del
File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 453, in disconnect
File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 305, in _writeCmd
BrokenPipeError: [Errno 32] Broken pipe

and sometimes stuck like this.

DEBUG:mikettle.mikettle:Init Mikettle with mac B8:7C:6F:35:98:39 and pid 7
Authenticating
Getting data from mi Kettle

so when I forced stop, I got this log

^CTraceback (most recent call last):
File "demo.py", line 78, in
main()
File "demo.py", line 74, in main
args.func(args)
File "demo.py", line 46, in connect
print("FW: {}".format(kettle.firmware_version()))
File "/home/pi/mi/mikettle/mikettle.py", line 98, in firmware_version
self.auth()
File "/home/pi/mi/mikettle/mikettle.py", line 177, in auth
auth_service = self._p.getServiceByUUID(_UUID_SERVICE_KETTLE)
File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 488, in getServiceByUUID
rsp = self._getResp('find')
File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 407, in _getResp
resp = self._waitResp(wantType + ['ntfy', 'ind'], timeout)
File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 347, in _waitResp
rv = self._helper.stdout.readline()
KeyboardInterrupt

got error log randomly.

It means same number but try again got another log.

Can you check what I wrong? thanks.

@drndos
Copy link
Owner

drndos commented Dec 8, 2019

Don't know, sorry man, I don't have chinese kettle to test it properly.

@noelesther
Copy link
Author

Don't know, sorry man, I don't have chinese kettle to test it properly.

I want to know these logs same as when you entered wrong pid number.

@SOLOKE
Copy link

SOLOKE commented Oct 14, 2020

my logs show similar issues. Don't think it's related to the pid though. Maybe something with my bluepy installation?
any thoughts?


Here the log with what I assume is the correct pid

DEBUG:mikettle.mikettle:Init Mikettle with mac B8:7C:6F:81:65:1D and pid 275
Authenticating
Getting data from mi Kettle
FW: 7.5.10
Traceback (most recent call last):
File "demo.py", line 78, in
main()
File "demo.py", line 74, in main
args.func(args)
File "demo.py", line 47, in connect
print("Name: {}".format(kettle.name()))
File "/home/Kevin/mikettle/mikettle.py", line 87, in name
self.connect()
File "/home/Kevin/mikettle/mikettle.py", line 82, in connect
self._p = Peripheral(deviceAddr=self._mac, iface=self._iface)
File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 391, in init
self._connect(deviceAddr, addrType, iface)
File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 439, in _connect
raise BTLEDisconnectError("Failed to connect to peripheral %s, addr type: %s" % (addr, addrType), rsp)
bluepy.btle.BTLEDisconnectError: Failed to connect to peripheral B8:7C:6F:81:65:1D, addr type: public


and here the one with the incorrect PID. clearly showing an authentication error. so I guess the PID is correct...


DEBUG:mikettle.mikettle:Init Mikettle with mac B8:7C:6F:81:65:1D and pid 131
Authenticating
Getting data from mi Kettle
Traceback (most recent call last):
File "demo.py", line 78, in
main()
File "demo.py", line 74, in main
args.func(args)
File "demo.py", line 46, in connect
print("FW: {}".format(kettle.firmware_version()))
File "/home/Kevin/mikettle/mikettle.py", line 99, in firmware_version
self.auth()
File "/home/Kevin/mikettle/mikettle.py", line 189, in auth
self._p.waitForNotifications(10.0)
File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 560, in waitForNotifications
resp = self._getResp(['ntfy','ind'], timeout)
File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 416, in _getResp
self.delegate.handleNotification(hnd, data)
File "/home/Kevin/mikettle/mikettle.py", line 264, in handleNotification
raise Exception("Authentication failed.")
Exception: Authentication failed.

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

3 participants