TheBazeman / A-OK-AM43-Blinds-Drive

Python A-OK AM43 Blinds Drive BTLE control
29 stars 13 forks source link

Error checkStatus #10

Open djdevil opened 3 years ago

djdevil commented 3 years ago

Hi, up to now the script has always worked correctly, until I decided to update my rasperry and since then the status check does not work anymore and I get this error

Oct 28 17:34:13 raspberrypi python3[2242]: File "/home/pi/A-OK_AM43_Blind_Drive/AOK-AM43.py", line 103, in write_message Oct 28 17:34:13 raspberrypi python3[2242]: if (dev.waitForNotifications(10): Oct 28 17:34:13 raspberrypi python3[2242]: File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 560, in waitForNotifications Oct 28 17:34:13 raspberrypi python3[2242]: resp = self._getResp(['ntfy','ind'], timeout) Oct 28 17:34:13 raspberrypi python3[2242]: File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 407, in _getResp Oct 28 17:34:13 raspberrypi python3[2242]: resp = self._waitResp(wantType + ['ntfy', 'ind'], timeout) Oct 28 17:34:13 raspberrypi python3[2242]: File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 362, in _waitResp Oct 28 17:34:13 raspberrypi python3[2242]: raise BTLEDisconnectError("Device disconnected", resp) Oct 28 17:34:13 raspberrypi python3[2242]: bluepy.btle.BTLEDisconnectError: Device disconnected Oct 28 17:34:13 raspberrypi python3[2242]: 192.168.1.5 - - [28/Oct/2020 17:34:13] "GET /AM43BlindsAction/CheckStatus HTTP/1.1" 500 -

It looks like an error generated by bluepy maybe it has updated to the latest version? Strange why the other open and close functions all work perfectly thanks for the help in advance

djdevil commented 3 years ago

Server Status

28-10-2020 18:08:35 Connecting to 02:6B:C4:16:F4:8E, Tenda bagno... 28-10-2020 18:08:36 --> Connected to 02:6B:C4:16:F4:8E, Tenda bagno [2020-10-28 18:08:37,149] ERROR in app: Exception on /AM43BlindsAction/CheckStatus [GET] Traceback (most recent call last): File "/usr/lib/python3/dist-packages/flask/app.py", line 2292, in wsgi_app response = self.full_dispatch_request() File "/usr/lib/python3/dist-packages/flask/app.py", line 1815, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/lib/python3/dist-packages/flask/app.py", line 1718, in handle_user_exception reraise(exc_type, exc_value, tb) File "/usr/lib/python3/dist-packages/flask/_compat.py", line 35, in reraise raise value File "/usr/lib/python3/dist-packages/flask/app.py", line 1813, in full_dispatch_request rv = self.dispatch_request() File "/usr/lib/python3/dist-packages/flask/app.py", line 1799, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "AOK-AM43_.py", line 212, in AM43BlindsAction bSuccess = write_message(BlindsControlServiceCharacteristic, dev, IdPosition, [0x01], True) File "AOK-AM43_.py", line 101, in write_message if (dev.waitForNotifications(10)): 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 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

djdevil commented 3 years ago

i understand that the problem disappears when i finish the node-red server i don't understand why it conflicts