def run_raspberry_bridge(self):
# self.pi.set_mode(11, pigpio.INPUT)
# cb1 = self.pi.callback(11, pigpio.EITHER_EDGE, self.cbf)
while True:
if self.last_problem:
self.report_problem()
# noinspection PyBroadException
try:
z = self.subscriber.recv_multipart(zmq.NOBLOCK)
self.payload = umsgpack.unpackb(z[1])
command = self.payload['command']
if command in self.command_dict:
self.command_dict[command]()
else:
print("can't execute unknown command'")
# time.sleep(.001)
except KeyboardInterrupt:
self.cleanup()
sys.exit(0)
except zmq.error.Again:
time.sleep(.001)
评论列表
文章目录