ESP8266 Developer Zone The Official ESP8266 Forum 2017-08-25T16:11:49+08:00 https://bbs.espressif.com:443/feed.php?f=9&t=66 2017-08-25T16:11:49+08:00 2017-08-25T16:11:49+08:00 https://bbs.espressif.com:443/viewtopic.php?t=66&p=15328#p15328 <![CDATA[Re: Illustration: how the ESP-cloud serve your application!!]]>
10.png

Statistics: Posted by clairehouqq — Fri Aug 25, 2017 4:11 pm


]]>
2015-03-06T11:40:08+08:00 2015-03-06T11:40:08+08:00 https://bbs.espressif.com:443/viewtopic.php?t=66&p=941#p941 <![CDATA[Re: Illustration: how the ESP-cloud serve your application!!]]>
Yes, you can.

Please have a try with this mailbox APIs @http://iot.espressif.cn/#/api-en/#api-mbox

Statistics: Posted by ESP_Faye — Fri Mar 06, 2015 11:40 am


]]>
2015-03-02T21:16:49+08:00 2015-03-02T21:16:49+08:00 https://bbs.espressif.com:443/viewtopic.php?t=66&p=869#p869 <![CDATA[Re: Illustration: how the ESP-cloud serve your application!!]]> Statistics: Posted by Amit — Mon Mar 02, 2015 9:16 pm


]]>
2015-01-26T17:31:02+08:00 2015-01-26T17:31:02+08:00 https://bbs.espressif.com:443/viewtopic.php?t=66&p=563#p563 <![CDATA[Re: Illustration: how the ESP-cloud serve your application!!]]>
But your user_esp_platform_recv_cb() receives nothing .. this is a problem ... mine is fine .. did you download the correct master_device_key.bin (@0x3E000) to your ESP8266 board ?

Statistics: Posted by Her Mary — Mon Jan 26, 2015 5:31 pm


]]>
2015-01-23T16:37:37+08:00 2015-01-23T16:37:37+08:00 https://bbs.espressif.com:443/viewtopic.php?t=66&p=543#p543 <![CDATA[Re: Illustration: how the ESP-cloud serve your application!!]]> How to use the RPC example from the iot.espressif.com?
I click the button and and set command always return fail to "{"status":404,"nonce":350361931,"message":"remote device is disconnect or busy"}". but from 8266 end point, there is nothing message receive from the user_esp_platform_recv_cb() and never jump into this callback.

I ever thought this relate to the deep sleep mode as default. actually, I've comment out the deep sleep mode and make the 8266 never disconnect and re-connect with host.

Expect your reply!
Thanks!

Statistics: Posted by okmine — Fri Jan 23, 2015 4:37 pm


]]>
2014-12-04T03:15:41+08:00 2014-12-04T03:15:41+08:00 https://bbs.espressif.com:443/viewtopic.php?t=66&p=243#p243 <![CDATA[Re: Illustration: how the ESP-cloud serve your application!!]]>
koliqi wrote:
Thank you for detailed IoT presentation. Two questions
step2:create a device and get device master key on the cloud side( iot.espressif.com)

does that mean you have created iot.espressif.com english version of iot.espressif.cn ?

2)download the firmware and devicekey

Here is picture of ESP_FLASH_DOWNLOAD_TOOL_V0.9.3.1. This software was published but I can't get it on Downloads section. Did you removed it from public access or maybe I am looking on wrong place?

koliqi


my mistake ,the url is :
iot.espressif.cn

download tool :
viewtopic.php?f=7&t=25

Statistics: Posted by costaud — Thu Dec 04, 2014 3:15 am


]]>
2014-12-04T02:47:09+08:00 2014-12-04T02:47:09+08:00 https://bbs.espressif.com:443/viewtopic.php?t=66&p=242#p242 <![CDATA[Re: Illustration: how the ESP-cloud serve your application!!]]>

step2:create a device and get device master key on the cloud side( iot.espressif.com)

does that mean you have created iot.espressif.com english version of iot.espressif.cn ?

2)download the firmware and devicekey
Image

Here is picture of ESP_FLASH_DOWNLOAD_TOOL_V0.9.3.1. This software was published but I can't get it on Downloads section. Did you removed it from public access or maybe I am looking on wrong place?

koliqi

Statistics: Posted by koliqi — Thu Dec 04, 2014 2:47 am


]]>
2014-12-04T00:06:15+08:00 2014-12-04T00:06:15+08:00 https://bbs.espressif.com:443/viewtopic.php?t=66&p=241#p241 <![CDATA[Illustration: how the ESP-cloud serve your application!!]]>
esp_iot_sdk_v0.9.1_multi-sensor_141204.rar



After we set up the firmware in the chip side, now we can use the esp cloud service to do something wonderful.

See -->http://bbs.espressif.com/viewtopic.php?f=15&t=56
and see ==> viewtopic.php?f=15&t=31

Firstly , this is an illustration to show you how to collect sensor data and upload to the cloud server, moreover, how to get the data and process.


