Changes between Version 11 and Version 12 of ZigbeeGateway
- Timestamp:
- Sep 28, 2010, 6:58:11 AM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ZigbeeGateway
v11 v12 16 16 17 17 == Installation == 18 There is not an installation package available. To run this software just copy and paste the files contain in the [#Pa kageContent 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]).18 There 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]). 19 19 20 20 === Requirements === 21 21 The package requires: 22 * Windows XP operating system versionor upper.22 * Windows operating system, version XP or upper. 23 23 * No special computer performance requirements are needed. 24 24 * External Hardware: … … 34 34 * //connect.bmb//, //disconnect.bmp//, //linked.bmp//, //sensei.ico// 35 35 * Configuration files: 36 * //ZB2SenseiGW.exe.config//, //rpi.xml// (more configuration files can be added, see [# ConfigurationConfiguration section])36 * //ZB2SenseiGW.exe.config//, //rpi.xml// (more configuration files can be added, see [#rpi.xmlfile Configuration section]) 37 37 * Libraries of Zigbee dongle: 38 38 * //STKUSB.dll//, //ZB.dll// … … 47 47 The 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. 48 48 49 The software engage to the island, discovers nodes, and for each node it discoverssensors and actuators. This software operates under the following Zigbee configuration:49 The 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: 50 50 * It has been tested upon Zigbee 2007. Zigbee Pro should work depending on the Zigbee dongle or concentrator. 51 51 * It is needed to known a priori physical Zigbee parameters: 52 52 * Frequency channel number (11 to 26). 53 53 * Zigbee net password. 54 * extended PAN Identification helps but not needed.54 * Extended PAN Identification helps but not needed. 55 55 * 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. 56 56 57 The Gateway has the following features regarding **Resource End Point implementation**:58 * Allows **publication** of individual resources (sensors and actuators) againsta Resource Directory.57 The Gateway has the following features regarding **Resource End Point (REP) implementation**: 58 * Allows **publication** of individual resources (sensors and actuators) into a Resource Directory. 59 59 * Allows **getting** data from resources and **acting** over them using **RESTful** access. 60 60 * Allows **subscription** to resources. Notification can be requested upon one or several of the following conditions: … … 64 64 * 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. 65 65 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 severalrequests targeting the same resource that arrives at the same time.66 In 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. 67 67 68 68 == Configuration == 69 Two xml files need to be edited for configuring properly the software package before running it. These configuration files allow s 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.69 Two 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 71 Remember that these files are read when application starts. So if you change a value, it will not be considered after restarting the application. 72 72 73 73 It 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. … … 78 78 The "**//Zb2SenseiGw.exe.config//**" file allows establishing: 79 79 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 beEnglish).81 82 "**//AppName//**": Specify the name of the application on es 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 appendbetween 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. 83 83 84 84 "**//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: … … 97 97 "**//netExtPANid//**": target Zigbee extended PAN identifier in hexadecimal format: leave empty for any. (example: "//20DB765432144010//"). 98 98 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 R AI Resource Access Interfaceserver. 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). 102 102 103 103 "**//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. … … 107 107 "**//Sensei_RPI_ExpirationTime//**": Expiration time for each resource published into the Resource Directory, in hours from first publication. If empty, one week will apply. 108 108 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 whilelinking 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 donewhen 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 111 For 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 113 For 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. 116 116 117 117 === rpi.xml file=== 118 118 The **// 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. 119 119 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: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. 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: 121 121 * "//**nodeID**//" is the node MAC address in hexadecimal format, (exactly 16 characters). 122 122 * replace "//**X**//" with "s" for a sensor or "a" for an actuator. 123 123 * "//**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 126 125 In the "**//*.xml //**" file the following text variables will be replaced with the proper values by the application (case sensitive): 127 126 * "//**_ResT**//": name of the resource, for example temperature, light, etc. … … 131 130 * "//**_NUMBER**//": number of the sensor or actuator, starting by 0. If the node contains several, the order of appearance is considered. 132 131 * "//**_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. 134 133 * "//**_ RAI**//": value of the "//Sensei_RPI_RAIBaseURL//" variable of the "//Zb2SenseiGw.exe.config//" file. 135 134 … … 153 152 For every sensor, actuator or counter (sensor) additional details are shown in the corresponding tags on the "**Node Description**" 154 153 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.154 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. 156 155 157 156 == Troubleshooting == 158 157 **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. 159 158 160 **The gateway do not connect to the Zigbee net:** Ensure that you have enterright 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 recognizeby this version of the application.163 164 **It does not publish the resources in the Resource Directory:** Ensure th e 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. 165 164 166 165 == Mobility == … … 173 172 174 173 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.174 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 node MAC address, that is unique, and the sensor number position. 176 175 2. (and 5.) Previously to publish in the Resource Directory, it discovers if the resource is already present using the RLI interface. 177 176 3. If the resource does not exist, it is published into the Resource Directory. 178 177 4. 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 subscription s information that this resource has, and they areimplemented by the new gateway.178 5. Resource is already present in the Resource Directory. In the response the old gateway URL is obtained. 179 6. As the resource exists in the Resource Directory, it is updated. No duplication of the same resource can be found in the Resource Directory. 180 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 subscription information that this resource has, and it is implemented by the new gateway. 182 181 8. 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.182 The final result is that applications do not notice at all (if they do not want) that a resource has been moved. 184 183 185 184 For optimization, mobility commands interchanged between gateways are not sent at a resource basis, but only once for all the resources of a node. … … 195 194 }}} 196 195 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 :196 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 xml format: 198 197 {{{ 199 198 <SubscriptionNodeInfo> … … 219 218 220 219 == 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**).220 This 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**). 222 221 Each resource has its one URL, with the following format: "//**BASE_URL/nodeMAC/X/number**//" 223 222 * //nodeMAC// is the node MAC address in hexadecimal capital letters (16 characters). … … 227 226 Over this resource URL the following operations can be done: 228 227 * 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, aparameter, or acting over an actuator.228 * PUT http method is used for changing a parameter, or acting over an actuator. 230 229 231 230 === 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 ofthe 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**.231 A 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**). 234 233 * A PUT http method over this subscription URL is used for modifying it. 235 234 * A GET http method over this subscription URL returns the subscription xml information. … … 240 239 241 240 GET over "//**BASE_URL/nodeMAC **//" returns an html page with node information, sensors and actuators, and links for the subscriptions. 242