krontech / pychronos

Python bindings for the Chronos High Speed Camera
GNU General Public License v3.0
3 stars 2 forks source link

NameError: name 'gclient' is not defined. #21

Closed DDR0 closed 5 years ago

DDR0 commented 5 years ago

On starting up pychronos ⑂master, I get the following error. It can be ignored, but I have to do so every time I start pychronos. It should not be thrown in the first place. Log is as follows:

2019-07-12 02:05:26,709 DEBUG [set] Setting saveAndPowerDownWhenLowBattery failed: setPowerMode() takes 3 positional arguments but 4 were given
2019-07-12 02:05:26,711 DEBUG [set] Traceback (most recent call last):
  File "cam_control.py", line 289, in set
    setattr(self.camera, name, value)
  File "/root/pychronos/pychronos/camera.py", line 1115, in saveAndPowerDownWhenLowBattery
    self.power.setPowerMode(self.power, self._powerOnWhenMainsConnected, self._saveAndPowerDownWhenLowBattery)
TypeError: setPowerMode() takes 3 positional arguments but 4 were given

2019-07-12 02:05:26,718 ERROR [loadAnalogCal] Failed to load lux1310 calibration data from /var/camera/cal/lux1310cal_G1_WT62.json
2019-07-12 02:05:26,852 INFO [__loadBlackCal] Loading black calibration from /var/camera/cal/fpn/fpn1280x716offset0x156_G1_WT62.raw
2019-07-12 02:05:26,998 WARNING [set] Sensor configuration chage requires new calibration
2019-07-12 02:05:27,001 INFO [startCalibration] starting analog calibration
2019-07-12 02:05:27,002 DEBUG [onChangeHandler] Parameter state -> analogcal
2019-07-12 02:05:27,005 DEBUG [startAnalogCal] Starting ADC offset calibration
2019-07-12 02:05:27,029 INFO [set] Notifying cam-pipeline to reconfigure display
2019-07-12 02:05:27,050 WARNING [saveAndPowerDownLowBatteryLevelPercent] Value not implemented, using dummy.
2019-07-12 02:05:27,054 ERROR [stepGenerator] 'controlApi' object has no attribute 'loadCalibration'
2019-07-12 02:05:27,056 DEBUG [stepGenerator] Traceback (most recent call last):
  File "cam_control.py", line 72, in stepGenerator
    delay = next(generator)
  File "cam_control.py", line 443, in runSoftReset
    if not self.loadCalibration():
AttributeError: 'controlApi' object has no attribute 'loadCalibration'

Traceback (most recent call last):
  File "cam_control.py", line 586, in __call__
    self.camera.power.checkPowerSocket()
  File "/root/pychronos/pychronos/power.py", line 96, in checkPowerSocket
    ret = gclient.recv(1000)
NameError: name 'gclient' is not defined
0
[1] > /root/pychronos/pychronos/power.py(96)checkPowerSocket()
-> ret = gclient.recv(1000)
(Pdb++)
DDR0 commented 5 years ago

This bug is fixed in the non-polling-power branch.

oskirby commented 5 years ago

The non-polling-power branch has been merged, this is a new bug due to my changes in https://github.com/krontech/pychronos/commit/fa6a50329e2733ae2e5ce771a138c31b07f2e5d0 and is entirely because I haven't been able to test it on a camera with a Debianized pcUtil yet. Sorry for the error.