Skip to content

Commit dba89f9

Browse files
Espressif Systemswujiangang
authored andcommitted
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;
1 parent 5045930 commit dba89f9

File tree

166 files changed

+70223
-1784
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

166 files changed

+70223
-1784
lines changed

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ $$(IMAGEODIR)/$(1).out: $$(OBJS) $$(DEP_OBJS_$(1)) $$(DEP_LIBS_$(1)) $$(DEPENDS_
235235
endef
236236

237237
$(BINODIR)/%.bin: $(IMAGEODIR)/%.out
238+
@mkdir -p $(BIN_PATH)
238239
@mkdir -p $(BINODIR)
239240

240241
ifeq ($(APP), 0)
@@ -267,7 +268,7 @@ ifeq ($(app), 0)
267268
@echo "No boot needed."
268269
@echo "Generate eagle.flash.bin and eagle.irom0text.bin successully in BIN_PATH"
269270
@echo "eagle.flash.bin-------->0x00000"
270-
@echo "eagle.irom0text.bin---->0x40000"
271+
@echo "eagle.irom0text.bin---->0x20000"
271272
else
272273
@echo "BIN_PATH: $(BIN_PATH)/upgrade"
273274
@echo ""
@@ -403,3 +404,4 @@ INCLUDES += -I $(SDK_PATH)/include/lwip/ipv6
403404
INCLUDES += -I $(SDK_PATH)/include/nopoll
404405
INCLUDES += -I $(SDK_PATH)/include/spiffs
405406
INCLUDES += -I $(SDK_PATH)/include/ssl
407+
INCLUDES += -I $(SDK_PATH)/include/json

bin/boot_v1.4(b1).bin

-2.69 KB
Binary file not shown.

bin/boot_v1.5.bin

3.16 KB
Binary file not shown.

bin/esp_init_data_default.bin

0 Bytes
Binary file not shown.

examples/project_template/Makefile

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,28 @@ LINKFLAGS_eagle.app.v6 = \
5858
-u call_user_start \
5959
-Wl,-static \
6060
-Wl,--start-group \
61-
-lminic \
61+
-lcirom \
62+
-lcrypto \
63+
-lespconn \
64+
-lespnow \
65+
-lfreertos \
6266
-lgcc \
6367
-lhal \
68+
-ljson \
69+
-llwip \
70+
-lmain \
71+
-lmesh \
72+
-lmirom \
73+
-lnet80211 \
74+
-lnopoll \
6475
-lphy \
6576
-lpp \
66-
-lnet80211 \
77+
-lpwm \
78+
-lsmartconfig \
79+
-lspiffs \
80+
-lssl \
6781
-lwpa \
68-
-lcrypto \
69-
-lmain \
70-
-lfreertos \
71-
-llwip \
82+
-lwps \
7283
$(DEP_LIBS_eagle.app.v6) \
7384
-Wl,--end-group
7485

examples/project_template/gen_misc.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ export SDK_PATH=~/esp_iot_sdk_freertos
88
export BIN_PATH=~/esp8266_bin
99
!
1010

11-
export SDK_PATH=
12-
export BIN_PATH=
11+
export SDK_PATH=$SDK_PATH
12+
export BIN_PATH=$BIN_PATH
1313

1414
echo "gen_misc.sh version 20150911"
1515
echo ""

examples/smart_config/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ LINKFLAGS_eagle.app.v6 = \
6767
-lmain \
6868
-lfreertos \
6969
-llwip \
70+
-lespconn\
7071
-lsmartconfig \
72+
-lairkiss\
7173
$(DEP_LIBS_eagle.app.v6) \
7274
-Wl,--end-group
7375

examples/smart_config/airkiss.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
if you want to use AIRKISS2.0 LAN discovery, should include airkiss.h and include libairkiss.a in makefile.
2+
3+
you can follow the steps below to achieve the function of LAN discovery.
4+
1.scan the two-dimension code in your wechat.
5+
2.running this smartconfig example.
6+
3.wait device connect to AP and LAN discovery.
7+
8+
More detailed introduction refer to wechat.
15 KB
Binary file not shown.

examples/smart_config/user/user_main.c

Lines changed: 122 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,127 @@
3030
#include "lwip/sockets.h"
3131
#include "lwip/dns.h"
3232
#include "lwip/netdb.h"
33+
#include "espressif/espconn.h"
34+
#include "espressif/airkiss.h"
3335

3436
#define server_ip "192.168.101.142"
3537
#define server_port 9669
3638

39+
40+
#define DEVICE_TYPE "gh_9e2cff3dfa51" //wechat public number
41+
#define DEVICE_ID "122475" //model ID
42+
43+
#define DEFAULT_LAN_PORT 12476
44+
45+
LOCAL esp_udp ssdp_udp;
46+
LOCAL struct espconn pssdpudpconn;
47+
LOCAL os_timer_t ssdp_time_serv;
48+
49+
uint8 lan_buf[200];
50+
uint16 lan_buf_len;
51+
uint8 udp_sent_cnt = 0;
52+
53+
const airkiss_config_t akconf =
54+
{
55+
(airkiss_memset_fn)&memset,
56+
(airkiss_memcpy_fn)&memcpy,
57+
(airkiss_memcmp_fn)&memcmp,
58+
0,
59+
};
60+
61+
LOCAL void ICACHE_FLASH_ATTR
62+
airkiss_wifilan_time_callback(void)
63+
{
64+
uint16 i;
65+
airkiss_lan_ret_t ret;
66+
67+
if ((udp_sent_cnt++) >30) {
68+
udp_sent_cnt = 0;
69+
os_timer_disarm(&ssdp_time_serv);//s
70+
//return;
71+
}
72+
73+
ssdp_udp.remote_port = DEFAULT_LAN_PORT;
74+
ssdp_udp.remote_ip[0] = 255;
75+
ssdp_udp.remote_ip[1] = 255;
76+
ssdp_udp.remote_ip[2] = 255;
77+
ssdp_udp.remote_ip[3] = 255;
78+
lan_buf_len = sizeof(lan_buf);
79+
ret = airkiss_lan_pack(AIRKISS_LAN_SSDP_NOTIFY_CMD,
80+
DEVICE_TYPE, DEVICE_ID, 0, 0, lan_buf, &lan_buf_len, &akconf);
81+
if (ret != AIRKISS_LAN_PAKE_READY) {
82+
os_printf("Pack lan packet error!");
83+
return;
84+
}
85+
86+
ret = espconn_sendto(&pssdpudpconn, lan_buf, lan_buf_len);
87+
if (ret != 0) {
88+
os_printf("UDP send error!");
89+
}
90+
os_printf("Finish send notify!\n");
91+
}
92+
93+
LOCAL void ICACHE_FLASH_ATTR
94+
airkiss_wifilan_recv_callbk(void *arg, char *pdata, unsigned short len)
95+
{
96+
uint16 i;
97+
remot_info* pcon_info = NULL;
98+
99+
airkiss_lan_ret_t ret = airkiss_lan_recv(pdata, len, &akconf);
100+
airkiss_lan_ret_t packret;
101+
102+
switch (ret){
103+
case AIRKISS_LAN_SSDP_REQ:
104+
espconn_get_connection_info(&pssdpudpconn, &pcon_info, 0);
105+
os_printf("remote ip: %d.%d.%d.%d \r\n",pcon_info->remote_ip[0],pcon_info->remote_ip[1],
106+
pcon_info->remote_ip[2],pcon_info->remote_ip[3]);
107+
os_printf("remote port: %d \r\n",pcon_info->remote_port);
108+
109+
pssdpudpconn.proto.udp->remote_port = pcon_info->remote_port;
110+
memcpy(pssdpudpconn.proto.udp->remote_ip,pcon_info->remote_ip,4);
111+
ssdp_udp.remote_port = DEFAULT_LAN_PORT;
112+
113+
lan_buf_len = sizeof(lan_buf);
114+
packret = airkiss_lan_pack(AIRKISS_LAN_SSDP_RESP_CMD,
115+
DEVICE_TYPE, DEVICE_ID, 0, 0, lan_buf, &lan_buf_len, &akconf);
116+
117+
if (packret != AIRKISS_LAN_PAKE_READY) {
118+
os_printf("Pack lan packet error!");
119+
return;
120+
}
121+
122+
os_printf("\r\n\r\n");
123+
for (i=0; i<lan_buf_len; i++)
124+
os_printf("%c",lan_buf[i]);
125+
os_printf("\r\n\r\n");
126+
127+
packret = espconn_sendto(&pssdpudpconn, lan_buf, lan_buf_len);
128+
if (packret != 0) {
129+
os_printf("LAN UDP Send err!");
130+
}
131+
132+
break;
133+
default:
134+
os_printf("Pack is not ssdq req!%d\r\n",ret);
135+
break;
136+
}
137+
}
138+
139+
void ICACHE_FLASH_ATTR
140+
airkiss_start_discover(void)
141+
{
142+
ssdp_udp.local_port = DEFAULT_LAN_PORT;
143+
pssdpudpconn.type = ESPCONN_UDP;
144+
pssdpudpconn.proto.udp = &(ssdp_udp);
145+
espconn_regist_recvcb(&pssdpudpconn, airkiss_wifilan_recv_callbk);
146+
espconn_create(&pssdpudpconn);
147+
148+
os_timer_disarm(&ssdp_time_serv);
149+
os_timer_setfn(&ssdp_time_serv, (os_timer_func_t *)airkiss_wifilan_time_callback, NULL);
150+
os_timer_arm(&ssdp_time_serv, 1000, 1);//1s
151+
}
152+
153+
37154
void ICACHE_FLASH_ATTR
38155
smartconfig_done(sc_status status, void *pdata)
39156
{
@@ -64,11 +181,15 @@ smartconfig_done(sc_status status, void *pdata)
64181
case SC_STATUS_LINK_OVER:
65182
printf("SC_STATUS_LINK_OVER\n");
66183
if (pdata != NULL) {
184+
//SC_TYPE_ESPTOUCH
67185
uint8 phone_ip[4] = {0};
68186

69187
memcpy(phone_ip, (uint8*)pdata, 4);
70188
printf("Phone ip: %d.%d.%d.%d\n",phone_ip[0],phone_ip[1],phone_ip[2],phone_ip[3]);
71-
}
189+
} else {
190+
//SC_TYPE_AIRKISS - support airkiss v2.0
191+
airkiss_start_discover();
192+
}
72193
smartconfig_stop();
73194
break;
74195
}

0 commit comments

Comments
 (0)