Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helper not started? #3

Open
HBDK opened this issue Oct 12, 2020 · 4 comments
Open

Helper not started? #3

HBDK opened this issue Oct 12, 2020 · 4 comments

Comments

@HBDK
Copy link

HBDK commented Oct 12, 2020

Hi

i have been running this ass in a contianer on my hassio for a couple of weeks now and i have had some crashes.

this is the trace stack from the most recent:

`2020-10-12 17:08:38.370 | INFO | etrv2mqtt.devices:set_temperature:55 - Setting Living room left to 10.0C
2020-10-12 17:08:38.370 | ERROR | main::8 - An error has been caught in function '', process 'MainProcess' (7), thread 'MainThread' (139957320365888):
Traceback (most recent call last):

File "/usr/local/bin/etrv2mqtt", line 8, in
sys.exit(entrypoint())
│ │ └ <function entrypoint at 0x7f4a5942ab80>
│ └
└ <module 'sys' (built-in)>
File "/usr/local/lib/python3.8/site-packages/etrv2mqtt/cli.py", line 28, in entrypoint
main(sys.argv[1])
│ │ └ ['/usr/local/bin/etrv2mqtt', '/data/options.json']
│ └ <module 'sys' (built-in)>
└ <function main at 0x7f4a5a3a93a0>
File "/usr/local/lib/python3.8/site-packages/etrv2mqtt/cli.py", line 17, in main
deviceManager.poll_forever()
│ └ <function DeviceManager.poll_forever at 0x7f4a59076940>
└ <etrv2mqtt.devices.DeviceManager object at 0x7f4a597a2220>
File "/usr/local/lib/python3.8/site-packages/etrv2mqtt/devices.py", line 96, in poll_forever
schedule.run_pending()
│ └ <function run_pending at 0x7f4a590761f0>
└ <module 'schedule' from '/usr/local/lib/python3.8/site-packages/schedule/init.py'>
File "/usr/local/lib/python3.8/site-packages/schedule/init.py", line 563, in run_pending
default_scheduler.run_pending()
│ └ <function Scheduler.run_pending at 0x7f4a59069dc0>
└ <schedule.Scheduler object at 0x7f4a5906ed00>
File "/usr/local/lib/python3.8/site-packages/schedule/init.py", line 94, in run_pending
self._run_job(job)
│ │ └ Every 2 seconds do _set_temerature_task(<etrv2mqtt.devices.TRVDevice object at 0x7f4a5907a3d0>, 10.0) (last run: [never], nex...
│ └ <function Scheduler._run_job at 0x7f4a590750d0>
└ <schedule.Scheduler object at 0x7f4a5906ed00>
File "/usr/local/lib/python3.8/site-packages/schedule/init.py", line 147, in _run_job
ret = job.run()
│ └ <function Job.run at 0x7f4a590760d0>
└ Every 2 seconds do _set_temerature_task(<etrv2mqtt.devices.TRVDevice object at 0x7f4a5907a3d0>, 10.0) (last run: [never], nex...
File "/usr/local/lib/python3.8/site-packages/schedule/init.py", line 466, in run
ret = self.job_func()
│ └ functools.partial(<bound method DeviceManager._set_temerature_task of <etrv2mqtt.devices.DeviceManager object at 0x7f4a597a22...
└ Every 2 seconds do _set_temerature_task(<etrv2mqtt.devices.TRVDevice object at 0x7f4a5907a3d0>, 10.0) (last run: [never], nex...
File "/usr/local/lib/python3.8/site-packages/etrv2mqtt/devices.py", line 103, in _set_temerature_task
device.set_temperature(self._mqtt, temperature)
│ │ │ │ └ 10.0
│ │ │ └ <etrv2mqtt.mqtt.Mqtt object at 0x7f4a5907a5e0>
│ │ └ <etrv2mqtt.devices.DeviceManager object at 0x7f4a597a2220>
│ └ <function TRVDevice.set_temperature at 0x7f4a59076790>
└ <etrv2mqtt.devices.TRVDevice object at 0x7f4a5907a3d0>
File "/usr/local/lib/python3.8/site-packages/etrv2mqtt/devices.py", line 59, in set_temperature
eTRVUtils.set_temperature(self._device, temperature)
│ │ │ │ └ 10.0
│ │ │ └ <libetrv.device.eTRVDevice object at 0x7f4a5907a580>
│ │ └ <etrv2mqtt.devices.TRVDevice object at 0x7f4a5907a3d0>
│ └ <staticmethod object at 0x7f4a592ffa30>
└ <class 'etrv2mqtt.etrvutils.eTRVUtils'>
File "/usr/local/lib/python3.8/site-packages/etrv2mqtt/etrvutils.py", line 38, in set_temperature
device.temperature.set_point_temperature = float(temperature)
│ │ └ 10.0
│ └ <libetrv.properties.eTRVProperty object at 0x7f4a59306160>
└ <libetrv.device.eTRVDevice object at 0x7f4a5907a580>
File "/usr/local/lib/python3.8/site-packages/libetrv/properties.py", line 22, in get
return self.get_data_object(device).retrieve()
│ │ └ <libetrv.device.eTRVDevice object at 0x7f4a5907a580>
│ └ <function eTRVProperty.get_data_object at 0x7f4a5931d430>
└ <libetrv.properties.eTRVProperty object at 0x7f4a59306160>
File "/usr/local/lib/python3.8/site-packages/libetrv/properties.py", line 59, in retrieve
self.read()
│ └ <function eTRVData.read at 0x7f4a5931da60>
└ <libetrv.data_struct.TemperatureData object at 0x7f4a5882e0d0>
File "/usr/local/lib/python3.8/site-packages/libetrv/properties.py", line 91, in read
data = etrv_read_data(self.device, handler, send_pin, use_encoding)
│ │ │ │ │ └ True
│ │ │ │ └ True
│ │ │ └ 45
│ │ └ <libetrv.device.eTRVDevice object at 0x7f4a5907a580>
│ └ <libetrv.data_struct.TemperatureData object at 0x7f4a5882e0d0>
└ <function etrv_read_data at 0x7f4a5930a4c0>
File "/usr/local/lib/python3.8/site-packages/libetrv/utils.py", line 20, in etrv_read_data
data = device.ble_device.readCharacteristic(handler)
│ │ │ └ 45
│ │ └ <function Peripheral.readCharacteristic at 0x7f4a59458c10>
│ └ <bluepy.btle.Peripheral object at 0x7f4a59429310>
└ <libetrv.device.eTRVDevice object at 0x7f4a5907a580>
File "/usr/local/lib/python3.8/site-packages/bluepy/btle.py", line 529, in readCharacteristic
self._writeCmd("rd %X\n" % handle)
│ │ └ 45
│ └ <function BluepyHelper._writeCmd at 0x7f4a59458040>
└ <bluepy.btle.Peripheral object at 0x7f4a59429310>
File "/usr/local/lib/python3.8/site-packages/bluepy/btle.py", line 302, in _writeCmd
raise BTLEInternalError("Helper not started (did you call connect()?)")
└ <class 'bluepy.btle.BTLEInternalError'>
bluepy.btle.BTLEInternalError: Helper not started (did you call connect()?)`

@HBDK
Copy link
Author

HBDK commented Oct 12, 2020

I was wondering if maybe it needs some error handling when calling set_point_temperature?
or if this is something that should be addressed in the libetrv library.

@keton
Copy link
Owner

keton commented Oct 14, 2020

I haven't contact with this code for quite a while but it looks like the error is in bluepy not here. etrv2mqtt tries to be thin wrapper around libetrv which is in turn a thin wrapper around bluepy.
If you have an idea how to debug where this error comes from go ahead. My thermostats run just fine with etrv2mqtt as systemd service with auto restart. So maybe this is container related?

@mortalone
Copy link

i have the same issue. anyone fixed this ?

@mortalone
Copy link

i got it working. i had to do a reset
https://www.youtube.com/watch?v=Z2_J_2bIfWo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants