Until recently my pantilthat work flawlessly in combination with motioneye. Yesterday I noticed that the buttons one can use in motioneye to control the pantilthat, didn’t anymore, or at least not very responsive.
Somehow the scripts an python programs controlling the pantilthat won’t work propperly any more.
I stripped down the program for tilting the hat up to it’s bare minimum:
pi@PanTiltHAT:~ $ cat up.py
import pantilthat
#file = open("/home/pi/tiltangle.txt","r")
#a = int(file.readline())
#file.close()
#if a > -90 :
# a = a - 10
#print(a)
#file = open("/home/pi/tiltangle.txt","w")
#file.write(str(a))
#pantilthat.tilt(a)
pantilthat.tilt(0)
When I run this program I sometimes get exceptions:
pi@PanTiltHAT:~ $ python up.py
Exception in thread Thread-1 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
File "/usr/lib/python2.7/threading.py", line 1080, in run
File "/usr/lib/python2.7/threading.py", line 621, in wait
File "/usr/lib/python2.7/threading.py", line 364, in wait
<type 'exceptions.ValueError'>: list.remove(x): x not in list
pi@PanTiltHAT:~ $ python up.py
pi@PanTiltHAT:~ $ python up.py
pi@PanTiltHAT:~ $ python up.py
Exception in thread Thread-1 (most likely raised during interpreter shutdown):
And sometimes not…
When I run python from the commandline and talk to the hat it works:
pi@PanTiltHAT:~ $ python
Python 2.7.9 (default, Sep 17 2016, 20:26:04)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pantilthat
>>> pantilthat.tilt(0)
Again, before these separate python programs worked okay. I did an apt-get update an upgrade recently, but that shouldn’t be an issue write?