我正在尝试使用https://pypi.org/project/pypjlink2/查询一些正在工作的NEC投影机,有些模型可以工作,但是有些给出AssertionError。
我确保在投影机上没有配置密码,还尝试定义密码并将其放在放映机中。authenticate('mypassword')
ip = raw_input('ip address: ')
projector = Projector.from_address(ip)
projector.authenticate('')
projector.set_power('on')
errors = projector.get_errors()
print errors
nicky@debian:~$ python test2.py
ip address: 10.24.59.55
Traceback (most recent call last):
File "test2.py", line 7, in <module>
projector.set_power('on')
File "/usr/local/lib/python2.7/dist-packages/pypjlink/projector.py", line 150, in set_power
self.set('POWR', POWER_STATES[status])
File "/usr/local/lib/python2.7/dist-packages/pypjlink/projector.py", line 136, in set
success, response = protocol.send_command(self.f, body, param, self.encoding)
File "/usr/local/lib/python2.7/dist-packages/pypjlink/protocol.py", line 71, in send_command
resp_body, resp_param = parse_response(f, encoding)
File "/usr/local/lib/python2.7/dist-packages/pypjlink/protocol.py", line 30, in parse_response
assert header == '%'
AssertionError
nicky@debian:~$ pjlink -p 10.24.59.55 info
Traceback (most recent call last):
File "/usr/local/bin/pjlink", line 10, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/pypjlink/cli.py", line 176, in main
func(proj, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/pypjlink/cli.py", line 68, in cmd_info
('Name', p.get_name()),
File "/usr/local/lib/python2.7/dist-packages/pypjlink/projector.py", line 227, in get_name
param = self.get('NAME')
File "/usr/local/lib/python2.7/dist-packages/pypjlink/projector.py", line 130, in get
success, response = protocol.send_command(self.f, body, '?', self.encoding)
File "/usr/local/lib/python2.7/dist-packages/pypjlink/protocol.py", line 71, in send_command
resp_body, resp_param = parse_response(f, encoding)
File "/usr/local/lib/python2.7/dist-packages/pypjlink/protocol.py", line 30, in parse_response
assert header == '%'
AssertionError