wujiangang / esp8266_iot_platform Goto Github PK
View Code? Open in Web Editor NEWA demo that should be run with ESP8266 RTOS SDK
Home Page: http://bbs.espressif.com
License: Other
A demo that should be run with ESP8266 RTOS SDK
Home Page: http://bbs.espressif.com
License: Other
make[1]: Leaving directory `/mnt/Share/esp8266_iot_platform/libesphttpd'
xtensa-lx106-elf-gcc user/.output/eagle/debug/lib/libuser.a driver/.output/eagle/debug/lib/libdriver.a upgrade/.output/eagle/debug/lib/libupgrade.a -o .output/eagle/debug/image/eagle.app.v6.out
/opt/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: cannot find crt1-sim.o: No such file or directory
/opt/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: cannot find _vectors.o: No such file or directory
/opt/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: cannot find -lsim
/opt/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: cannot find -lhandlers-sim
collect2: error: ld returned 1 exit status
make: *** [.output/eagle/debug/image/eagle.app.v6.out] Error 1
I have modified my makefile to solve the -lmXXXX link problem:
LINKFLAGS_eagle.app.v6 =
-L$(SDK_PATH)/lib
-Wl,--gc-sections
-nostdlib
-T$(LD_FILE)
-Wl,--no-check-sections
-u call_user_start
-Wl,-static
-Wl,--start-group
-lgcc
-lhal
-lphy
-lpp
-lnet80211
-lcrypto
-lwpa
-lmain
-lfreertos
-llwip
-lssl
-ljson
-lsmartconfig
-lpwm
-L./libesphttpd
-lesphttpd
-lwebpages-espfs
$(DEP_LIBS_eagle.app.v6)
-Wl,--end-group
-lmirom \
Good evening,
I'm using your source code with some modification for my specific application, I whould like to switch OFF wifi some time to save power, but I don't see where the first connexion is done in code, I'm using only HTTPD server
I only this code in user_init()
#if HTTPD_SERVER
/*Initialize DNS server for captive portal*/
captdnsInit();
/*Initialize espfs containing static webpages*/
espFsInit((void*)(webpages_espfs_start));
/*Initialize webserver*/
httpdInit(builtInUrls, 80);
#endif
Could you please help me?
Thanks
THierry,
I'm starting using the platform with RTOS SDK v1.5 and I compile IOT platform demo, everything goes well except that some problems requesting files and the esp fs wasn't initialized, I made a modification to initialize and found another problem, the files where not aligned, so I made another modification as I found in the espressif forums and everthing started to run well except that the webserver get stuck when the browser request more than two files at the same time:
index.html
.js
.png
The last one is never served, not even the request is logged from the device logs.
If I request the files individually via telnet the files came fine but if the browser request the files via index.html so then request .js and .png the server get stuck.
The module donesn't reset nor even hangs, just the sockets found no more request as far I can check looking at the sources.
My level of knowledge about RTOS and sockets in this os is not enougth to check or know how to solve this problem.
Maybe nobody has tested the example via html, because it works well via android app, but I want to make the server work properly.
Looking at the repo of libesphttpd there are more newer files that the files in this repo, so, is very out of date and using an old version, again, my level is not enougth to change the code in such way yet.
Can you test this example with RTOS v1.5 and requesting files via http?
Today I put the content of .js .css inside the html so only two files are requested index.html and button.png and works well, this confirm my theory of stuck, also put the content of .js .css inside the wifi.tpl and works well. With this the requested files are two in the first step and only one in the wifi setup.
But this is not a solution because if I want to add some more files and some of them are requested at the same time it will stuck again.
Below are some logs that the code send via serial port, there are modified by me and some other are added.
Another problem with the webserver is If I navigate from IE the only thing logged is
W-index 1, sockfd 3, dummy?
In the logs I added I- W- E- for info, warning and error. and sometimes the name of the function. And in the file routines I changed the size of file and/or transfer from hex to decimal to make the data in log more uniform. Pointers are displayed in hex, just to know wich pointer is managed in the function.
I've posted the same question to bbs at espressif.com because I'm new with this platform and I don't know who follow wich form, the first question that somebody respond or if I got the solution I will update the post or close them to post the solution.
At the moment of logs, file compression was disabled to minimize the amount of logged data and to release module workload, but the problem is the same, with compression enabled or disabled.
Resuming:
I can get infinite number of times one or two files at the same time, via telnet or via Firefox, I made a batch that was running all night long and no errors serving files, but If I request three files like any browser should do because of index.html .js .css .png http get stuck.
The module don't hangs nor reset, anything keep running well but the http server will serve no more files, not even only one, so the android app stop working.
I can't navigate using IE, no matter that this is an unused browser from the point of view of a developer, but there are a lot of people that only use IE.
Regards
Luis
SDK version:1.5.0-dev(950076a),139
I-espFsInit test 0x3fff6070
mode : sta(5c:cf:7f:08:19:16) + softAP(5e:cf:7f:08:19:16)
add if0
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
add if1
bcn 100
IOT VERSION:v1.0.5t23701(a)
user_plug_init start!
wifi_station_get_ap num 0
bcn 0
del if1
mode : sta(5c:cf:7f:08:19:16)
....
...
...
I-httpserver_task started!!!
smartconfig_task start
..
...
captdns stack 18, heap 17272
...
...
I-httpserver acpt index:0 sockfd 3!
I-Change of maxfdp 3
I-readable recv sockfd 3 len=322
I-xmitSendBuff about to send 113B on socket 3
I-xmitSendBuff write status 113 on socket 3
I-httpdProcessRequest cgi_done, marking socket for destruction 3
I-readable recv sockfd 3 ret=0, close
I-closeAndFreeSocket 3
I-Change of maxfdp 0
I-httpserver acpt index:0 sockfd 3!
I-Change of maxfdp 3
I-readable recv sockfd 3 len=332
I-espFsOpen file: index.html
I- espFsOpen 0x3fff9990, p = 0x4022b76c
I- Found file 'wifi/style.css'. Namelen=16 fileLenComp=386, compr=0 flags=0
I- espFsOpen 0x3fff9990, p = 0x4022b910
I- Found file 'wifi/140medley.min.js'. Namelen=24 fileLenComp=825, compr=0 flags=0
I- espFsOpen 0x3fff9990, p = 0x4022bc74
I- Found file 'wifi/icons.png'. Namelen=16 fileLenComp=914, compr=0 flags=0
I- espFsOpen 0x3fff9990, p = 0x4022c028
I- Found file 'wifi/connecting.html'. Namelen=24 fileLenComp=1255, compr=0 flags=0
I- espFsOpen 0x3fff9990, p = 0x4022c538
I- Found file 'wifi/wifi.tpl'. Namelen=16 fileLenComp=2503, compr=0 flags=0
I- espFsOpen 0x3fff9990, p = 0x4022cf20
I- Found file '140medley.min.js'. Namelen=20 fileLenComp=825, compr=0 flags=0
I- espFsOpen 0x3fff9990, p = 0x4022d280
I- Found file 'index.html'. Namelen=12 fileLenComp=1917, compr=0 flags=0
I-Found requested file
I-File id: 3fff5aa8 (index.html)
I-xmitSendBuff about to send 136B on socket 3
I-xmitSendBuff write status 136 on socket 3
I-Reading File id: 3fff5aa8 1024 bytes from 4022d29c
I-cgiEspFsHook lwip_write status 1024 on socket 3
I-httpserver acpt index:1 sockfd 4!
I-Change of maxfdp 4
I-readable recv sockfd 4 len=284
I-espFsOpen file: 140medley.min.js
I- espFsOpen 0x3fff9990, p = 0x4022b76c
I- Found file 'wifi/style.css'. Namelen=16 fileLenComp=386, compr=0 flags=0
I- espFsOpen 0x3fff9990, p = 0x4022b910
I- Found file 'wifi/140medley.min.js'. Namelen=24 fileLenComp=825, compr=0 flags=0
I- espFsOpen 0x3fff9990, p = 0x4022bc74
I- Found file 'wifi/icons.png'. Namelen=16 fileLenComp=914, compr=0 flags=0
I- espFsOpen 0x3fff9990, p = 0x4022c028
I- Found file 'wifi/connecting.html'. Namelen=24 fileLenComp=1255, compr=0 flags=0
I- espFsOpen 0x3fff9990, p = 0x4022c538
I- Found file 'wifi/wifi.tpl'. Namelen=16 fileLenComp=2503, compr=0 flags=0
I- espFsOpen 0x3fff9990, p = 0x4022cf20
I- Found file '140medley.min.js'. Namelen=20 fileLenComp=825, compr=0 flags=0
I-Found requested file
I-File id: 3fff6090 (140medley.min.js)
I-xmitSendBuff about to send 142B on socket 4
I-xmitSendBuff write status 142 on socket 4
I-Reading File id: 3fff5aa8 893 bytes from 4022d69c
I-cgiEspFsHook lwip_write status 893 on socket 3
I-cgiEspFsHook finish sending file Id: 3fff5aa8
I-espFsClose 3fff5aa8
I- CGI done, mark for destruction 3
I-Reading File id: 3fff6090 825 bytes from 4022cf44
I-cgiEspFsHook lwip_write status 825 on socket 4
I-cgiEspFsHook finish sending file Id: 3fff6090
I-espFsClose 3fff6090
I- CGI done, mark for destruction 4
I-httpserver destruction close sockfd 3
I-closeAndFreeSocket 3
I-httpdserver sock_fd 4 timeout
Hi
Can this sketch work from Espressif Cloud ? Because the device can not register to Cloud what needs to be done so that the Espressif Cloud connection works well thanks for the reply.
Team, I wasn't able to locate the sample Android template (.apk file). Can you please point me to it?
Thanks.
Hi All,
I'm using the user_plug example in ESP8266_IOT_PLATFORM.
Everything works well, APP can control the plug, and request the plug status.
But when I press the key to make plug turns on or turns off, it will not send plug status to APP.
So I add below code:
`
if(key_pressed_flag == 1)
{
key_pressed_flag = 0;
char *pbuf = NULL;
int nonce = 0;
pbuf = (char *)zalloc(packet_size);
if (pbuf != NULL) {
sprintf(pbuf, RESPONSE_FRAME, user_plug_get_status(), nonce);
printf("%s\n", pbuf);
write(client_param.sock_fd, pbuf, strlen(pbuf));
free(pbuf);
pbuf = NULL;
}
}
`
But when execute these code, it will return below error.
Does anyone know why? Or is there any method to upload the plug status to APP?
Thanks!
[2016-12-09 16:16:48.712 R]read application data
user_esp_platform_data_process {"status": 500, "result": "failed", "message": "Internal Server Error"}
, 72
Met the error as it's in the topic, I have a attached my console output and printed my Ubuntu version at the end.
...
Please follow below steps(1-5) to generate specific bin(s):
STEP 1: use boot_v1.2+ by default
boot mode: new
STEP 2: choose bin generate(0=eagle.flash.bin+eagle.irom0text.bin, 1=user1.bin, 2=user2.bin)
enter (0/1/2, default 0):
ignore boot
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):
spi speed: 40 MHz
STEP 4: choose spi mode(0=QIO, 1=QOUT, 2=DIO, 3=DOUT)
enter (0/1/2/3, default 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):
spi size: 512KB
spi ota map: 256KB + 256KB
start...
make: *** No rule to make target all', needed by
dummy'. Stop.
linan@SUR-LINAN:/mnt/c/users/linan/documents/github/ESP8266_IOT_PLATFORM_1$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.4 LTS
Release: 14.04
Codename: trusty
我用1.4.x版本的SDK时,用网页配置是能正常使用的,能打开的。
现在我用1.5.0版本的SDK,网页配置无法使用,不知道你们有没有测试过?
Hi,
First of all, thank you guys for this great job. It looks awesome, unfortunately I can't compile, and I don't know why.
I have this output:
Please check SDK_PATH & BIN_PATH, enter (Y/y) to continue:
y
Please follow below steps(1-5) to generate specific bin(s):
STEP 1: use boot_v1.2+ by default
boot mode: new
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
ignore boot
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):
spi speed: 40 MHz
STEP 4: choose spi mode(0=QIO, 1=QOUT, 2=DIO, 3=DOUT)
enter (0/1/2/3, default 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):
spi size: 512KB
spi ota map: 256KB + 256KB
start...
make: *** No rule to make target 'clean'. Stop.
Makefile:150: warning: overriding recipe for target 'libwebpages-espfs.a'
Makefile:125: warning: ignoring old recipe for target 'libwebpages-espfs.a'
find: 'build': No such file or directory
make[1]: Entering directory '/home/seb/WW/ESP8266/ESP8266_IOT_PLATFORM/libesphttpd/espfs/mkespfsimage'
rm -f mkespfsimage main.o heatshrink_encoder.o
make[1]: Leaving directory '/home/seb/WW/ESP8266/ESP8266_IOT_PLATFORM/libesphttpd/espfs/mkespfsimage'
make: *** No rule to make target 'all', needed by 'dummy'. Stop.
ESP-OPEN-RTOS version is 1.5
Any idea on how to fix that ?
Thank you,
When defining UPGRADE_SSL_ENABLE, as soon as I start the ssl_upgrade_task, I continiously run into fatal excpetions:
client handshake fail: -516
ssl_free:Aviable Memory|10096
client handshake fail: -516
ssl_free:Aviable Memory|9928
client handshake fail: -516
ssl_free:Aviable Memory|9664
Fatal exception (28):
Fatal exception (9):
epc1=0x40100107
epc2=0x00000000
epc3=0x40100553
epcvaddr=0x401013cb
depc=0x00000000
▒tn_add=0x40100328
Solution see below (last comment)
Compilation under MacOSX fails (paths shortened, output formatted):
...
xtensa-lx106-elf-gcc -L$ESP8266_RTOS_SDK/lib -Wl,--gc-sections -nostdlib \
-T$ESP8266_RTOS_SDK/ld/eagle.app.v6.ld \
-Wl,--no-check-sections -u call_user_start -Wl,\
-static -Wl,--start-group -lminic -lgcc -lhal -lphy -lpp -lnet80211 \
-lcrypto -lwpa -lmain -lfreertos -llwip -lssl -ljson -lsmartconfig \
-lpwm -L./libesphttpd -lesphttpd -lwebpages-espfs \
user/.output/eagle/debug/lib/libuser.a driver/.output/eagle/debug/lib/libdriver.a \
upgrade/.output/eagle/debug/lib/libupgrade.a -Wl,--end-group \
-o .output/eagle/debug/image/eagle.app.v6.out
$ESP8266_RTOS_SDK/lib/libjson.a(cJSON.o):(.text.print_number+0x48): undefined reference to `floor'
$ESP8266_RTOS_SDK/lib/libjson.a(cJSON.o):(.text.print_number+0x148): undefined reference to `floor'
$ESP8266_RTOS_SDK/lib/libjson.a(cJSON.o):(.text.parse_value+0x14): undefined reference to `pow'
$ESP8266_RTOS_SDK/lib/libjson.a(cJSON.o):(.text.parse_value+0x270): undefined reference to `pow'
Including -lm
fails with .../newlib-2.0.0/.../w_pow.c:198: more undefined references to __errno follow
diff --git a/Makefile b/Makefile
index 1e70fd0..4032482 100644
--- a/Makefile
+++ b/Makefile
@@ -81,6 +81,7 @@ LINKFLAGS_eagle.app.v6 = \
-llwip \
-lssl \
-ljson \
+ -lm \
-lsmartconfig \
-lpwm \
-L./libesphttpd \
Please rollback a change made in 10.25.2016 08:27:15 by SeregaKai.
abs function was placed not just by mistake. Looks like it converts "unsigned int" to "int" inside itself and then really changes bitwise representation if int result is negative.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.