Skip to content

Execution stops #26

Description

@lubbifo

Hi there,

I use your python library for Openhab integration. Frequently it happens, that this external program gets stuck. I then see the following in the process list:

user  20821  0.0  0.0   1468   244 ?        S    12:11   0:00 sh -c /mijia/mijia_temp read a4:c1:38:41:xxxx
user  20823  0.4  0.3  13936  6492 ?        S    12:11   0:02 python3 /mijia/mijia_temp read a4:c1:38:41:xxxx

It stays there forever.... This is how I use the library (derived from your demo code):

client = lywsd02.Lywsd02Client(mac, notification_timeout=30.0)
data = client.data
print('{:.1f}C {}%'.format(data.temperature,data.humidity))

The device I am using is this:

https://goodereader.com/blog/uploads/images/Screenshot_2020-05-27-C9-86-20-OFF-Newest-Xiaomi-Mijia-Bluetooth-Temperature-humidity-2-Wireless-Smart-Electric-Digital....png

I am using library version 0.0.9 on Python 3.7.3

I understand, that the connectivity to the device is noisy and unreliable. However, the code should return a result or an error after the timeout, but not stuck.

Am I doing anything wrong? Any ideas?

P.S.: "timeout 40 lywsdo2.python ...." is a good workaround

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions