Xiaomi_BLE_Temperature_Display_for_HA icon indicating copy to clipboard operation
Xiaomi_BLE_Temperature_Display_for_HA copied to clipboard

UnboundLocalError: local variable 'bluepypid' referenced before assignment

Open db0nd opened this issue 4 years ago • 0 comments

Hi! I have found a problem while using your script. When the watchdog was triggered, I got the error:

Aug 2 03:01:34 artemis LYWSD03MMC.py[7096]: /bin/sh: 1: pstree: not found Aug 2 03:01:34 artemis LYWSD03MMC.py[7096]: Exception in thread Thread-1: Aug 2 03:01:34 artemis LYWSD03MMC.py[7096]: Traceback (most recent call last): Aug 2 03:01:34 artemis LYWSD03MMC.py[7096]: File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner Aug 2 03:01:34 artemis LYWSD03MMC.py[7096]: self.run() Aug 2 03:01:34 artemis LYWSD03MMC.py[7096]: File "/usr/lib/python3.7/threading.py", line 865, in run Aug 2 03:01:34 artemis LYWSD03MMC.py[7096]: self._target(*self._args, **self._kwargs) Aug 2 03:01:34 artemis LYWSD03MMC.py[7096]: File "/opt/LYWSD03MMC/LYWSD03MMC.py", line 66, in watchDog_Thread Aug 2 03:01:34 artemis LYWSD03MMC.py[7096]: os.system("kill " + bluepypid) Aug 2 03:01:34 artemis LYWSD03MMC.py[7096]: UnboundLocalError: local variable 'bluepypid' referenced before assignment

The problem was solved quite simply - I did not have the pstree utility from the "psmisc" package, to make life easier for beginners, add the line $ sudo apt-get install psmiscpsmisc to the statement.

db0nd avatar Aug 02 '20 09:08 db0nd