This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Help with the zb-cli-wrapper python package for a ZigBee application.

Hi,

I am using the BMD340 module from Rigado. The module is connected to a raspberry compute module via UART. The design implemented is the  “CLI co-processor design” where the ZigBee stack is installed and running on the SoC (https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_tz_v3.2.0%2Fzigbee_example_cli_agent.html). I am able to connect to the CLI and interact with it using the zb-cli-wrapper python package on python3.7.6. But for some reason when I am trying to run my application (simple application based on the example in the package) from a python virtual environment (also python3.7.6), the application hangs. I can create the ZbCliDevice object, but when I want to set channels and the role (cli_dev.bdb.channels = [16] and cli_dev.bdb.role = 'zc'), the application hangs.

I tried to debug it and found that the function that hangs is tcdrain(). This function is called by zb_cli_wrapper/src/utils/connection.py module at line 240. It tries to flush the serial buffer but hangs and I don't understand why.

Greetings,
Damien

Parents
  • Hi Damien,

    Are you testing using the MQTT Zigbee gateway example included in the wrapper package? Did that go well? Which modifications have you done after that?

    BR,

    Marjeris

  • Hi,

    I actually took parts from the MQTT example, where it creates the cli_device. Then I tried to play around with it in python interactive mode ( like cli_dev.zdo.match_desc(...), etc ). And that works from my normal python installation but not in a venv.

    But know I tried to run your MQTT example, and it has exactly the same behavior.

    With the venv deactivated it works just fine:

    With the venv activated: (it hangs when it tries to flush the serial buffer at some point)

    PS. I saw you released zb-cli-wrapper-0.3 the 03/31/2020. But it is even worse, it requires numpy and numpy is complaining when I start the MQTT example. But then "sudo apt-get install libatlas-base-dev" fixed the numpy issue.
    Can you please let me know where I can get the source of zb-cli-wrapper (as zip or something similar) because it is a bit annoying having to check in site-packages.

    Best regards,

    Damien

  • Hi,

    Are you sure you have installed all the requirements for the wrapper in the virtual enviroment? What happens when you call "pip install -U setuptools" and "pip install zb-cli-wrapper" in the venv?

    BR,

    Marjeris

  • Hi,

    What are all the requirements? Because the installation works fine, and technically installing zb-cli-wrapper package should download all the python requirements automatically using setuptools (and it is installed in my virtual environment). Is it possible that you ask one of your colleague (or you if you can) to try the MQTT example in a virtual environment to check if it works? Because I don't know what I am doing wrong. It works for my normal python installation but not for the virtual env. There is probably a point that I miss... I actually didn't find a lot of resources about the zb-cli-wrapper, could you give me some links to resources or more examples?

    BR,
    Damien

Reply
  • Hi,

    What are all the requirements? Because the installation works fine, and technically installing zb-cli-wrapper package should download all the python requirements automatically using setuptools (and it is installed in my virtual environment). Is it possible that you ask one of your colleague (or you if you can) to try the MQTT example in a virtual environment to check if it works? Because I don't know what I am doing wrong. It works for my normal python installation but not for the virtual env. There is probably a point that I miss... I actually didn't find a lot of resources about the zb-cli-wrapper, could you give me some links to resources or more examples?

    BR,
    Damien

Children
No Data
Related