ESP8266_RTOS_SDK & ESP8266_IOT_PLATFORM

backupluis
Posts: 9
Joined: Tue Nov 29, 2016 11:10 am

ESP8266_RTOS_SDK & ESP8266_IOT_PLATFORM

Postby backupluis » Tue Nov 29, 2016 12:23 pm

I'm playing with IOT_PLATFORM example Plug since a few days ago,
everything goes well but the web server only serve 2 files and get doing nothing,
on the client side, firefox in this case, keeps waiting for a long time for the thirt file,
in this case should be plug_off.png, but the server never respond nor get notified about
this request.

I have some logs from the device, some exists in the source code and anothers where added by myself to track the problem, but still got no idea why.

To do my test I've disabled file compression to keep the things simple, anyway with file compression the problem is the same.
I've check the repo of the libesphttpd and is very updated since the update in the repo of espressif. But I have not enought knowledge of the platform to integrate the updates by myself.

Please, can you check if the ESP8266_IOT_PLATFORM is responding well via http with the new RTOS 1.5 and/or update the repo files with a newer version of the library?

I was searching in the forums and didn't see a similar problem, maybe nobody use this example or they are using it with an older SDK version. Added (30/11/2016): (or just they are using the example with the Android app and not trying the embedded web server).

I only found an align problem with files and that the espFsInit was not called before, I made that changes and start to work but the webserver don't serve more than 2 files, even incrementing MAX_CON or the heap size to the task.

Added (30/11/2016): I just put the content of .js and .css inside the html file to reduce the number of requested files and works, this mean that the web server got stuck serving more that two files, the module don't reset nor even hangs, just stop to serve files if more than two files are requested at the same time (like most of the browsers do). If I just request index.html via telnet after that request .js and after .png the three files came fine.

Is there any chance that someone test the example with SDK v1.5 and requesting the files via http? This is my first time with RTOS and I don't know how the this OS handle sockets yet, I'm trying to implement gdb debugging but It will take some time to work.


Regards
Luis



Code: Select all

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



Just once, it serve the files well, this is the log in this case, but keep logging dummy for hours


Code: Select all

I-httpserver acpt index:0 sockfd 3!
W-index 0, sockfd 3, dummy?
I-Change of maxfdp 3
I-readable recv sockfd 3 len=322
I-readable recv sockfd 3 ret=0, close
I-Change of maxfdp 0
I-httpserver acpt index:0 sockfd 3!
W-index 0, sockfd 3, dummy?
I-Change of maxfdp 3
I-readable recv sockfd 3 len=332
I-espFsOpen file: index.html
I-      espFsOpen 0x3fff9f60, p = 0x4022b76c
I-      Found file '140medley.min.js'. Namelen=20 fileLenComp=825, compr=0 flags=0
I-      espFsOpen 0x3fff9f60, p = 0x4022bacc
I-      Found file 'plug_off.png'. Namelen=16 fileLenComp=3429, compr=0 flags=0
I-      espFsOpen 0x3fff9f60, p = 0x4022c854
I-      Found file 'index.html'. Namelen=12 fileLenComp=1917, compr=0 flags=0
I-Found requested file
I-File id: 3fff60a0 (index.html)
I-Reading File id: 3fff60a0 1024 bytes from 4022c870
I-lwip_write status 1024
I-httpserver acpt index:1 sockfd 4!
W-index 1, sockfd 4, dummy?
I-Change of maxfdp 4
I-readable recv sockfd 4 len=284
I-espFsOpen file: 140medley.min.js
I-      espFsOpen 0x3fff9f60, p = 0x4022b76c
I-      Found file '140medley.min.js'. Namelen=20 fileLenComp=825, compr=0 flags=0
I-Found requested file
I-File id: 3fff64e8 (140medley.min.js)
I-Reading File id: 3fff64e8 825 bytes from 4022b790
I-lwip_write status 825
I-cgiEspFsHook finish sending file Id: 3fff64e8
I-espFsClose 3fff64e8
I-httpserver destruction close sockfd 4
I-Change of maxfdp 3
captdns stack 18, heap 12872
I-httpdserver sock_fd 3 timeout!
I-Reading File id: 3fff60a0 893 bytes from 4022cc70
I-lwip_write status 893
I-cgiEspFsHook finish sending file Id: 3fff60a0
I-espFsClose 3fff60a0
I-httpserver close sockfd 3 4timeout!
I-Change of maxfdp 0
I-httpserver acpt index:0 sockfd 3!
W-index 0, sockfd 3, dummy?
I-Change of maxfdp 3
I-readable recv sockfd 3 len=279
I-espFsOpen file: plug_on.png
I-      espFsOpen 0x3fff9f60, p = 0x4022b76c
I-      Found file '140medley.min.js'. Namelen=20 fileLenComp=825, compr=0 flags=0
I-      espFsOpen 0x3fff9f60, p = 0x4022bacc
I-      Found file 'plug_off.png'. Namelen=16 fileLenComp=3429, compr=0 flags=0
I-      espFsOpen 0x3fff9f60, p = 0x4022c854
I-      Found file 'index.html'. Namelen=12 fileLenComp=1917, compr=0 flags=0
I-      espFsOpen 0x3fff9f60, p = 0x4022cff0
I-      Found file 'plug_on.png'. Namelen=12 fileLenComp=3959, compr=0 flags=0
I-Found requested file
I-File id: 3fff60f8 (plug_on.png)
I-Reading File id: 3fff60f8 1024 bytes from 4022d00c
I-lwip_write status 1024
I-Reading File id: 3fff60f8 1024 bytes from 4022d40c
I-lwip_write status 1024
I-httpserver acpt index:1 sockfd 4!
W-index 1, sockfd 4, dummy?
I-Change of maxfdp 4
I-Reading File id: 3fff60f8 1024 bytes from 4022d80c
I-lwip_write status 1024
W-index 1, sockfd 4, dummy?
I-Reading File id: 3fff60f8 887 bytes from 4022dc0c
I-lwip_write status 887
I-cgiEspFsHook finish sending file Id: 3fff60f8
I-espFsClose 3fff60f8
W-index 1, sockfd 4, dummy?
I-httpserver destruction close sockfd 3
W-index 1, sockfd 4, dummy?
captdns stack 18, heap 13032
W-index 1, sockfd 4, dummy?
W-index 1, sockfd 4, dummy?
W-index 1, sockfd 4, dummy?
W-index 1, sockfd 4, dummy?
W-index 1, sockfd 4, dummy?
W-index 1, sockfd 4, dummy?
W-index 1, sockfd 4, dummy?
W-index 1, sockfd 4, dummy?
W-index 1, sockfd 4, dummy?
W-index 1, sockfd 4, dummy?

