【Feedback】已经注册云端服务,并获取到 master_device_key.bin, 手机安装 相应的 .apk,如何通过云端控制ESP8266

dearwind153
Posts: 49
Joined: Sun Feb 28, 2016 7:47 pm

【Feedback】已经注册云端服务,并获取到 master_device_key.bin, 手机安装 相应的 .apk,如何通过云端控制ESP8266

Postby dearwind153 » Thu Mar 03, 2016 10:51 pm

1. 已经参考 http://my.oschina.net/u/2327133/blog/388092 注册云端服务

2. 使用 SDK1.5.0 的example IoT_Demo例程编译发现一个问题

2.1 如果将 IoT_Demo 目录下的全部内容拷贝到 app 下,make 是 可以编译完成
2.2 如果 执行 ./gen_misc.sh,编译时会一直死循环编译如下图

Code: Select all

esp8266@esp8266-VirtualBox:/mnt/Share/ESP8266_NONOS_SDK_V1.5.1_16_01_08/esp_iot_sdk_v1.5.1/app$ ./gen_misc.sh
gen_misc.sh version 20150511

Please follow below steps(1-5) to generate specific bin(s):
STEP 1: choose boot version(0=boot_v1.1, 1=boot_v1.2+, 2=none)
enter(0/1/2, default 2):
2
boot mode: none

STEP 2: choose bin generate(0=eagle.flash.bin+eagle.irom0text.bin, 1=user1.bin, 2=user2.bin)
enter (0/1/2, default 0):
0
generate bin: eagle.flash.bin+eagle.irom0text.bin

STEP 3: choose spi speed(0=20MHz, 1=26.7MHz, 2=40MHz, 3=80MHz)
enter (0/1/2/3, default 2):
2
spi speed: 40 MHz

STEP 4: choose spi mode(0=QIO, 1=QOUT, 2=DIO, 3=DOUT)
enter (0/1/2/3, default 0):
0
spi mode: QIO

STEP 5: choose spi size and map
    0= 512KB( 256KB+ 256KB)
    2=1024KB( 512KB+ 512KB)
    3=2048KB( 512KB+ 512KB)
    4=4096KB( 512KB+ 512KB)
    5=2048KB(1024KB+1024KB)
    6=4096KB(1024KB+1024KB)
enter (0/2/3/4/5/6, default 0):
2
spi size: 1024KB
spi ota map:  512KB + 512KB


start...

