Hallo,
I have the next problem:
I want to present the data from the wallrouter to https://developer.idigi.com/home.do (sd1-na.idigi.com)
The telnet session works fine. What am i doing wrong?
PS How can I upload an attachement?
Maybe I must get a little more specific. As you can see is the setup of this part of the X2 and the WallRouter ok. But why can i not pusch the data into the iDigi platform? Please help!
This configuration file is used to specify which components will be
specified for use with the iDigi Dia Sensor Demo.
Essentially, we will be selecting the sources of information, and how
that information is presented. This demo is intended to be used with
the number of devices configured in this file. If you wish to use a
larger number of devices, you will need to change the configuration
of the cwm_exist presentation near the bottom of this file.
The devices section specifies settings for devices
devices:
First we specify an XBee Device Manager. Since the XBee is considered,
a shared resource on our system, we need a device which can manage
requests from other devices relating to the XBee.
- name: xbee_device_manager
driver: devices.xbee.xbee_device_manager.xbee_device_manager:XBeeDeviceManager
Here we are including a Digi LTH (Light, Temperature, Humidity)
XBee Sensor in our system. Configuration is similar to the Smart Plug.
The main addition is that since the LTH Sensor will likely be battery
powered, we have set the XBee to sleep between samples.
- name: wall_router0
driver: devices.xbee.xbee_devices.xbee_sensor:XBeeSensor
settings:
xbee_device_manager: xbee_device_manager
extended_address: “00:13:a2:00:40:30:0d:5d!”
sleep: True
sample_rate_ms: 1000
awake_time_ms: 320
The presentation section allows us to specify the ways in which
information in our system is available.
presentations:
Here we define a standard console method. Using this,
someone can connect (with telnet in Windows for example),
to get a quick and simple look at the current state of the
system. They can view the status of all channels, and set
any channels that support being configured.
- name: console
driver: presentations.console.console:Console
settings:
type: tcp
port: 80
The cwm_exist presentation layer is what allows us to
interact with the iDigi Platform Cache (temp) Storage Service.
This presentation layer tracks when updates are made to any
of the channels. After a certain interval of time (defined by
the interval setting), or after the number of new samples has
exceeded our sample_threshold, we combine all of the sample
information in an XML file, and then push it up to Connectware
through an available network connection.
Each time we push up to iDigi Platform, we are essentially creating
a file to store our information. The file_count lets us choose the
maximum number of files we will have at one time as a result of this
presentation layer. It will cycle through and overwrite old data.
If you wish to increase the number of devices in this demo, remember
that each device can potentially have multiple channels. You will want
to ensure that sample_threshold parameter is greater than the total
number of channels that are actively configured or the cwm_exist
presentation will constantly attempt to combine all sample information
and send to iDigi Platform.
- name: cwm_exist
driver: presentations.cwm_exist.cwm_exist:CWMExist
settings:
interval: 30
sample_threshold: 100
collection: sensor_demo
file_count: 20
filename: sensor_reading
Create a web presentation instance. When running on a PC this will
start a new web-server on a default port
When running on a Digi device this presentation will “extend” the
web-server built in to the Digi device with a new page named
“digi_dia.html”. See the file src/presentations/web/web.py form more
information.
- name: web0
driver: presentations.web.web:Web
settings:
page: digi_dia.html
The RCIHandler allows for channel dumps, querying a channel, and setting
a channel. The RCIHandler parses an incoming XML formatted message
to determine what you wish to do. The messages are shown below. If
an error is encountered, the request you sent will have a child error
element specifying the error information.
- name: rci_handler
driver: presentations.rci.rci_handler:RCIHandler
settings:
target_name: digi_dia
iDigi Device Integration Application Version 1.1.17
Using settings file: dia.yml
Core: initial garbage collection of 0 objects.
Attempting to read “dia.yml” in “WEB/python/dia.zip”…
Core: post-settings garbage collection of 25 objects.
Starting Channel Manager…
Starting Device Driver Manager…
XBeeDeviceManager(xbee_device_manager): node ‘00:13:a2:00:40:30:0d:5d!’ moved to CONFIGURE state.
XBeeDeviceManagerConfigurator: request to configure node ‘00:13:a2:00:40:30:0d:5d!’
XBeeDeviceManagerConfigurator: node ‘00:13:a2:00:40:30:0d:5d!’ will sleep and first configuration attempt.
XBeeDeviceManagerConfigurator: deferring configuration for node ‘00:13:a2:00:40:30:0d:5d!’
XBeeDeviceManager(xbee_device_manager): 00:13:a2:00:40:30:0d:5d! next config attempt deferred 198 seconds.
Starting Presentation Manager…
XBeeDeviceManagerConfigurator: request to configure node ‘00:13:a2:00:40:30:0d:5d!’
XBeeConfigBlockDDO.apply_config: trying ‘00:13:a2:00:40:30:0d:5d!’ = ‘DL’ to ‘\x40\x4a\x70\x77’
XBeeConfigBlockDDO.apply_config: trying ‘00:13:a2:00:40:30:0d:5d!’ = ‘P1’ to ‘0x3’
Exception during core initialization:
Traceback (most recent call last):
File “src\core\core_services.py”, line 212, in run
File “src\presentations\presentation_manager.py”, line 80, in init
File “src\settings\settings_base.py”, line 170, in init
File “src\presentations\presentation_manager.py”, line 86, in apply_settings
File “src\presentations\presentation_manager.py”, line 101, in __reenumerate_presentations
File “src\presentations\presentation_manager.py”, line 141, in driver_load
PresentationClassLoadError: unable to load ‘presentations.cwm_exist.cwm_exist:CWMExist’: exceptions.MemoryError:
CoreServices: fatal exception caught! Halting execution.
GarbageCollector: collected 0 objects.
Exception in thread console:
Traceback (most recent call last):
File “./threading.py”, line 442, in __bootstrap
File “src\presentations\console\console.py”, line 107, in run
File “src\presentations\console\console_tcp_server.py”, line 182, in init
File “C:\Python24\Lib\SocketServer.py”, line 330, in init
File “C:\Python24\Lib\SocketServer.py”, line 341, in server_bind
File “”, line 1, in bind
error: (112, ‘Address already in use’)
XBeeConfigBlockDDO.apply_config: trying ‘00:13:a2:00:40:30:0d:5d!’ = ‘DH’ to ‘\x00\x13\xa2\x00’
XBeeConfigBlockDDO.apply_config: trying ‘00:13:a2:00:40:30:0d:5d!’ = ‘IR’ to ‘0x3e8’
XBeeConfigBlockDDO.apply_config: trying ‘00:13:a2:00:40:30:0d:5d!’ = ‘IC’ to ‘0x800’
XBeeConfigBlockDDO.apply_config: trying ‘00:13:a2:00:40:30:0d:5d!’ = ‘D2’ to ‘0x2’
XBeeConfigBlockDDO.apply_config: trying ‘00:13:a2:00:40:30:0d:5d!’ = ‘D3’ to ‘0x2’
XBeeConfigBlockDDO.apply_config: trying ‘00:13:a2:00:40:30:0d:5d!’ = ‘D1’ to ‘0x2’
XBeeConfigBlockDDO.apply_config: applying changes (AC)
: broadcasting new SP = 0x64
XBeeConfigBlockSleep: trying ‘00:13:a2:00:40:30:0d:5d!’ = ‘SP’ to ‘0x64’
XBeeConfigBlockSleep: trying ‘00:13:a2:00:40:30:0d:5d!’ = ‘SO’ to ‘0x0’
XBeeConfigBlockSleep: trying ‘00:13:a2:00:40:30:0d:5d!’ = ‘SN’ to ‘0x1’
XBeeConfigBlockSleep: trying ‘00:13:a2:00:40:30:0d:5d!’ = ‘SM’ to ‘0x4’
XBeeConfigBlockSleep: trying ‘00:13:a2:00:40:30:0d:5d!’ = ‘ST’ to ‘0x140’
XBeeConfigBlockSleep: applying changes (final AC)
XBeeConfigBlockFinalWrite: trying ‘WR’ to ‘00:13:a2:00:40:30:0d:5d!’
XBeeConfigBlockSleep: trying ‘00:13:a2:00:40:30:0d:5d!’ = ‘ST’ to ‘0x140’
XBeeConfigBlockSleep: applying changes (final AC)
XBeeConfigBlockFinalWrite: trying ‘WR’ to ‘00:13:a2:00:40:30:0d:5d!’
XBeeDeviceManager(xbee_device_manager): configuration done for node ‘00:13:a2:00:40:30:0d:5d!’ promoting to RUNNING state.
XBeeSensor(wall_router0): running indication
XBeeSensor(wall_router0): DD info (module_id, product_id) = (0x0002, 0x0008)
XBeeSensor(wall_router0): sensor is a ‘Digi XBee Wall Router’ no humidity capability.
XBeeSensor(wall_router0): raw sample L: 52, T: 703
XBeeSensor(wall_router0): raw sample L: 57, T: 703
XBeeSensor(wall_router0): raw sample L: 52, T: 703
XBeeSensor(wall_router0): raw sample L: 51, T: 703
XBeeSensor(wall_router0): raw sample L: 56, T: 703
XBeeSensor(wall_router0): raw sample L: 57, T: 703
XBeeSensor(wall_router0): raw sample L: 55, T: 703
XBeeSensor(wall_router0): raw sample L: 50, T: 703
XBeeSensor(wall_router0): raw sample L: 53, T: 703
XBeeSensor(wall_router0): raw sample L: 56, T: 703
XBeeSensor(wall_router0): raw sample L: 57, T: 703
XBeeSensor(wall_router0): raw sample L: 52, T: 703
XBeeSensor(wall_router0): raw sample L: 51, T: 703
XBeeSensor(wall_router0): raw sample L: 55, T: 703
XBeeSensor(wall_router0): raw sample L: 57, T: 703
XBeeSensor(wall_router0): raw sample L: 55, T: 703
See also:
http://www.digi.com/support/forum/viewalbumitem?check=true&itemid=1
http://www.digi.com/support/forum/viewalbumitem?check=true&itemid=2
http://www.digi.com/support/forum/viewalbumitem?check=true&itemid=3
http://www.digi.com/support/forum/viewalbumitem?check=true&itemid=4
Hi,
The more detailed information helps quite a bit.
The important part of that log is the following:
PresentationClassLoadError: unable to load ‘presentations.cwm_exist.cwm_exist:CWMExist’: exceptions.MemoryError:
CoreServices: fatal exception caught! Halting execution.
The X2 is somewhat limited for memory, so when using the Dia, you’ll have to keep the number of presentations you are using low. Remove the console, web, and telnet presentations, and just try it with the CWMExist presentation to make sure it works. Then you can check the free memory of the device and add back in presentations as long as the memory doesn’t get very low.
Also, you might want to give the 1.2.19 version of Dia a try if you don’t have any specific ties to the 1.1.x versions. I think it should be more friendly on memory usage.
Chris
also the
File "src\presentations\console\console_tcp_server.py", line 182, in ...
...
error: (112, 'Address already in use')
might mean that you are running multiple instances of the Dia which may consume a lot of the available memory. Rebooting the device after updating will make sure that any previous are running.
Thanks cpopp and clofink! It works fine now! The 1.2.19 consumes indeed less memory.
Little problem was that in the Dia version 1.2.19 there is no cwm_exist presentation. I took it from the 1.1.17 Dia.
Hi,
It has actually just been renamed to idigi_db. Easy to miss, but there is a note about it in the release notes under the doc directory:
Presentation Changes:
* Renamed cwm_exist Presentation to idigi_db. Added "secure" setting to upload data via HTTPS.
Chris