cutelove
Posts: 3
Joined: Sat Feb 25, 2017 8:17 pm

Re: ESP8266_RTOS_SDK & ESP8266_IOT_PLATFORM

Postby cutelove » Sat Feb 25, 2017 9:13 pm

I got the same problem!!!

Do you have solved it or not?

backupluis
Posts: 9
Joined: Tue Nov 29, 2016 11:10 am

Re: ESP8266_RTOS_SDK & ESP8266_IOT_PLATFORM

Postby backupluis » Tue May 30, 2017 2:27 pm

Not at all, yesterday I update libesphttpd and works better but have new PROBLEMS, jejejee,
this platform is a never ending history, is like the man that answer all post but solve nothing.

https://github.com/Spritetm/libesphttpd

Really a nightmare.

Regards
Luis

milesstone
Posts: 25
Joined: Mon Apr 26, 2021 4:50 pm

Re: ESP8266_RTOS_SDK & ESP8266_IOT_PLATFORM

Postby milesstone » Wed Jun 23, 2021 11:57 pm

backupluis wrote:I'm playing with IOT_PLATFORM example Plug since a few days ago,
everything goes well but the web server only serve 2 files and get doing nothing,
on the client side, firefox in this case, keeps waiting for a long time for the thirt file,
in this case should be plug_off.png, but the server never respond nor get notified about
this request.

I have some logs from the device, some exists in the source code and anothers where added by myself to track the problem, but still got no idea why.

To do my test I've disabled file compression to keep the things simple, anyway with file compression the problem is the same.
I've check the repo of the libesphttpd and is very updated since the update in the repo of espressif. But I have not enought knowledge of the platform to integrate the updates by myself.

Please, can you check if the ESP8266_IOT_PLATFORM is responding well via http with the new RTOS 1.5 and/or update the repo files with a newer version of the library?

I was searching in the forums and didn't see a similar problem, maybe nobody use this example or they are using it with an older SDK version. Added (30/11/2016): (or just they are using the example with the FMWhatsApp Android app and not trying the embedded web server).

I only found an align problem with files and that the espFsInit was not called before, I made that changes and start to work but the webserver don't serve more than 2 files, even incrementing MAX_CON or the heap size to the task.

Added (30/11/2016): I just put the content of .js and .css inside the html file to reduce the number of requested files and works, this mean that the web server got stuck serving more that two files, the module don't reset nor even hangs, just stop to serve files if more than two files are requested at the same time (like most of the browsers do). If I just request index.html via telnet after that request .js and after .png the three files came fine.

Is there any chance that someone test the example with SDK v1.5 and requesting the files via http? This is my first time with RTOS and I don't know how the this OS handle sockets yet, I'm trying to implement gdb debugging but It will take some time to work.


Regards
Luis



Code: Select all

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



Just once, it serve the files well, this is the log in this case, but keep logging dummy for hours


