55 | | * Not all the Zigbee profiles are detected. It have been tested under temperature, light, human presence, acceleration sensors and electricity on/off actuator. |
56 | | |
57 | | The Gateway has the following features regarding Resource End Point implementation |
58 | | * Allows **publication** against a Resource Directory |
59 | | * Allows **getting** data from sensor and **acting** over an actuator using **RESTful** access |
| 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 | |
| 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. |
| 59 | * Allows **getting** data from resources and **acting** over them using **RESTful** access. |
61 | | * Periodic time. If active, it sends a new notification after the period time passes without having sent a notification. |
62 | | * Value change. If active, it sends a notification when detected that the value has changed |
63 | | * Threshold. When the value goes beyond a threshold a notification is sent. |
64 | | * Allows **mobility**. Several gateways can be located in the vicinity and in case the Zigbee island allows nodes to move, both gateway communicates each other to properly handle the mobility. |
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 requests targeting the same resource that arrives in a short period of time. |
67 | | |
68 | | |
| 61 | * **Periodic time**. If active, it sends a new notification after "period time" passes without having sent a notification. |
| 62 | * **Value change**. If active, it sends a notification when detected that the value has changed. |
| 63 | * **Threshold**. When the value goes beyond a threshold a notification is sent. |
| 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 | |
| 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. |
75 | | 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 manual before proceed to edit the files. |
76 | | |
77 | | Do not worry if you are not familiar with **xml basis**. Look for the target name that follow "//key=//", and you must **edit only** the text between double apostrophes after the "//value=//" text. |
| 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. |
| 74 | |
| 75 | Do not worry if you are not familiar with **xml basis**. Look for the target name that follow the text "//key=//", and you must **edit only** the text between double apostrophes after the "//value=//" text. |
99 | | "**//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 "/". "//myIP//" text will be replaced by first real computer IP address. If the computer has several IP address and you want to use another, put it explicitly. Each resource is acceded throw BaseURL/ //nodeID/[s or a]/number // (see [RaiInterface RAI Interface] for more details). |
100 | | |
101 | | "**//Sensei_RPI_URL//**": SENSEI Target Resource Directory URL for Publishing. Leave Empty for not publishing resources into Resource Directory. End with "/". Application will add "rpi", "rli" or "rd" suffix when needed. For example "//http://sensei-dev1.grid.pub.ro:8184/ //". |
102 | | |
103 | | "**//Sensei_RPI_RAIBaseURL//**": URL published in "<Rai-Description> <REP-Locator>" into Resource Directory for each resource. If empty it will take Sensei_RAI_BaseURL, but it can be different if needed for example if the gateway access through a proxy or a router that changes the local IP into a public IP. End with "/". Application will append "//nodeID/[s or a]/number//" to this URL. "//myIP//" text will be replaced by first real computer IP address. |
104 | | |
105 | | "**//Sensei_RPI_ExpirationTime//**": Expiration date for each resource published into the Resource Directory, in hours from first publication. If empty, one week will apply. |
| 97 | "**//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). |
| 98 | |
| 99 | "**//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. |
| 100 | |
| 101 | "**//Sensei_RPI_URL//**": Target SENSEI Resource Directory URL for publishing. Leave Empty for not publishing resources into Resource Directory. End always with "/". Application will add "rpi", "rli" or "rd" suffix when needed. For example "//http://sensei-dev1.grid.pub.ro:8184/ //". |
| 102 | |
| 103 | "**//Sensei_RPI_ExpirationTime//**": Expiration time for each resource published into the Resource Directory, in hours from first publication. If empty, one week will apply. |
110 | | The **// rpi.xml //** file indicates what exactly format should be sent to the resource directory for publishing a resource. In that way format can be completely changed for new versions without the need of compilation. |
111 | | |
112 | | In addition "**// rpi.xml //**" is a generic file for all the resources, but you can specify individual files for each resource. Simple insert a file with the same structure in the package directory and with the name equals to "//**nodeID**s**number.xml**//" for a sensor or "//**nodeID**a**number**.xml//" for an actuator. Where "//**nodeID**//" is the node MAC address in hexadecimal format, (16 characters), and "//**number**//" is the index of the sensor or actuator starting by 0. If an individual file is present it will be considered, if not, the generic one is considered. |
113 | | |
114 | | The "**//*.xml //**" file can include the following text variables that will be replaced with the proper values by the application (case sensitive): |
| 114 | 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. |
| 115 | |
| 116 | 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: |
| 117 | * "//**nodeID**//" is the node MAC address in hexadecimal format, (exactly 16 characters). |
| 118 | * replace "//**X**//" with "s" for a sensor or "a" for an actuator. |
| 119 | * "//**number**//" is the index of the sensor or actuator starting by 0. |
| 120 | If an individual file is presented it will be considered, if not the generic "rpi.xml" file is considered. |
| 121 | |
| 122 | In the "**//*.xml //**" file the following text variables will be replaced with the proper values by the application (case sensitive): |
127 | | [[Image(zb2senseigw_connection.JPG, 50%, center)]] |
128 | | On the upper side, appears the type of connection to the Zigbee island. The "**USB**" is through a dongle and the "**IP**" through an external concentrator. The "**IP/Ch**" select box contains the Zigbee channel for USB or the connection name (see [#Configuration <netConn> idNet in Configuration]) for IP. The button "**Connect**" and "**Disconnect**" allows to attach or detach to the Zigbee island. |
| 135 | [[Image(zb2senseigw_mainsreen.jpg, 50%, center)]] |
| 136 | |
| 137 | |
| 138 | On the upper side, appears the type of connection to the Zigbee island. The "**USB**" is through a dongle and the "**IP**" through an external concentrator. The "**IP/Ch**" select box contains the Zigbee channel for USB or the connection name (see [#Zb2SenseiGw.exe.config <netConn> idNet in Configuration]) for IP. The button "**Connect**" and "**Disconnect**" starts the attaching or detaching to the Zigbee island. |
160 | | 1. (and 4.) 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 and the sensor number position. When the node connects to a new island, the gateway forms the Resource End Point of the nodes resources. |
161 | | 2. (and 5.) Previously to publish in the Resource Directory, it discovers if the resource already is present using RLI interface. |
162 | | 3. If the resource does not exist, it is published into the Resource Directory … |
163 | | 4. see 1 |
164 | | 5. see 2 |
165 | | 6. But if it exists, it is updated. No replication of the same resource is found in the Resource Directory. |
166 | | 7. The new gateway informs the old gateway about the new location (URL) of the resource. The URL of the old gateway is obtained when getting resource parameters from the Resource Directory (5.) In the response, the old gateway sends all the subscriptions information that this resource has, and these are implemented by the new gateway. |
| 171 | 1. (and 4.) **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 and the sensor number position. When the node connects to a new island, the gateway forms the Resource End Point of the nodes resources. |
| 172 | 2. (and 5.) Previously to publish in the Resource Directory, it discovers if the resource is already present using the RLI interface. |
| 173 | 3. If the resource does not exist, it is published into the Resource Directory. |
| 174 | 4. Node moves to gateway B. See 1 |
| 175 | 5. See 2 |
| 176 | 6. But if the resource exists in the Resource Directory, it is updated. No replication of the same resource can be found in the Resource Directory. |
| 177 | 7. The new gateway informs the old gateway about the new location (URL) of the resource. The URL of the old gateway is obtained when consulting the Resource Directory (5.) In the response, the old gateway sends all the subscriptions information that this resource has, and these are implemented by the new gateway. |
214 | | A POST http method over the resource URL is used for adding a new subscription. In this case it should be add at the end of the resource URL the subscription identity: |
215 | | "//**BASE_URL/nodeMAC/X/number/SubscriptionID**//" |
216 | | * SubscriptionID is whatever text allowed in the URL names. The xml format for a subscription is **PUT A LINK TO XML SUBSCRIPTION FORMAT** |
217 | | |
218 | | A PUT http method over this subscription URL is used for modify it. |
219 | | A GET http method over this subscription URL returns the subscription xml information. |
220 | | A DELETE http method over this subscription URL is used for deleting it. |
221 | | A POST http method over this subscription URL returns an error. |
222 | | |
223 | | GET over "//**BASE_URL/nodeMAC/X/number?Subscription**//" for getting the list of subscriptions of a resource. |
224 | | GET over "//**BASE_URL/nodeMAC **//" returns an html page with node information, sensors and actuators, and links for the subscriptions. Ideally for a browser |
225 | | |
226 | | |
227 | | |
228 | | |
229 | | |
230 | | |
| 228 | 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: |
| 229 | "//**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**. |
| 230 | * A PUT http method over this subscription URL is used for modifying it. |
| 231 | * A GET http method over this subscription URL returns the subscription xml information. |
| 232 | * A DELETE http method over this subscription URL is used for deleting it. |
| 233 | * A POST http method over this subscription URL returns an error if it exist or add a new subscription if it does not exist. |
| 234 | |
| 235 | GET over "//BASE_URL/nodeMAC/X/number**?Subscription**//" can be used for getting the list of subscriptions of a resource. |
| 236 | |
| 237 | GET over "//**BASE_URL/nodeMAC **//" returns an html page with node information, sensors and actuators, and links for the subscriptions. |
| 238 | |
| 239 | |