Xively Demo with WizFi250
Let me introduce the “Xively server and WizFi250 application note.
In order to Test, the customer should make a Xively ID and acquire Channel and API key.
(For more information about the Xively, Please check the Youtube or Google)
This test environment is as below
•Feed ID : 1805123826
•X-ApiKey : H3lr9T1As7ADOfpXCvg8fdcUYC3wX39tXVUBGAIKvouibJnM
•Channel : Demo
Test Procedure
(A) The local data save to Xively Cloud
(B) The Data receive form Xively Cloud
Let’s start Demo
(A) Request Raw Data: the temporary 4 byte data save to Xively cloud
PUT /v2/feeds/1805123826/datastreams/Demo HTTP/1.1\r\n
Host: api.xively.com\r\n
X-ApiKey: H3lr9T1As7ADOfpXCvg8fdcUYC3wX39tXVUBGAIKvouibJnM\r\n
Content-Length:81\r\n
\r\n
{\r\n
"id": "Demo",\r\n
"tags": [],\r\n
"unit": {},\r\n
"current_value": "4"\r\n
}\r\n
\r\n
\r\n
(Total 236 Byte)
(B) Request Raw Data : The Data receive form Xively cloud
GET /v2/feeds/1805123826/datastreams/Demo HTTP/1.1\r\n
Host: api.xively.com\r\n
X-ApiKey: H3lr9T1As7ADOfpXCvg8fdcUYC3wX39tXVUBGAIKvouibJnM\r\n
\r\n
(Total 136 Byte)
In order to use Xively server communication, you should associate with AP.
(It is depends on your test AP environment. Therefore we omission this parts.
Please refer to as below link
u Step #1: Obtain the Xively API sever IP
AT+FDNS=api.xively.com,3000
64.94.18.120
[OK]
u Step #2: Access the the Xively API sever, and then send the Request command that save the value “4” in the Channel Demo
AT+SCON=O,TCN,64.94.18.120,80,,0
[OK]
[CONNECT 0]
AT+SSEND=PUT /v2/feeds/1805123826/datastreams/Demo HTTP/1.1\r\n
Host: api.xively.com\r\n
X-ApiKey: H3lr9T1As7ADOfpXCvg8fdcUYC3wX39tXVUBGAIKvouibJnM\r\n
Content-Length:81\r\n
\r\n
{\r\n
"id": "Demo",\r\n
"tags": [],\r\n
"unit": {},\r\n
"current_value": "4"\r\n
}\r\n
\r\n
\r\n
[OK]
If you send correctly a data, you should be receive from the Xively API server
{0,64.94.18.120,80,251}HTTP/1.1 200 OK
Date: Wed, 06 Aug 2014 03:52:05 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 0
Connection: keep-alive
X-Request-Id: 65d5981411f55879f102ebd8df82e4c2978cfac1
Cache-Control: max-age=0
Vary: Accept-Encoding
u STEP #3: Close the connection the Xveily API Sever
AT+SMGMT=ALL
[DISCONNECT 0]
[OK]
when you see the Feed Channel, you should find a data to apply real time in Xively API server.
Next, we’re trying to get the data from Xively cloud server.
Refer to as below command
AT+SCON=O,TCN,64.94.18.120,80,,0
[OK]
[CONNECT 0]
AT+SSEND= GET /v2/feeds/1805123826/datastreams/Demo HTTP/1.1\r\n
Host: api.xively.com\r\n
X-ApiKey: H3lr9T1As7ADOfpXCvg8fdcUYC3wX39tXVUBGAIKvouibJnM\r\n
\r\n
[OK]
{0,64.94.18.120,80,441}HTTP/1.1 200 OK
Date: Wed, 06 Aug 2014 03:52:18 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 122
Connection: keep-alive
X-Request-Id: 749920b4abcd6c4f6953906d14b4204002ae42be
Cache-Control: max-age=86400
Vary: Accept-Encoding
{"id":"Demo","current_value":"4","at":"2014-08-06T03:52:05.847187Z","max_value":"7.0","min_value":"0.0","version":"1.0.0"}
AT+SMGMT=ALL
[DISCONNECT 0]
[OK]
Notice:
Please refer to as below link.
This link explain How to connect between the temperature sense and the Xively API sever