Changes between Version 11 and Version 12 of ZigbeeGateway


Ignore:
Timestamp:
Sep 28, 2010, 6:58:11 AM (14 years ago)
Author:
Sensei
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ZigbeeGateway

    v11 v12  
    1616
    1717== Installation ==
    18 There is not an installation package available. To run this software just copy and paste the files contain in the [#PakageContent package] in a directory and run the exe file "Zb2SenseiGw.exe". Prior to that, it is convenient to adjust the configuration file (see [#Configuration Configuration section]).
     18There is not an installation package available. To run this software just copy and paste the files contain in the [#PackageContent package] in a directory and run the exe file "Zb2SenseiGw.exe". Prior to that, it is convenient to adjust the configuration file (see [#Configuration Configuration section]).
    1919
    2020=== Requirements ===
    2121The package requires:
    22 * Windows XP operating system version or upper.
     22* Windows operating system, version XP or upper.
    2323* No special computer performance requirements are needed.
    2424* External Hardware:
     
    3434       * //connect.bmb//, //disconnect.bmp//, //linked.bmp//, //sensei.ico//
    3535* Configuration files:
    36        * //ZB2SenseiGW.exe.config//, //rpi.xml// (more configuration files can be added, see [#Configuration Configuration section])
     36       * //ZB2SenseiGW.exe.config//, //rpi.xml// (more configuration files can be added, see [#rpi.xmlfile Configuration section])
    3737* Libraries of Zigbee dongle:
    3838       * //STKUSB.dll//, //ZB.dll//
     
    4747The two ways of connecting to a Zigbee island (dongle or concentrator) are quite similar, the dongle and external concentrator have primitives for connecting to a Zigbee island and for interchanging messages. In the case of dongle it is done through a library (*.dll). In the case of the external concentrator it is done using a TCP/IP messaging.
    4848
    49 The software engage to the island, discovers nodes, and for each node it discovers sensors and actuators. This software operates under the following Zigbee configuration:
     49The software engages to the island, discovers nodes, and for each node it discovers resources, that is, sensors and actuators. This software operates under the following Zigbee configuration:
    5050* It has been tested upon Zigbee 2007. Zigbee Pro should work depending on the Zigbee dongle or concentrator.
    5151* It is needed to known a priori physical Zigbee parameters:
    5252       * Frequency channel number (11 to 26).
    5353       * Zigbee net password.
    54        * extended PAN Identification helps but not needed.
     54       * Extended PAN Identification helps but not needed.
    5555* Not all the Zigbee profiles are detected. It have been tested under temperature, light, human presence, acceleration sensors, proprietary location sensors and electricity on/off actuator.
    5656
    57 The Gateway has the following features regarding **Resource End Point implementation**:
    58 * Allows **publication** of individual resources (sensors and actuators) against a Resource Directory.
     57The Gateway has the following features regarding **Resource End Point (REP) implementation**:
     58* Allows **publication** of individual resources (sensors and actuators) into a Resource Directory.
    5959* Allows **getting** data from resources and **acting** over them using **RESTful** access.
    6060* Allows **subscription** to resources. Notification can be requested upon one or several of the following conditions:
     
    6464* Allows **mobility**. Several gateways can be located in the vicinity and in the case that the Zigbee island allows nodes to move, both gateways communicate each other to properly handle the mobility.
    6565
    66 In order to not saturate the islands with possible huge requests coming from the internet world, the gateway do not bypass the entire requests to the island. For that reason the gateways stores the last value of the resources in order to respond by itself to several requests targeting the same resource that arrives at the same time.
     66In order to not saturate the islands with possible huge requests coming from the internet world, the gateway do not bypass all the requests to the island. For that reason the gateways stores the last value of the resources in order to respond by itself to requests targeting the same resource that arrives at the same time.
    6767
    6868== Configuration ==
    69 Two xml files need to be edited for configuring properly the software package before running it. These configuration files allows to establish most of the behaviour of the package without the needed of compile the software.
    70 
    71 Remember that these files are read when application starts. If you change a value, it will not be considered after restarting the application.
     69Two xml files need to be edited for configuring properly the software package before running it. These configuration files allow to establish most of the behaviour of the package without the need of compile the software.
     70
     71Remember that these files are read when application starts. So if you change a value, it will not be considered after restarting the application.
    7272
    7373It is not needed special editor for changing these files. Whichever text editor used is enough. But special care should be followed for not modifying the overall xml structure, and the rest of the tags. Read this section before proceed to edit the files.
     
    7878The "**//Zb2SenseiGw.exe.config//**" file allows establishing:
    7979
    80 "**//Language//**": Specify language of messages and some debug traces. Available languages are "//en//" (English, by default) and "//es//" (Spanish, but still some things will be English).
    81 
    82 "**//AppName//**": Specify the name of the application ones connected to the net. By default is "//Zigbee to Sensei Gateway//" but is useful to have different names related to the net if several instances are running. Net MAC will be append between brackets.
     80"**//Language//**": Specify language of messages and debug traces. Available languages are "//en//" (English, by default) and "//es//" (Spanish, but still some traces are only in English).
     81
     82"**//AppName//**": Specify the name of the application once connected to the net. By default it is "//Zigbee to Sensei Gateway//" but it can be useful to have different names related to the net if several instances are running. Net MAC will be appending between brackets.
    8383
    8484"**//autoConnectType//**" and "**//autoConnectIndexCh//**": Indicates if you want to connect to the Zigbee island automatically when the application starts. It is very useful for non attended servers if the computer or application restarts for whatever reason. The possible values of "//autoConnectType//" are:
     
    9797"**//netExtPANid//**": target Zigbee extended PAN identifier in hexadecimal format: leave empty for any. (example: "//20DB765432144010//").
    9898
    99 "**//Sensei_RPI_ProxiHost//**","**//Sensei_RPI_ProxiPort//**","**//Sensei_RPI_ProxiBypass//**": If proxy is used for accessing internet both for publication and notification, proper configuration is needed here. If not, leave empty. Insert Host as name or IP address, TCP port to be used and bypass contains local IP address ranges that do not use the proxy, as for example "//192.168.0.0/192.168.255.255//"
    100 
    101 "**//Sensei_RAI_BaseURL//**": Base URL for the SENSEI RAI Resource Access Interface server. For example "//http://myIP:8081/sensei/rai/resources/ //". If empty, the application will not implement the RAI server. It is mandatory to include the port event if the default port is used. It is also mandatory to end in "/". The text "//myIP//" will be replaced by first computer IP address. If the computer has several IP addresses and you want to use another, put it explicitly instead of "//myIP//". Each resource is acceded through **BaseURL/ //nodeID/[s or a]/number//** (see [#RAIinterface RAI Interface] for more details).
     99"**//Sensei_RPI_ProxiHost//**","**//Sensei_RPI_ProxiPort//**","**//Sensei_RPI_ProxiBypass//**": If proxy is used for accessing internet both for publication and notification, proper configuration is needed here. If not, leave empty. Fill "Host" as name or IP address, proxy TCP port used and bypass contains local IP addresses ranges that do not use the proxy, as for example "//192.168.0.0/192.168.255.255//"
     100
     101"**//Sensei_RAI_BaseURL//**": Base URL for the SENSEI Resource Access Interface (RAI ) server. For example "//http://myIP:8081/sensei/rai/resources/ //". If empty, the application will not implement the RAI server. It is mandatory to include the port event if the default port is used. It is also mandatory to end in "/". The text "//myIP//" will be replaced by first computer IP address. If the computer has several IP addresses and you want to use another, put it explicitly instead of "//myIP//". Each resource is acceded through **BaseURL/ //nodeID/[s or a]/number//** (see [#RAIinterface RAI Interface] for more details).
    102102
    103103"**//Sensei_RPI_RAIBaseURL//**": Base URL that will contain the "<Rai-Description> <REP-Locator>" tag when a resource is published in the Resource Directory.  If empty it will take previous //Sensei_RAI_BaseURL// variable, but it can be different. It is needed for example if the gateway access through a proxy or a router that changes the local IP (used when mounting an http RAI server) into a public IP (that is the IP seen from outside). Same rules as before apply: End with "/", application will append "//nodeID/[s or a]/number//" to this URL; and "//myIP//" text will be replaced by first computer IP address.
     
    107107"**//Sensei_RPI_ExpirationTime//**": Expiration time for each resource published into the Resource Directory, in hours from first publication. If empty, one week will apply.
    108108
    109 "**//ZB2SenseiGw_Password//**": This is used in case of mobility. It contains a text password that is needed to provide credentials between gateways. The gateways that take part in the mobility of a node need to have the same password.
    110 
    111 For a dongle connection, "**//timeWaitNodes//**" is the timeout in milliseconds of a node response, adjust to the maximum node latency in the net. "**//timeLinkedGateway//**" is the timeout in milliseconds while linking to the net. "**//timeExecuteOrder//**" is the timeout of a dongle response.
    112 
    113 For a external concentrator connection "**//timeSleepNodes//**", "**//timeConnection//**" and "**//timeReadMessages//**" respectively have the same meaning as before.
    114 
    115 "**// Retries //**": Number of retries that will be done when a Zigbee node does not respond before discarding this node.
     109"**//ZB2SenseiGw_Password//**": This is used for mobility of nodes between islands. It contains a text password that is needed to provide credentials between gateways. The gateways that take part in the mobility of a node need to have the same password. Leave empty if you do not want to implement credentials.
     110
     111For a dongle connection, "**//timeWaitNodes//**" is the timeout in milliseconds of a node response, adjust it to the maximum node latency in the net. "**//timeLinkedGateway//**" is the timeout in milliseconds when linking to the net. "**//timeExecuteOrder//**" is the timeout of a dongle response.
     112
     113For an external concentrator connection, "**//timeSleepNodes//**", "**//timeConnection//**" and "**//timeReadMessages//**" respectively have the same meaning as before.
     114
     115"**// Retries //**": Number of retries that will be tried when a Zigbee node does not respond before discarding this node.
    116116
    117117=== rpi.xml file===
    118118The **// rpi.xml //** file contains the xml text that will be sent to the Resource Directory when publishing a resource. In that way format can be completely changed for new versions without the need of compilation.
    119119
    120 In addition "**// rpi.xml //**" is a generic file for all the resources, but you can specify individual files for each resource. This can be done by inserting just a text file with the same structure in the package directory and with the name equals to (without blanks) "//**nodeID X number . xml**//", where:
     120In addition "**// rpi.xml //**" is a generic file for all the resources, but you can specify individual files for each resource. This can be done by inserting just a text file with the same structure in the package directory. If an individual file is present it will be considered, if not the generic "rpi.xml" file is considered. The individual files must have the following name (without blanks) "//**nodeID X number . xml**//", where:
    121121* "//**nodeID**//" is the node MAC address in hexadecimal format, (exactly 16 characters).
    122122* replace "//**X**//" with "s" for a sensor or "a" for an actuator.
    123123* "//**number**//" is the index of the sensor or actuator starting by 0.
    124  If an individual file is present it will be considered, if not the generic "rpi.xml" file is considered.
    125 
     124 
    126125In the "**//*.xml //**" file the following text variables will be replaced with the proper values by the application (case sensitive):
    127126* "//**_ResT**//": name of the resource, for example temperature, light, etc.
     
    131130* "//**_NUMBER**//": number of the sensor or actuator, starting by 0. If the node contains several, the order of appearance is considered.
    132131* "//**_TYPE**//": will be replaced by "actuator" for an actuator or "sensor" for a sensor.
    133 * "//**_TIME**//": expiration time contained in the "//Sensei_RPI_ExpirationTime//" variable of the "//Zb2SenseiGw.exe.config//" file.
     132* "//**_TIME**//": expiration time equals to now plus the time of "//Sensei_RPI_ExpirationTime//" variable of the "//Zb2SenseiGw.exe.config//" file.
    134133* "//**_ RAI**//": value of the "//Sensei_RPI_RAIBaseURL//" variable of the "//Zb2SenseiGw.exe.config//" file.
    135134
     
    153152For every sensor, actuator or counter (sensor) additional details are shown in the corresponding tags on the "**Node Description**"
    154153
    155 The upper side tags are used for debugging. It contains **commands** that can be raised manually to the island for testing purposes, **events** receives from WS&AN, and traces of **orders** receives from SENSEI.
     154The upper side tags are used for debugging. It contains **Commands** that can be raised manually to the island for testing purposes, **Events** receives from WS&AN, and traces of **Orders** receives from SENSEI.
    156155
    157156== Troubleshooting ==
    158157**It appears the error message: //"Error while connecting to Zigbee dongle"//:** Ensure that a zigbee dongle is properly inserted in the PC. Ensure that no other application is using the dongle. Remove and insert it again.
    159158
    160 **The gateway do not connect to the Zigbee net:** Ensure that you have enter right extender PAN id, password, and channel frequency.
    161 
    162 **Not all the resources appear in the "tree list":** Ensure you have properly dimensioned the timeout variables in the configuration file according with the nodes latency. It can also happen that nodes have profiles or attributes not recognize by this version of the application.
    163 
    164 **It does not publish the resources in the Resource Directory:** Ensure the proxy variables are properly adjusted depending on your internet connection, and the resource directory URL is properly filled in the configuration file.
     159**The gateway does not connect to the Zigbee net:** Ensure that you have configured the right extender PAN id, password, and channel frequency.
     160
     161**Not all the resources appear in the "tree list":** Ensure that you have properly dimensioned the timeout variables in the configuration file according to the node latency. It can also happen that nodes have profiles or attributes not recognized by this version of the application.
     162
     163**It does not publish the resources in the Resource Directory:** Ensure that the proxy variables are properly adjusted depending on your internet connection, and the resource directory URL is properly filled in the configuration file.
    165164
    166165== Mobility ==
     
    173172
    174173
    175 1. (and 4.) When the node connects to a new island, the gateway forms the Resource End Point of the nodes resources. **Resource identification** formed by the gateway is **always the same** independently of the gateway. The identification depends only on node parameters. In our case it is used the MAC address, that is unique, and the sensor number position.
     1741. (and 4.) When the node connects to a new island, the gateway forms the Resource End Point of the nodes resources. **Resource identification** formed by the gateway is **always the same** independently of the gateway. The identification depends only on node parameters. In our case it is used the node MAC address, that is unique, and the sensor number position.
    1761752. (and 5.) Previously to publish in the Resource Directory, it discovers if the resource is already present using the RLI interface.
    1771763. If the resource does not exist, it is published into the Resource Directory.
    1781774. Node moves to gateway B. See 1
    179 5. Resource is already present. In the response the old gateway URL is obtained.
    180 6. As de resource exists in the Resource Directory, it is updated. No replication of the same resource can be found in the Resource Directory.
    181 7. The new gateway informs the old gateway about the new location (URL) of the resource. In the response, the old gateway sends all the subscriptions information that this resource has, and they are implemented by the new gateway.
     1785. Resource is already present in the Resource Directory. In the response the old gateway URL is obtained.
     1796. As the resource exists in the Resource Directory, it is updated. No duplication of the same resource can be found in the Resource Directory.
     1807. The new gateway informs the old gateway about the new location (URL) of the resource. In the response, the old gateway sends all the subscription information that this resource has, and it is implemented by the new gateway.
    1821818. The old gateway in addition will redirect whatever access to this resource to the new URL using the http redirect response. This redirection is transparent to applications.
    183 The result is that applications do not notice at all (if they do not want) that a resource has been moved.
     182The final result is that applications do not notice at all (if they do not want) that a resource has been moved.
    184183
    185184For optimization, mobility commands interchanged between gateways are not sent at a resource basis, but only once for all the resources of a node.
     
    195194}}}
    196195
    197 In the response, if the credentials are accepted, the old gateway informs about all the subscriptions that the resources of the node contains, with the following:
     196In the response, if the credentials are accepted, the old gateway informs about all the subscriptions that the resources of the node contains, with the following xml format:
    198197{{{
    199198<SubscriptionNodeInfo>
     
    219218
    220219== RAI interface ==
    221 This Gateway creates a REST interface for allowing applications to iterate with the Zigbee island. This interface is defined here (**PUT LINK to the xml specification**).
     220This Gateway creates a REST interface for allowing applications to iterate with the Zigbee island. This interface is defined in [RpObservationMeasurement] (**Check proper LINK to the xml specification TODELETE**).
    222221Each resource has its one URL, with the following format: "//**BASE_URL/nodeMAC/X/number**//"
    223222* //nodeMAC// is the node MAC address in hexadecimal capital letters (16 characters).
     
    227226Over this resource URL the following operations can be done:
    228227* GET http method is used for getting a "xml" with the sensor or actuator value.
    229 * PUT http method is used for changing a value, a parameter, or acting over an actuator.
     228* PUT http method is used for changing a parameter, or acting over an actuator.
    230229
    231230=== Subscriptions ===
    232 A POST http method over the resource URL is used for adding a new subscription. In this the URL must contain at the end of the resource URL the subscription identity: 
    233 "//**BASE_URL/nodeMAC/X/number/SubscriptionID**//". //"SubscriptionID"// is whatever text allowed in the URL names. The xml format for a subscription request is **PUT A LINK TO XML SUBSCRIPTION FORMAT**.
     231A POST http method over the resource URL is used for adding a new subscription. For that, the URL must contain after the resource URL the subscription identity: 
     232"//**BASE_URL/nodeMAC/X/number/SubscriptionID**//". //"SubscriptionID"// is whatever text allowed in the URL names. The xml format for a subscription request is (**PUT A LINK TO XML SUBSCRIPTION FORMAT**).
    234233* A PUT http method over this subscription URL is used for modifying it.
    235234* A GET http method over this subscription URL returns the subscription xml information.
     
    240239
    241240GET over "//**BASE_URL/nodeMAC **//" returns an html page with node information, sensors and actuators, and links for the subscriptions.
    242