step1: use the sdk sensor demo directly and do some change:
1)change the Datastream name( must accord with the datastream name on the server )
7.png


2)config the demo to sensor and humiture_sub_device
8.png


3)define the deep sleep time (defaultly 30s,that means the device will wake up and send data every 30 seconds)
9.png


step2:create a device and get device master key on the cloud side( iot.espressif.cn)
1)Sign up , login and create a product and define your own device
1.png


2)Choose a new product
2.png


3)Set your device name product type and name, whatever you want. Creat!
3.png


4)Then you have a master device key and now continue to create a datastream format.
In this demo ,we have 4 different sensor( temperature,huminity,pressure,brightness),but we can still define a 5 dimension data format. ( Attention : datastream name must be accord with the name in the sdk sensor showed in pic1.
Create!!
4.png

5.png


step3:download master device key and firmware to the device .
1)Copy the master device key and save as a binary file.
6.png


2)download the firmware and devicekey
13.png


step4: config the device to your AP.
1)connect the device softap and send json config command.
10.png


2)After the device finishing registration ,you can send a sleep command (or change the firmware to sleep automatically)
14.png

11.png


Then the device will send data and get into deep sleep mode in circles.
step5: Enjoy!!!
You can see every post event on the esp cloud side and see the datas in chart.
12.png


click the "share" button , there would be a datapoint chart which shows every detail of the upload data.
15.png


After all ,you can use this python script to collect all the specified data you want.
get_sensor_data.py:

Use the get_test_data function ,
key: replace your own device key
start: set the start time of data
end: set the end time of data,
devCnt : the data point number you want
offset : the page offset from the last data page.



get_test_data(devCnt=100,key='7233680dfbcdf6318f808a998d02bc5d9dee0703',start='2014-12-03 00:00:00',end='2014-12-03 23:59:59',offset=0)

Code:

from datetime import datetime
import os
import binascii
import string
import httplib
import urllib2
import json

DATETIME_FORMAT = '%Y%m%d-%H-%M-%S'
now = datetime.now()
dir_datetime = now.strftime(DATETIME_FORMAT)


def get_test_data(devCnt=10,key='26484cd14129a0c64ed1bf9608fec6cabb0fd0c9',start='',end='',offset=0):
    devices_count =devCnt
    devKey = key
    start_time = start
    end_time   = end
    offset = offset

    host = 'iot.espressif.cn'
    headers = {'Host': host, 'User-Agent': 'Mozilla', 'Accept': '*/*', 'Authorization': 'token %s'%devKey}
    devices_serial = ['{}']*devices_count
    print 'devices_serial: ',devices_serial
   
    params = None#'{"debugs": ['+ ','.join(devices_serial) + ']}'
    #print 'params : ',params
    if start_time=='':
        path = '/v1/datastreams/sensor_data_point/datapoints/?row_count=%d'%devices_count
    elif offset == 0:
        path = '/v1/datastreams/sensor_data_point/datapoints/?row_count=%d&start=%s&end=%s'%(devices_count ,start_time,end_time)
    else:
        path = '/v1/datastreams/sensor_data_point/datapoints/?row_count=%d&start=%s&end=%s&offset=%d'%(devices_count ,start_time,end_time,offset)
    conn = httplib.HTTPConnection(host, port=80)
    conn.request("GET", path, params, headers)
    response = conn.getresponse()
    data = response.read()
    conn.close()

    total_data_dict = json.loads(data)

    time_list=[]
    tem_list=[]
    hum_list=[]
    pres_list=[]
    lumen_list=[]
   
    for dict_tmp in total_data_dict["datapoints"]:
        time_list.append( dict_tmp["updated"] )
        tem_list.append( dict_tmp['x'])
        hum_list.append( dict_tmp['y'])
        pres_list.append( dict_tmp['z'])
        lumen_list.append( dict_tmp['k'])
       
    print "time: ",time_list
    print "temperature : 'C\n",tem_list
    print "r-huminity  : % \n",hum_list
    print "pressure    : hPa \n",pres_list
    print "luminance  : Lx \n",lumen_list
   
   
   
   



if __name__ == '__main__':
    get_test_data(devCnt=50,key='7233680dfbcdf6318f808a998d02bc5d9dee0703',start='2014-12-03 00:00:00',end='2014-12-03 23:59:59',offset=0)


result:

Code:

