Open modular1 opened 3 years ago
Is this the complete log? I mean: I would've expect to see at least a number of scans for BLE devices and the BS440 not to show up before stepping on the scale. The error shows a timeout after the scale has been connected to and the program registers to the notifications which should arrive. Therefore i would expect to see more logging before the exception. Are you sure you got the right MAC address of the scale (so you're not trying to connect to some other device). Is it a BS440 you're trying? Did you stick with the (meanwhile quite old) version of PyGatt? I know there have been some fixes to that lately, maybe they broke something. BTW i'm thinking of moving to the better supported bleak library if time permits.
First of all thank you for the reply! I think pygatt was the problem after all.... Now it seems to work. But my quest continues :-) the data does not pop-up in the broker yet, on the the intialised message(suspect i did wrong in the config ;-) ):
2021-02-25 11:03:42,979 INFO
2021-02-25 11:04:10,058 INFO processIndication {'gender': 'male', 'age': 37, 'person': 1, 'valid': True, 'activity': 'normal', 'size': 180}
2021-02-25 11:04:10,073 INFO
I never used the MQTT plugin myself. But you should at least see the plugin starting when proper data is received as per line 316 "if persondata and weightdata and bodydata:" (BS440.py) Maybe throw in some debugging loggings...
@modular1, in case this is still relevant: i got MQTT working like a charm. Let me know if I can help.
Hi,
i keep on getting the following error and bit lost on it. I keep getting the same with and without plugins:
sudo python BS440.py 2021-02-24 18:40:09,413 INFO No plugins configured.
2021-02-24 18:40:09,418 INFO BS440 Started
2021-02-24 18:40:09,534 INFO init_ble_mode hci0 Set Low Energy complete, settings: powered bondable ssp br/edr le secure-conn
Traceback (most recent call last): File "BS440.py", line 286, in
indication=True)
File "/usr/local/lib/python2.7/dist-packages/pygatt/device.py", line 222, in subscribe
wait_for_response=wait_for_response
File "/usr/local/lib/python2.7/dist-packages/pygatt/backends/gatttool/device.py", line 17, in wrapper
return func(self, *args, kwargs)
File "/usr/local/lib/python2.7/dist-packages/pygatt/backends/gatttool/device.py", line 48, in char_write_handle
self._backend.char_write_handle(self, handle, *args, *kwargs)
File "/usr/local/lib/python2.7/dist-packages/pygatt/backends/gatttool/gatttool.py", line 50, in wrapper
return func(self, args, kwargs)
File "/usr/local/lib/python2.7/dist-packages/pygatt/backends/gatttool/gatttool.py", line 574, in char_write_handle
self.sendline(cmd)
File "/usr/lib/python2.7/contextlib.py", line 24, in exit
self.gen.next()
File "/usr/local/lib/python2.7/dist-packages/pygatt/backends/gatttool/gatttool.py", line 191, in event
self.wait(event, timeout)
File "/usr/local/lib/python2.7/dist-packages/pygatt/backends/gatttool/gatttool.py", line 157, in wait
raise NotificationTimeout()
pygatt.exceptions.NotificationTimeout: None
Any idea perhaps what it could be or point me in the right direction?