mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-09-19 08:27:14 +08:00
NEW VERSION: 1.4.0
1. update boot.bin to v1.5; 2. phy version to 762; 3. add wifi_station_set/get_hostname api; 4. optimize net80211; 5. optimize ssl; 6. optimize ota; 7. optimize dhcp client; 8. update smartconfig to version 2.5.3; 9. support gpio wakeup; 10.enable IGMP in lwip; 11.some modify due to phy update; 12.add espconn_init in espconn.h; 13.update cjson/freertos/ssl; 14.add lwip/nopoll source code; 15.add libairkiss.a/airkiss.h, update smart_config; 16.update esp_init_data_default.bin; 17.irom0 too large, start addr change to 0x20000; 18.some modifications for system stability; 19.many other optimization;
This commit is contained in:

committed by
Wu Jian Gang

parent
50459308c1
commit
dba89f9aba
@ -58,17 +58,28 @@ LINKFLAGS_eagle.app.v6 = \
|
||||
-u call_user_start \
|
||||
-Wl,-static \
|
||||
-Wl,--start-group \
|
||||
-lminic \
|
||||
-lcirom \
|
||||
-lcrypto \
|
||||
-lespconn \
|
||||
-lespnow \
|
||||
-lfreertos \
|
||||
-lgcc \
|
||||
-lhal \
|
||||
-ljson \
|
||||
-llwip \
|
||||
-lmain \
|
||||
-lmesh \
|
||||
-lmirom \
|
||||
-lnet80211 \
|
||||
-lnopoll \
|
||||
-lphy \
|
||||
-lpp \
|
||||
-lnet80211 \
|
||||
-lpwm \
|
||||
-lsmartconfig \
|
||||
-lspiffs \
|
||||
-lssl \
|
||||
-lwpa \
|
||||
-lcrypto \
|
||||
-lmain \
|
||||
-lfreertos \
|
||||
-llwip \
|
||||
-lwps \
|
||||
$(DEP_LIBS_eagle.app.v6) \
|
||||
-Wl,--end-group
|
||||
|
||||
|
@ -8,8 +8,8 @@ export SDK_PATH=~/esp_iot_sdk_freertos
|
||||
export BIN_PATH=~/esp8266_bin
|
||||
!
|
||||
|
||||
export SDK_PATH=
|
||||
export BIN_PATH=
|
||||
export SDK_PATH=$SDK_PATH
|
||||
export BIN_PATH=$BIN_PATH
|
||||
|
||||
echo "gen_misc.sh version 20150911"
|
||||
echo ""
|
||||
|
@ -67,7 +67,9 @@ LINKFLAGS_eagle.app.v6 = \
|
||||
-lmain \
|
||||
-lfreertos \
|
||||
-llwip \
|
||||
-lespconn\
|
||||
-lsmartconfig \
|
||||
-lairkiss\
|
||||
$(DEP_LIBS_eagle.app.v6) \
|
||||
-Wl,--end-group
|
||||
|
||||
|
8
examples/smart_config/airkiss.txt
Normal file
8
examples/smart_config/airkiss.txt
Normal file
@ -0,0 +1,8 @@
|
||||
if you want to use AIRKISS2.0 LAN discovery, should include airkiss.h and include libairkiss.a in makefile.
|
||||
|
||||
you can follow the steps below to achieve the function of LAN discovery.
|
||||
1.scan the two-dimension code in your wechat.
|
||||
2.running this smartconfig example.
|
||||
3.wait device connect to AP and LAN discovery.
|
||||
|
||||
More detailed introduction refer to wechat.
|
BIN
examples/smart_config/model two-dimension code.rar
Normal file
BIN
examples/smart_config/model two-dimension code.rar
Normal file
Binary file not shown.
@ -30,10 +30,127 @@
|
||||
#include "lwip/sockets.h"
|
||||
#include "lwip/dns.h"
|
||||
#include "lwip/netdb.h"
|
||||
#include "espressif/espconn.h"
|
||||
#include "espressif/airkiss.h"
|
||||
|
||||
#define server_ip "192.168.101.142"
|
||||
#define server_port 9669
|
||||
|
||||
|
||||
#define DEVICE_TYPE "gh_9e2cff3dfa51" //wechat public number
|
||||
#define DEVICE_ID "122475" //model ID
|
||||
|
||||
#define DEFAULT_LAN_PORT 12476
|
||||
|
||||
LOCAL esp_udp ssdp_udp;
|
||||
LOCAL struct espconn pssdpudpconn;
|
||||
LOCAL os_timer_t ssdp_time_serv;
|
||||
|
||||
uint8 lan_buf[200];
|
||||
uint16 lan_buf_len;
|
||||
uint8 udp_sent_cnt = 0;
|
||||
|
||||
const airkiss_config_t akconf =
|
||||
{
|
||||
(airkiss_memset_fn)&memset,
|
||||
(airkiss_memcpy_fn)&memcpy,
|
||||
(airkiss_memcmp_fn)&memcmp,
|
||||
0,
|
||||
};
|
||||
|
||||
LOCAL void ICACHE_FLASH_ATTR
|
||||
airkiss_wifilan_time_callback(void)
|
||||
{
|
||||
uint16 i;
|
||||
airkiss_lan_ret_t ret;
|
||||
|
||||
if ((udp_sent_cnt++) >30) {
|
||||
udp_sent_cnt = 0;
|
||||
os_timer_disarm(&ssdp_time_serv);//s
|
||||
//return;
|
||||
}
|
||||
|
||||
ssdp_udp.remote_port = DEFAULT_LAN_PORT;
|
||||
ssdp_udp.remote_ip[0] = 255;
|
||||
ssdp_udp.remote_ip[1] = 255;
|
||||
ssdp_udp.remote_ip[2] = 255;
|
||||
ssdp_udp.remote_ip[3] = 255;
|
||||
lan_buf_len = sizeof(lan_buf);
|
||||
ret = airkiss_lan_pack(AIRKISS_LAN_SSDP_NOTIFY_CMD,
|
||||
DEVICE_TYPE, DEVICE_ID, 0, 0, lan_buf, &lan_buf_len, &akconf);
|
||||
if (ret != AIRKISS_LAN_PAKE_READY) {
|
||||
os_printf("Pack lan packet error!");
|
||||
return;
|
||||
}
|
||||
|
||||
ret = espconn_sendto(&pssdpudpconn, lan_buf, lan_buf_len);
|
||||
if (ret != 0) {
|
||||
os_printf("UDP send error!");
|
||||
}
|
||||
os_printf("Finish send notify!\n");
|
||||
}
|
||||
|
||||
LOCAL void ICACHE_FLASH_ATTR
|
||||
airkiss_wifilan_recv_callbk(void *arg, char *pdata, unsigned short len)
|
||||
{
|
||||
uint16 i;
|
||||
remot_info* pcon_info = NULL;
|
||||
|
||||
airkiss_lan_ret_t ret = airkiss_lan_recv(pdata, len, &akconf);
|
||||
airkiss_lan_ret_t packret;
|
||||
|
||||
switch (ret){
|
||||
case AIRKISS_LAN_SSDP_REQ:
|
||||
espconn_get_connection_info(&pssdpudpconn, &pcon_info, 0);
|
||||
os_printf("remote ip: %d.%d.%d.%d \r\n",pcon_info->remote_ip[0],pcon_info->remote_ip[1],
|
||||
pcon_info->remote_ip[2],pcon_info->remote_ip[3]);
|
||||
os_printf("remote port: %d \r\n",pcon_info->remote_port);
|
||||
|
||||
pssdpudpconn.proto.udp->remote_port = pcon_info->remote_port;
|
||||
memcpy(pssdpudpconn.proto.udp->remote_ip,pcon_info->remote_ip,4);
|
||||
ssdp_udp.remote_port = DEFAULT_LAN_PORT;
|
||||
|
||||
lan_buf_len = sizeof(lan_buf);
|
||||
packret = airkiss_lan_pack(AIRKISS_LAN_SSDP_RESP_CMD,
|
||||
DEVICE_TYPE, DEVICE_ID, 0, 0, lan_buf, &lan_buf_len, &akconf);
|
||||
|
||||
if (packret != AIRKISS_LAN_PAKE_READY) {
|
||||
os_printf("Pack lan packet error!");
|
||||
return;
|
||||
}
|
||||
|
||||
os_printf("\r\n\r\n");
|
||||
for (i=0; i<lan_buf_len; i++)
|
||||
os_printf("%c",lan_buf[i]);
|
||||
os_printf("\r\n\r\n");
|
||||
|
||||
packret = espconn_sendto(&pssdpudpconn, lan_buf, lan_buf_len);
|
||||
if (packret != 0) {
|
||||
os_printf("LAN UDP Send err!");
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
os_printf("Pack is not ssdq req!%d\r\n",ret);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void ICACHE_FLASH_ATTR
|
||||
airkiss_start_discover(void)
|
||||
{
|
||||
ssdp_udp.local_port = DEFAULT_LAN_PORT;
|
||||
pssdpudpconn.type = ESPCONN_UDP;
|
||||
pssdpudpconn.proto.udp = &(ssdp_udp);
|
||||
espconn_regist_recvcb(&pssdpudpconn, airkiss_wifilan_recv_callbk);
|
||||
espconn_create(&pssdpudpconn);
|
||||
|
||||
os_timer_disarm(&ssdp_time_serv);
|
||||
os_timer_setfn(&ssdp_time_serv, (os_timer_func_t *)airkiss_wifilan_time_callback, NULL);
|
||||
os_timer_arm(&ssdp_time_serv, 1000, 1);//1s
|
||||
}
|
||||
|
||||
|
||||
void ICACHE_FLASH_ATTR
|
||||
smartconfig_done(sc_status status, void *pdata)
|
||||
{
|
||||
@ -64,11 +181,15 @@ smartconfig_done(sc_status status, void *pdata)
|
||||
case SC_STATUS_LINK_OVER:
|
||||
printf("SC_STATUS_LINK_OVER\n");
|
||||
if (pdata != NULL) {
|
||||
//SC_TYPE_ESPTOUCH
|
||||
uint8 phone_ip[4] = {0};
|
||||
|
||||
memcpy(phone_ip, (uint8*)pdata, 4);
|
||||
printf("Phone ip: %d.%d.%d.%d\n",phone_ip[0],phone_ip[1],phone_ip[2],phone_ip[3]);
|
||||
}
|
||||
} else {
|
||||
//SC_TYPE_AIRKISS - support airkiss v2.0
|
||||
airkiss_start_discover();
|
||||
}
|
||||
smartconfig_stop();
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user