Code: Select all

I-httpserver acpt index:0 sockfd 3!
W-index 0, sockfd 3, dummy?
I-Change of maxfdp 3
I-readable recv sockfd 3 len=322
I-readable recv sockfd 3 ret=0, close
I-Change of maxfdp 0
I-httpserver acpt index:0 sockfd 3!
W-index 0, sockfd 3, dummy?
I-Change of maxfdp 3
I-readable recv sockfd 3 len=332
I-espFsOpen file: index.html
I-      espFsOpen 0x3fff9f60, p = 0x4022b76c
I-      Found file '140medley.min.js'. Namelen=20 fileLenComp=825, compr=0 flags=0
I-      espFsOpen 0x3fff9f60, p = 0x4022bacc
I-      Found file 'plug_off.png'. Namelen=16 fileLenComp=3429, compr=0 flags=0
I-      espFsOpen 0x3fff9f60, p = 0x4022c854
I-      Found file 'index.html'. Namelen=12 fileLenComp=1917, compr=0 flags=0
I-Found requested file
I-File id: 3fff60a0 (index.html)
I-Reading File id: 3fff60a0 1024 bytes from 4022c870
I-lwip_write status 1024
I-httpserver acpt index:1 sockfd 4!
W-index 1, sockfd 4, dummy?
I-Change of maxfdp 4
I-readable recv sockfd 4 len=284
I-espFsOpen file: 140medley.min.js
I-      espFsOpen 0x3fff9f60, p = 0x4022b76c
I-      Found file '140medley.min.js'. Namelen=20 fileLenComp=825, compr=0 flags=0
I-Found requested file
I-File id: 3fff64e8 (140medley.min.js)
I-Reading File id: 3fff64e8 825 bytes from 4022b790
I-lwip_write status 825
I-cgiEspFsHook finish sending file Id: 3fff64e8
I-espFsClose 3fff64e8
I-httpserver destruction close sockfd 4
I-Change of maxfdp 3
captdns stack 18, heap 12872
I-httpdserver sock_fd 3 timeout!
I-Reading File id: 3fff60a0 893 bytes from 4022cc70
I-lwip_write status 893
I-cgiEspFsHook finish sending file Id: 3fff60a0
I-espFsClose 3fff60a0
I-httpserver close sockfd 3 4timeout!
I-Change of maxfdp 0
I-httpserver acpt index:0 sockfd 3!
W-index 0, sockfd 3, dummy?
I-Change of maxfdp 3
I-readable recv sockfd 3 len=279
I-espFsOpen file: plug_on.png
I-      espFsOpen 0x3fff9f60, p = 0x4022b76c
I-      Found file '140medley.min.js'. Namelen=20 fileLenComp=825, compr=0 flags=0
I-      espFsOpen 0x3fff9f60, p = 0x4022bacc
I-      Found file 'plug_off.png'. Namelen=16 fileLenComp=3429, compr=0 flags=0
I-      espFsOpen 0x3fff9f60, p = 0x4022c854
I-      Found file 'index.html'. Namelen=12 fileLenComp=1917, compr=0 flags=0
I-      espFsOpen 0x3fff9f60, p = 0x4022cff0
I-      Found file 'plug_on.png'. Namelen=12 fileLenComp=3959, compr=0 flags=0
I-Found requested file
I-File id: 3fff60f8 (plug_on.png)
I-Reading File id: 3fff60f8 1024 bytes from 4022d00c
I-lwip_write status 1024
I-Reading File id: 3fff60f8 1024 bytes from 4022d40c
I-lwip_write status 1024
I-httpserver acpt index:1 sockfd 4!
W-index 1, sockfd 4, dummy?
I-Change of maxfdp 4
I-Reading File id: 3fff60f8 1024 bytes from 4022d80c
I-lwip_write status 1024
W-index 1, sockfd 4, dummy?
I-Reading File id: 3fff60f8 887 bytes from 4022dc0c
I-lwip_write status 887
I-cgiEspFsHook finish sending file Id: 3fff60f8
I-espFsClose 3fff60f8
W-index 1, sockfd 4, dummy?
I-httpserver destruction close sockfd 3
W-index 1, sockfd 4, dummy?
captdns stack 18, heap 13032
W-index 1, sockfd 4, dummy?
W-index 1, sockfd 4, dummy?
W-index 1, sockfd 4, dummy?
W-index 1, sockfd 4, dummy?
W-index 1, sockfd 4, dummy?
W-index 1, sockfd 4, dummy?
W-index 1, sockfd 4, dummy?
W-index 1, sockfd 4, dummy?
W-index 1, sockfd 4, dummy?
W-index 1, sockfd 4, dummy?

A whole guide is available for this issue on espressif official site.

Who is online

Users browsing this forum: No registered users and 9 guests