time:  [u'2014-12-03 23:40:14', u'2014-12-03 23:39:44', u'2014-12-03 23:39:13', u'2014-12-03 23:38:43', u'2014-12-03 23:38:13', u'2014-12-03 23:37:42', u'2014-12-03 23:37:12', u'2014-12-03 23:36:41', u'2014-12-03 23:36:11', u'2014-12-03 23:35:40', u'2014-12-03 23:35:11', u'2014-12-03 23:34:39', u'2014-12-03 23:34:09', u'2014-12-03 23:33:38', u'2014-12-03 23:33:08', u'2014-12-03 23:32:37', u'2014-12-03 23:32:02', u'2014-12-03 23:31:32', u'2014-12-03 23:31:01', u'2014-12-03 23:30:31', u'2014-12-03 23:29:56', u'2014-12-03 23:29:25', u'2014-12-03 23:28:55', u'2014-12-03 23:28:25', u'2014-12-03 23:27:54', u'2014-12-03 23:27:23', u'2014-12-03 23:26:53', u'2014-12-03 23:26:23', u'2014-12-03 23:25:52', u'2014-12-03 23:25:22', u'2014-12-03 23:24:51', u'2014-12-03 23:24:20', u'2014-12-03 23:23:50', u'2014-12-03 23:23:19', u'2014-12-03 23:22:49', u'2014-12-03 23:22:19', u'2014-12-03 23:21:48', u'2014-12-03 23:21:18', u'2014-12-03 23:20:47', u'2014-12-03 23:20:17', u'2014-12-03 23:19:47', u'2014-1
2-03 23:19:17', u'2014-12-03 23:18:45', u'2014-12-03 23:18:15', u'2014-12-03 23:17:45', u'2014-12-03 23:17:14', u'2014-12-03 23:16:44', u'2014-12-03 23:16:13', u'2014-12-03 23:15:43', u'2014-12-03 23:15:12']
temperature : 'C
[20.300000000000001, 20.300000000000001, 20.34, 20.449999999999999, 20.469999999999999, 20.530000000000001, 20.579999999999998, 20.800000000000001, 20.690000000000001, 20.57, 20.309999999999999, 20.27, 20.25, 20.280000000000001, 20.280000000000001, 20.280000000000001, 20.390000000000001, 20.379999999999999, 20.41, 20.34, 20.379999999999999, 20.32, 20.41, 20.100000000000001, 20.030000000000001, 20.02, 20.030000000000001, 20.059999999999999, 20.129999999999999, 20.140000000000001, 19.989999999999998, 19.870000000000001, 19.84, 19.84, 19.879999999999999, 19.879999999999999, 19.949999999999999, 19.98, 20.02, 20.07, 20.129999999999999, 20.18, 20.199999999999999, 20.23, 20.100000000000001, 20.07, 19.940000000000001, 19.870000000000001, 19.870000000000001, 19.870000000000001]
r-huminity  : %
[61.159999999999997, 61.200000000000003, 61.200000000000003, 61.240000000000002, 61.240000000000002, 61.240000000000002, 61.140000000000001, 60.840000000000003, 61.280000000000001, 61.520000000000003, 61.469999999999999, 61.689999999999998, 61.670000000000002, 61.859999999999999, 61.829999999999998, 61.969999999999999, 61.710000000000001, 61.520000000000003, 61.280000000000001, 61.890000000000001, 61.780000000000001, 61.829999999999998, 61.560000000000002, 62.119999999999997, 61.780000000000001, 61.57, 60.68, 60.030000000000001, 59.829999999999998, 59.869999999999997, 60.119999999999997, 60.170000000000002, 60.189999999999998, 60.090000000000003, 59.869999999999997, 59.869999999999997, 59.729999999999997, 59.579999999999998, 59.460000000000001, 59.359999999999999, 59.270000000000003, 59.119999999999997, 59.130000000000003, 59.090000000000003, 59.25, 59.280000000000001, 59.420000000000002, 59.43, 59.350000000000001, 59.240000000000002]
pressure    : hPa
[1024.79, 1024.73, 1024.6099999999999, 1024.53, 1024.3499999999999, 1024.51, 1024.45, 1024.4100000000001, 1024.3699999999999, 1024.3299999999999, 1024.3499999999999, 1024.4100000000001, 1024.55, 1024.49, 1024.5899999999999, 1024.6099999999999, 1024.71, 1024.71, 1024.8299999999999, 1024.9100000000001, 1024.9100000000001, 1025.0899999999999, 1025.1500000000001, 1025.1700000000001, 1025.2, 1025.26, 1025.4200000000001, 1025.3599999999999, 1025.48, 1025.5599999999999, 1025.5599999999999, 1025.5599999999999, 1025.6400000000001, 1025.7, 1025.7, 1025.78, 1025.78, 1025.74, 1025.9200000000001, 1025.8599999999999, 1025.8399999999999, 1025.9200000000001, 1025.9200000000001, 1025.9200000000001, 1025.9400000000001, 1025.8800000000001, 1025.9200000000001, 1025.8800000000001, 1026.0799999999999, 1025.96]
luminance  : Lx
[907.0, 907.0, 887.0, 910.0, 903.0, 893.0, 897.0, 917.0, 917.0, 910.0, 917.0, 873.0, 907.0, 913.0, 920.0, 907.0, 920.0, 920.0, 930.0, 923.0, 920.0, 913.0, 917.0, 930.0, 930.0, 943.0, 947.0, 957.0, 883.0, 883.0, 893.0, 900.0, 900.0, 883.0, 897.0, 883.0, 887.0, 890.0, 883.0, 883.0, 883.0, 900.0, 893.0, 883.0, 883.0, 890.0, 883.0, 897.0, 887.0, 880.0]

Statistics: Posted by costaud — Thu Dec 04, 2014 12:06 am


]]>