The code is stored on the X4 and executed with the python command, the result is:
Traceback (most recent call last):
File “”, line 7, in ?
File “WEB/python/xbee_sensor.py”, line 65, in ?
from devices.device_base import DeviceBase
ImportError: No module named devices.device_base
Just as a side note - you can’t run Dia modules without Dia running. For example if you look into the dia.py file you see how it splices the ZIP into the OS by the sys.path.insert() and other details. Without this splice you’ll get a ‘no module’ error for every module called.
Your example makes no sense in a Dia context, as you’d NOT be calling ddo_set_param() and so on. Plus assuming your sensors sleep, then you cannot issue DDO to them, nor can you poll them for values.
That is the value of Dia - the complexities it forces on you help solve the fact that (as example) my temperature sensors send me a new value only every 15 minutes. In between those 15 minutes, any attempt to talk to that sleeping sensor just cripples my system for up to 30 seconds. I am forced to just let Dia collect the data for me, and them I have a temperature WITH a time-stamp which shows me what the historical value was.
Is there more to your sample than what you’ve posted? A very naive reading of the code and the error would indicate an attempt to use a component of the iDigi Dia source without building a complete Dia “application” using the Dia make.py script, etc. I would expect the devices module dependence to be made resolved in a dia.zip file, for instance.
Oh, it’s not a side note at all. The key is definitely that there is a mixing of terms in the sample. A visit to the resources area on idigi.com may be helpful… there are documents with a few XBee related samples to serve as reference.