error with instruction import zigbee

Hi all,

I have downloaded dia 1.1.17 and imported it in Pydev, but it seems there are errors (72 !). The main error is on the following instruction (in "adressing.py for exemple):

import zigbee

Do you know why “Zigbee” can’t be import ?
Do think a file is missing in the dia i have downloaded ?

Best regards.
Cédric

Hi Cedric,

You need to have a file called ‘zigbee.py’ in the python directory on your device. Whenever you see that ‘import zigbee’ the script is requiring that library to be present.

In future releases of the Dia, that requirement is eliminated, but that’s the future, so we have to make due today.

I’ve attached the file, please upload it using the HTTP form found here: http://10.9.109.34/config/applications/python_files.htm (Adjust for your IP)

Mkotasek,

First thank you for your help.
I have insrted your file “Zigbee.py” in my python project, in the folder “scr/devices/xbee/xbee_devices”, but there is still error with the instruction “import zigbee”. I have tried to move the file in others folders, but it doesn’t work.
In the file “XBee_Device_Manager.py” these vaiables generate the error “undefines variable”:

  • ZBS_PROT_TRANSPORT
  • ZBS_PROT_802154
  • ZBS_PROT_APS
    and theses variables are not defined in “zigbee.py” you attached. So, I don’t know where to fond the definition of these variables

These instructions generate error too (“Unresolved import”):

  • “import yaml” in “settings_serializer_yaml.py” file
  • “import termios” in “gps.py”
  • “import digi_cmd as cmd” in “console_interface.py”
  • “from digicli import digicli” in “digi_device_infi.py”
  • and many others…

Is it normal ?

Cedric

Hi Cedric,

iDigi Dia is a framework which is supposed to work under a Digi ConnectPort device. You can try to import it in Pydev (really you don’t need to do it), but as you have said it will give some errors. It is because the Digi ConnectPort devices own (or have embedded) some of the modules that Dia is asking for. For example the digihw, digicli, digi_cmd… The reason you are still receiving the Zigbee import errors is because the zigbee.py module imports all the members from the _zigbee.py one, which is also included inside the Digi CP device, not in the Dia structure.

So, if you want to build a Dia project you don’t need to import the Dia structure in PyDev, just use the “make.py” script (contained in the Dia structure) with your configured “yml” file to build your own Dia project. It will compile all the necessary modules into a zip file that must be transferred to the CP device with the “dia.py” file. Once transferred, restart your CP and execute the “dia.py” script (python “dia.py”) to initialize the Dia framework into your remote device.

You can find the complete guide on how to create Dia projects under the following link:

http://ftp1.digi.com/support/documentation/90001063_a.pdf

Regards!

Thank you Diego,

Indeed, Dia is not compatible with Pydev Environnent, that’s why it generates errors (it misses zigbee.py module). I have tried to build my dia project, and that works.

Best regards.
Cedric