make[1]: Entering directory `/mnt/Share/ESP8266_NONOS_SDK_V1.5.1_16_01_08/esp_iot_sdk_v1.5.1/app/user'
DEPEND: xtensa-lx106-elf-gcc -M -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -I include -I ./ -I ../../include/ets -I ../include -I ../../include -I ../../include/eagle user_webserver.c
DEPEND: xtensa-lx106-elf-gcc -M -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -I include -I ./ -I ../../include/ets -I ../include -I ../../include -I ../../include/eagle user_sensor.c
DEPEND: xtensa-lx106-elf-gcc -M -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -I include -I ./ -I ../../include/ets -I ../include -I ../../include -I ../../include/eagle user_plug.c
DEPEND: xtensa-lx106-elf-gcc -M -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -I include -I ./ -I ../../include/ets -I ../include -I ../../include -I ../../include/eagle user_main.c
DEPEND: xtensa-lx106-elf-gcc -M -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -I include -I ./ -I ../../include/ets -I ../include -I ../../include -I ../../include/eagle user_light.c
DEPEND: xtensa-lx106-elf-gcc -M -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -I include -I ./ -I ../../include/ets -I ../include -I ../../include -I ../../include/eagle user_light_adj.c
DEPEND: xtensa-lx106-elf-gcc -M -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -I include -I ./ -I ../../include/ets -I ../include -I ../../include -I ../../include/eagle user_json.c
DEPEND: xtensa-lx106-elf-gcc -M -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -I include -I ./ -I ../../include/ets -I ../include -I ../../include -I ../../include/eagle user_esp_platform_timer.c
DEPEND: xtensa-lx106-elf-gcc -M -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -I include -I ./ -I ../../include/ets -I ../include -I ../../include -I ../../include/eagle user_esp_platform.c
DEPEND: xtensa-lx106-elf-gcc -M -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -I include -I ./ -I ../../include/ets -I ../include -I ../../include -I ../../include/eagle user_devicefind.c
make[1]: Leaving directory `/mnt/Share/ESP8266_NONOS_SDK_V1.5.1_16_01_08/esp_iot_sdk_v1.5.1/app/user'
make[1]: Entering directory `/mnt/Share/ESP8266_NONOS_SDK_V1.5.1_16_01_08/esp_iot_sdk_v1.5.1/app/user'
DEPEND: xtensa-lx106-elf-gcc -M -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -I include -I ./ -I ../../include/ets -I ../include -I ../../include -I ../../include/eagle user_main.c
make[1]: Leaving directory `/mnt/Share/ESP8266_NONOS_SDK_V1.5.1_16_01_08/esp_iot_sdk_v1.5.1/app/user'
make[1]: Entering directory `/mnt/Share/ESP8266_NONOS_SDK_V1.5.1_16_01_08/esp_iot_sdk_v1.5.1/app/user'
DEPEND: xtensa-lx106-elf-gcc -M -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -I include -I ./ -I ../../include/ets -I ../include -I ../../include -I ../../include/eagle user_main.c
make[1]: Leaving directory `/mnt/Share/ESP8266_NONOS_SDK_V1.5.1_16_01_08/esp_iot_sdk_v1.5.1/app/user'
make[1]: Entering directory `/mnt/Share/ESP8266_NONOS_SDK_V1.5.1_16_01_08/esp_iot_sdk_v1.5.1/app/user'
DEPEND: xtensa-lx106-elf-gcc -M -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -I include -I ./ -I ../../include/ets -I ../include -I ../../include -I ../../include/eagle user_main.c
make[1]: Leaving directory `/mnt/Share/ESP8266_NONOS_SDK_V1.5.1_16_01_08/esp_iot_sdk_v1.5.1/app/user'
make[1]: Entering directory `/mnt/Share/ESP8266_NONOS_SDK_V1.5.1_16_01_08/esp_iot_sdk_v1.5.1/app/user'
DEPEND: xtensa-lx106-elf-gcc -M -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -I include -I ./ -I ../../include/ets -I ../include -I ../../include -I ../../include/eagle user_main.c
make[1]: Leaving directory `/mnt/Share/ESP8266_NONOS_SDK_V1.5.1_16_01_08/esp_iot_sdk_v1.5.1/app/user'
make[1]: Entering directory `/mnt/Share/ESP8266_NONOS_SDK_V1.5.1_16_01_08/esp_iot_sdk_v1.5.1/app/user'
DEPEND: xtensa-lx106-elf-gcc -M -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -I include -I ./ -I ../../include/ets -I ../include -I ../../include -I ../../include/eagle user_main.c
make[1]: Leaving directory `/mnt/Share/ESP8266_NONOS_SDK_V1.5.1_16_01_08/esp_iot_sdk_v1.5.1/app/user'
make[1]: Entering directory `/mnt/Share/ESP8266_NONOS_SDK_V1.5.1_16_01_08/esp_iot_sdk_v1.5.1/app/user'
DEPEND: xtensa-lx106-elf-gcc -M -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLASH -I include -I ./ -I ../../include/ets -I ../include -I ../../include -I ../../include/eagle user_main.c


3. 手机端安装对应的http://shouji.baidu.com/software/item?docid=7580135&from=as APK应用

4. 手机配置设备 推送 SSID 和 password,从设备的打印监控来看,设备已经连接到云端

Code: Select all

ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x40100000, len 29468, room 16
tail 12
chksum 0x0c
ho 0 tail 12 room 4
load 0x3ffe8000, len 2936, room 12
tail 12
chksum 0x47
ho 0 tail 12 room 4
load 0x3ffe8b80, len 3780, room 12
tail 8
chksum 0x55
csum 0x55
犟+P禇h〥r
SDK ver: 1.5.1(e67da894) compiled @ Jan  7 2016 18:44:54
phy ver: 484, pp ver: 9.6

SDK version:1.5.1(e67da894)
IOT VERSION = v1.0.5t45772(a)
reset reason: 6
LIGHT PARAM: R: 1431183461
LIGHT PARAM: G: 168643660
LIGHT PARAM: B: 0
LIGHT PARAM: CW: 29477
LIGHT PARAM: WW: 29477
LIGHT PARAM: P: 1000
malloc:1
prd:1000  r : 22222  g: 22222  b: 0  cw: 22222  ww: 22222
free:0
PWM version : 00000003
mode : sta(5c:cf:7f:0c:1b:01) + softAP(5e:cf:7f:0c:1b:01)
add if0
add if1
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
bcn 100
finish
add 1
aid 1
station: 58:44:98:fa:97:87 join, AID = 1
len:282
A_dat:139,tot:139,lenght:139
We have a POST request.
webserver's 192.168.4.2:37606 disconnect
f r0, scandone
state: 0 -> 2 (b0)
station: 58:44:98:fa:97:87 leave, AID = 1
rm 1
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 3
cnt

connected with MERCURY-JQY, channel 6
dhcp client start...
ip:192.168.1.110,mask:255.255.255.0,gw:192.168.1.1
host_name = espressif_light_demo
server_name = _espLight._tcp.local
user_esp_platform_dns_found 115.29.202.58
user_esp_platform_connect
user_esp_platform_connect_cb
bcn 0
del if1
pm open,type:2 0
mode : sta(5c:cf:7f:0c:1b:01)
{"nonce": 1731464645,"path": "/v1/device/activate/", "method": "POST", "body": {"encrypt_method": "PLAIN", "token": "vfzzuj2zh19uva31bk70mx5qeh2sjwad3iavfhb6", "bssid": "5c:cf:7f:0c:1b:01","rom_version":"v1.0.5t45772(a)"}, "meta": {"Authorization": "token 2f190a696181213928f24a38074c69bd6723410b"}}

user_esp_platform_sent_cb
user_esp_platform_recv_cb {"nonce": 1731464645, "status": 200, "mdev_mac": "5CCF7F0C1B01", "token": {"datastream_id": 0, "updated": "2016-03-03 22:13:40", "user_id": 5198, "name": "owner key", "created": "2016-03-03 22:13:40", "generated_at": "2016-03-03 22:13:40", "source_ip": "*", "visibly": 1, "delete_after_used": 0, "datastream_tmpl_id": 0, "token": "vfzzuj2zh19uva31bk70mx5qeh2sjwad3iavfhb6", "activate_status": 1, "is_owner_key": 1, "revoke_prekeys_if_ownerkey": 1, "access_methods": "*", "token_expired_at": "2016-03-03 22:23:40", "scope": 3, "expired_at": "2289-12-17 22:13:40", "product_id": 0, "id": 119091, "device_id": 123516}, "key": {"updated": "2016-03-03 20:18:28", "user_id": 5198, "name": "device key", "created": "2016-03-03 20:18:28", "source_ip": "*", "level": 0, "is_master_key": 1, "visibly": 1, "datastream_id": 0, "datastream_tmpl_id": 0, "token": "2f190a696181213928f24a38074c69bd6723410b", "activate_status": 1, "is_owner_key": 0, "access_methods": "*", "authorized_user_id": 0, "scope": 3, "expired_at": "2289-12-17 20:18:28", "product_id": 0, "id": 143257, "device_id": 123516}, "device": {"productbatch_id": 0, "bssid": "5c:cf:7f:0c:1b:01", "ptype": 45772, "activate_status": 1, "serial": "7bd951a9", "id": 123516, "description": "desc-7bd951a9", "last_active": "2016-03-03 20:18:28", "rom_version": "v1.0.5t45772(a)", "last_pull": "2016-03-03 20:18:28", "last_push": "2016-03-03 20:18:28", "location": "", "last_activated_at": "2016-
device activates successful.
{"nonce": 2134232791, "path": "/v1/device/identify", "method": "GET","meta": {"Authorization": "token 2f190a696181213928f24a38074c69bd6723410b"}}

state: 5 -> 0 (0)
rm 0
pm close 7
del if0
usl
user_esp_platform_recon_cb
*r吥P钡盞韙r@轾.┭Ko8a 晟*盩北暴┠P郛盄睐*眳ⅫnzA瑝8x簐A,PZ!(A{~An 晟*盧北@j|紷睐*ⅫnzA瑝8x簐A,T%!(A{~An 晟*盧ケ@j|蹬,@睐*ⅫnzAl )閙~盫%醨眀夬犟+P禇h〥r
SDK ver: 1.5.1(e67da894) compiled @ Jan  7 2016 18:44:54
phy ver: 484, pp ver: 9.6

SDK version:1.5.1(e67da894)
IOT VERSION = v1.0.5t45772(a)
reset reason: 4
LIGHT PARAM: R: 1431183461
LIGHT PARAM: G: 168643660
LIGHT PARAM: B: 0
LIGHT PARAM: CW: 29477
LIGHT PARAM: WW: 29477
LIGHT PARAM: P: 1000
malloc:1
prd:1000  r : 22222  g: 22222  b: 0  cw: 22222  ww: 22222
free:0
PWM version : 00000003
mode : sta(5c:cf:7f:0c:1b:01)
add if0
f r0, finish
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 3
cnt

connected with MERCURY-JQY, channel 6
dhcp client start...
ip:192.168.1.110,mask:255.255.255.0,gw:192.168.1.1
host_name = espressif_light_demo
server_name = _espLight._tcp.local
user_esp_platform_dns_found 115.29.202.58
user_esp_platform_connect
user_esp_platform_connect_cb
{"nonce": 1082095088, "path": "/v1/device/identify", "method": "GET","meta": {"Authorization": "token 2f190a696181213928f24a38074c69bd6723410b"}}

user_esp_platform_sent_cb
user_esp_platform_recv_cb {"nonce": 1082095088, "status": 200, "mdev_mac": "5CCF7F0C1B01", "datetime": "2016-03-03 22:13:44", "device": {"productbatch_id": 0, "bssid": "5c:cf:7f:0c:1b:01", "ptype": 45772, "activate_status": 1, "serial": "7bd951a9", "id": 123516, "latest_rom_version": "", "last_active": "2016-03-03 20:18:28", "rom_version": "v1.0.5t45772(a)", "last_pull": "2016-03-03 20:18:28", "last_push": "2016-03-03 20:18:28", "location": "", "last_activated_at": "2016-03-03 22:13:40", "metadata": "", "status": 1, "updated": "2016-03-03 22:13:40", "description": "desc-7bd951a9", "activated_at": "2016-03-03 22:13:40", "visibly": 1, "is_private": 0, "product_id": 2368, "name": "light-001", "created": "2016-03-03 20:18:28", "is_frozen": 0, "key_id": 143257}, "message": "device identified"}

{"body": {}, "get":{"is_humanize_format_simple":"true"},"meta": {"Authorization": "Token 2f190a696181213928f24a38074c69bd6723410b"},"path": "/v1/device/timers/","post":{},"method": "GET"}

user_esp_platform_sent_cb
user_esp_platform_recv_cb {"status": 200, "mdev_mac": "5CCF7F0C1B01", "weekday_timestamp_mod": 339224, "timestamp": 1457014424, "timers": "", "weekday": 4, "now": "2016-03-03 22:13:44"}

pm open,type:2 0
user_esp_platform_sent_beacon 54025607
user_esp_platform_sent_cb
user_esp_platform_recv_cb {"status": 200, "epoch": 1457014474, "mdev_mac": "5CCF7F0C1B01", "message": "ping success", "datetime": "2016-03-03 22:14:34"}

ping success
I'm Light.5c:cf:7f:0c:1b:01 192.168.1.110
I'm Light.5c:cf:7f:0c:1b:01 192.168.1.110
I'm Light.5c:cf:7f:0c:1b:01 192.168.1.110
user_esp_platform_sent_beacon 104081566
user_esp_platform_sent_cb
user_esp_platform_recv_cb {"status": 200, "epoch": 1457014524, "mdev_mac": "5CCF7F0C1B01", "message": "ping success", "datetime": "2016-03-03 22:15:24"}

ping success
user_esp_platform_sent_beacon 154136054
user_esp_platform_sent_cb
user_esp_platform_recv_cb {"status": 200, "epoch": 1457014574, "mdev_mac": "5CCF7F0C1B01", "message": "ping success", "datetime": "2016-03-03 22:16:14"}


5. 手机端会提示 “需要升级应用才能控制设备”,是什么意思?

[img]
1.png

2.png

3.png

[/img]

6. 参考http://my.oschina.net/u/2327133/blog/388092时需要将下面的代码添加到哪里,如何添加,才能通过云端控制设备?

Code: Select all

void ICACHE_FLASH_ATTR
user_esp_platform_set_info(struct espconn *pconn, uint8 *pbuffer)
{
#if PLUG_DEVICE
    char *pstr = NULL;
    pstr = (char *)os_strstr(pbuffer, "plug-status");
 
    if (pstr != NULL) {
        pstr = (char *)os_strstr(pbuffer, "body");
 
        if (pstr != NULL) {
 
            if (os_strncmp(pstr + 27, "1", 1) == 0) {
                user_plug_set_status(0x01);
            } else if (os_strncmp(pstr + 27, "0", 1) == 0) {
                user_plug_set_status(0x00);
            }
        }
    }
 
#elif LIGHT_DEVICE
    char *pstr = NULL;
    char *pdata = NULL;
    char *pbuf = NULL;
    char recvbuf[10];
    uint16 length = 0;
    uint16 data = 0;
    pstr = (char *)os_strstr(pbuffer, "\"path\": \"/v1/datastreams/light/datapoint/\"");
 
    if (pstr != NULL) {
        pstr = (char *)os_strstr(pbuffer, "{\"datapoint\": ");
 
        if (pstr != NULL) {
            pbuf = (char *)os_strstr(pbuffer, "}}");
            length = pbuf - pstr;
            length += 2;
            pdata = (char *)os_zalloc(length + 1);
            os_memcpy(pdata, pstr, length);
 
            pstr = os_strchr(pdata, 'x');
 
            if (pstr != NULL) {
                pstr += 4;
                pbuf = os_strchr(pstr, ',');
 
                if (pbuf != NULL) {
                    length = pbuf - pstr;
                    os_memset(recvbuf, 0, 10);
                    os_memcpy(recvbuf, pstr, length);
                    data = atoi(recvbuf);
                    user_light_set_freq(data);
                }
            }
 
            pstr = os_strchr(pdata, 'y');
 
            if (pstr != NULL) {
                pstr += 4;
                pbuf = os_strchr(pstr, ',');
 
                if (pbuf != NULL) {
                    length = pbuf - pstr;
                    os_memset(recvbuf, 0, 10);
                    os_memcpy(recvbuf, pstr, length);
                    data = atoi(recvbuf);
                    user_light_set_duty(data, 0);
                }
            }
 
            pstr = os_strchr(pdata, 'z');
 
            if (pstr != NULL) {
                pstr += 4;
                pbuf = os_strchr(pstr, ',');
 
                if (pbuf != NULL) {
                    length = pbuf - pstr;
                    os_memset(recvbuf, 0, 10);
                    os_memcpy(recvbuf, pstr, length);
                    data = atoi(recvbuf);
                    user_light_set_duty(data, 1);
                }
            }
 
            pstr = os_strchr(pdata, 'k');
 
            if (pstr != NULL) {
                pstr += 4;;
                pbuf = os_strchr(pstr, ',');
 
                if (pbuf != NULL) {
                    length = pbuf - pstr;
                    os_memset(recvbuf, 0, 10);
                    os_memcpy(recvbuf, pstr, length);
                    data = atoi(recvbuf);
                    user_light_set_duty(data, 2);
                }
            }
 
            os_free(pdata);
        }
    }
 
    user_light_restart();
 
#endif
 
    user_esp_platform_get_info(pconn, pbuffer);
}


7. 粉色框中的路径是如何得到的?
4.png


8. 我提供一下master_deviece_key.bin,能否帮忙基于 IoT_Demo改一个可以测试的例程测试一下
devices_generate.zip
(594 Bytes) Downloaded 301 times


9. 再请教一下 IoT_Demo例程,如果设备连接到云端,并且可以通过去端控制设备,当设备连接的本地路由器无法连外网的情况下,是否可以自动切换回 Station 模式,可以被连接到本地路由器的手机控制。

dearwind153
Posts: 49
Joined: Sun Feb 28, 2016 7:47 pm

Re: 已经注册云端服务,并获取到 master_device_key.bin, 手机安装 相应的 .apk,如何通过云端控制ESP8266

Postby dearwind153 » Sat Mar 05, 2016 10:19 pm

既然没有解答,那只能自己解答喽,所幸一天尝试没有白费,云端控制方式如下:

1. SDK 使用 无 RTOS_SDK_1.5.1版本,编译,烧录
2. 首先,下载 IOT_ESPRESSIF_0.9.1版本,安装至手机,然后配置本地ESP8266连接本地路由器,确保ESP8266连接本地路由器
3. 接着,升级 IOT_ESPRESSIF_0.9.1版本至 IOT_ESPRESSIF_1.1.4版本,进行控制就可以了

实际控制效果图

2620049270259710.jpg


Code: Select all

ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x40100000, len 29468, room 16
tail 12
chksum 0x0c
ho 0 tail 12 room 4
load 0x3ffe8000, len 2936, room 12
tail 12
chksum 0x47
ho 0 tail 12 room 4
load 0x3ffe8b80, len 3780, room 12
tail 8
chksum 0x55
csum 0x55
犟+P禇h〥r
SDK ver: 1.5.1(e67da894) compiled @ Jan  7 2016 18:44:54
phy ver: 484, pp ver: 9.6

SDK version:1.5.1(e67da894)
IOT VERSION = v1.0.5t45772(a)
reset reason: 6
LIGHT PARAM: R: -1608486832
LIGHT PARAM: G: 1718620535
LIGHT PARAM: B: 17066272
LIGHT PARAM: CW: 12646455
LIGHT PARAM: WW: 303106048
LIGHT PARAM: P: 1000
malloc:1
prd:1000  r : 22222  g: 22222  b: 22222  cw: 22222  ww: 22222
free:0
PWM version : 00000003
mode : sta(5c:cf:7f:0c:1b:01)
add if0
f r0, scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 7
cnt

connected with MERCURY-JQY, channel 6
dhcp client start...
ip:192.168.1.110,mask:255.255.255.0,gw:192.168.1.1
host_name = espressif_light_demo
server_name = _espLight._tcp.local
user_esp_platform_dns_found 115.29.202.58
user_esp_platform_connect
user_esp_platform_connect_cb
{"nonce": 1489400026, "path": "/v1/device/identify", "method": "GET","meta": {"Authorization": "token 2f190a696181213928f24a38074c69bd6723410b"}}

user_esp_platform_sent_cb
user_esp_platform_recv_cb {"nonce": 1489400026, "status": 200, "mdev_mac": "5CCF7F0C1B01", "datetime": "2016-03-05 22:26:17", "device": {"productbatch_id": 0, "bssid": "5c:cf:7f:0c:1b:01", "ptype": 45772, "activate_status": 1, "serial": "7bd951a9", "id": 123516, "description": "desc-7bd951a9", "last_active": "2016-03-05 22:25:47", "rom_version": "v1.0.5t45772(a)", "last_pull": "2016-03-03 20:18:28", "last_push": "2016-03-03 20:18:28", "location": "", "last_activated_at": "2016-03-05 21:59:00", "metadata": "", "status": 1, "updated": "2016-03-05 22:25:47", "latest_rom_version": "", "activated_at": "2016-03-03 22:13:40", "visibly": 1, "is_private": 0, "product_id": 2368, "name": "light-001", "created": "2016-03-03 20:18:28", "is_frozen": 0, "key_id": 143257}, "message": "device identified"}

{"body": {}, "get":{"is_humanize_format_simple":"true"},"meta": {"Authorization": "Token 2f190a696181213928f24a38074c69bd6723410b"},"path": "/v1/device/timers/","post":{},"method": "GET"}

user_esp_platform_sent_cb
user_esp_platform_recv_cb {"status": 200, "mdev_mac": "5CCF7F0C1B01", "weekday_timestamp_mod": 512777, "timestamp": 1457187977, "timers": "", "weekday": 6, "now": "2016-03-05 22:26:17"}

finish
pm open,type:2 0
I'm Light.5c:cf:7f:0c:1b:01 192.168.1.110
I'm Light.5c:cf:7f:0c:1b:01 192.168.1.110
I'm Light.5c:cf:7f:0c:1b:01 192.168.1.110
len:102
A_dat:0,tot:0,lenght:0
We have a GET request.
I'm Light.5c:cf:7f:0c:1b:01 192.168.1.110
I'm Light.5c:cf:7f:0c:1b:01 192.168.1.110
I'm Light.5c:cf:7f:0c:1b:01 192.168.1.110
len:102
A_dat:0,tot:0,lenght:0
We have a GET request.
len:251
A_dat:105,tot:105,lenght:105
We have a POST request.
rspneed: 1
PERIOD: 1000
WW: 22222
R: 22222
B: 22222
CW: 22222
G: 22222
malloc:1
prd:1000  r : 22222  g: 22222  b: 22222  cw: 22222  ww: 22222
free:0
finish
rsp1:1
webserver's 192.168.1.106:56931 disconnect
user_esp_platform_sent_beacon 52035306
user_esp_platform_sent_cb
user_esp_platform_recv_cb {"status": 200, "epoch": 1457188027, "mdev_mac": "5CCF7F0C1B01", "message": "ping success", "datetime": "2016-03-05 22:27:07"}

ping success
I'm Light.5c:cf:7f:0c:1b:01 192.168.1.110
I'm Light.5c:cf:7f:0c:1b:01 192.168.1.110
I'm Light.5c:cf:7f:0c:1b:01 192.168.1.110
len:102
A_dat:0,tot:0,lenght:0
We have a GET request.
len:250
A_dat:104,tot:104,lenght:104
We have a POST request.
rspneed: 1
PERIOD: 1000
WW: 22222
R: 22222
B: 22222
CW: 22222
G: 5382
malloc:1
prd:1000  r : 22222  g: 5382  b: 22222  cw: 22222  ww: 22222
free:0
rsp1:1
finish


注意:

1. IOT_ESPRESSIF_0.9.1版本只能用做配置设备为快连至本地路由,无法控制 ESP8266,可能是IOT_ESPRESSIF_0.9.1版本的BUG吧

2. 而 IOT_ESPRESSIF_1.1.4版本只能用做控制设备,无法配置设备为快连至本地路由,可能是IOT_ESPRESSIF_1.1.4版本的BUG吧


ESP_Faye
Posts: 1615
Joined: Mon Oct 27, 2014 11:08 am

Re: 已经注册云端服务,并获取到 master_device_key.bin, 手机安装 相应的 .apk,如何通过云端控制ESP8266

Postby ESP_Faye » Fri Mar 11, 2016 3:24 pm

哈哈,厉害厉害!

非常抱歉没能及时回复您的问题。
pstr = (char *)os_strstr(pbuffer, "\"path\": \"/v1/datastreams/light/datapoint/\"");

这种字符串,是 Espressif Cloud 定义的与它沟通的指令,您可以在 Espressif Cloud 上看到指令说明。
Espressif Cloud :http://iot.espressif.cn/#/ 点击 “开始”,再点击 “API 说明” 即可。

dianzier
Posts: 4
Joined: Mon Jul 25, 2016 10:19 am

Re: 已经注册云端服务,并获取到 master_device_key.bin, 手机安装 相应的 .apk,如何通过云端控制ESP8266

Postby dianzier » Mon Jul 25, 2016 10:22 am

我也是遇到你说的升级程序到新版本才能控制,但是找不到更新的地址或者方法。你能告诉我怎么更新到1.4版本吗?或者是在哪里有新版本的程序可以下载

ESP_Rubin
Posts: 222
Joined: Wed Jun 29, 2016 11:59 am

Re: 已经注册云端服务,并获取到 master_device_key.bin, 手机安装 相应的 .apk,如何通过云端控制ESP8266

Postby ESP_Rubin » Mon Jul 25, 2016 10:55 am

Hi,
最新下载链接如下:
RTOS SDK:https://github.com/espressif
Android/Iphone APP:https://github.com/espressifapp

dianzier
Posts: 4
Joined: Mon Jul 25, 2016 10:19 am

Re: 【Feedback】已经注册云端服务,并获取到 master_device_key.bin, 手机安装 相应的 .apk,如何通过云端控制ESP8266

Postby dianzier » Mon Jul 25, 2016 7:11 pm

2. 而 IOT_ESPRESSIF_1.1.4版本只能用做控制设备,无法配置设备为快连至本地路由,可能是IOT_ESPRESSIF_1.1.4版本的BUG吧

在https://github.com/EspressifApp/IOT-Espressif-Android下载了1.2版本,还是存在上面说的问题,我要卸载了,从新安装0.9.1的版本才能发现设备,晕啊,到底有哪个版本可以吧着两个功能都兼容到,这是个非常严肃的问题了。
能不能把整套:云端设置》手机APP源码版本》ESP8266SDK版本》做一个整合的说明,我找了几天资料,零零碎碎的调试真令人感到崩溃,我最不明白的就是,也是最让大家疑惑的就是sdk设备端添加到和云端的设备添加这两者的联系,虽然知道添加简单的,但是具体很多功能根本不知道怎么去用。

yueda
Posts: 23
Joined: Wed Jun 01, 2016 11:52 am

Re: 【Feedback】已经注册云端服务,并获取到 master_device_key.bin, 手机安装 相应的 .apk,如何通过云端控制ESP8266

Postby yueda » Thu Jul 28, 2016 11:07 am

我在编译IOT_Demo的时候,编译出来,通过串口的波特率是多少?串口乱码。还是编译的不正确?

yueda
Posts: 23
Joined: Wed Jun 01, 2016 11:52 am

Re: 【Feedback】已经注册云端服务,并获取到 master_device_key.bin, 手机安装 相应的 .apk,如何通过云端控制ESP8266

Postby yueda » Mon Aug 01, 2016 11:50 am

把串口的波特率该了,uart_init(115200,115200),添加对应的头文件和实现文件

Who is online

Users browsing this forum: No registered users and 1 guest