Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template serve stops after first chunk, on certain ESP-8266 12E modules #374

Closed
JamesNewton opened this issue Jun 30, 2018 · 2 comments
Closed

Comments

@JamesNewton
Copy link

Known "good" code running on NodeMCU (which has an ESP-8266 ESP12E module) works perfectly.
https://github.com/JamesNewton/esp8266WebSerial

Same code programmed into ESP-12E and ESP-12F modules using NodeMCU circuit "works" until a web page with template processing is requested, then hangs. No crash, unit appears to continue processing, but web pages are no longer served. Web pages without template work until a web page with a template is requested, then they don't.

It appears that the first chunk is sent, and then nothing after.

It's possible something about our re-creation of the NodeMCU circuit is incorrect, as we are also NOT getting serial data back (and yet it programs?) so there are weird things going on. But why would it work for other pages?

Also, the library was modified to change the template character from % to ` (from percent to back tick) as per #333.

I'm only posting this here to 1. have a place to put it, 2. see if anyone else has seen this, 3. to close it out when I figure out what I've done wrong after documenting it.

@JamesNewton
Copy link
Author

JamesNewton commented Jun 30, 2018

Update: on pages served with the template processor, but with no data fields, the first chunk is served. With a data field, nothing comes back.

Breakthrough: All the failing units have no "VENDOR" name. Those came from 2 different sources. But... Units that say "VENDOR AI-THINKER" all work perfectly. Including the return serial data.

@JamesNewton
Copy link
Author

Confirmed over multiple units. Only the AI-THINKER units work. Closing. Hopefully this will help someone else in the future.

JamesNewton added a commit to JamesNewton/esp8266WebSerial that referenced this issue Jul 2, 2018
-DEBUG levels: 1 for serial only, 2 for serial and display.
-User config device baudrate, poweron initialization string, data extraction and display:
-- New /device.html page to configure all connected device options
-- Send config.pwronstr to device pwrondelay seconds after startup
-- Extract up to 3 data items returned from device for local display via scanf code:
   http://www.cplusplus.com/reference/cstdio/scanf/
-- Extracted values multiplied by slope plus offset and shown with name on the display
-global.h config load/save simplified with EEPROM.get / EEPROM.put.
-CONFIG_VER version number added. This update will clear prior config data to default!
-txbuf to hold data waiting to be sent to the device so we can send this in a debug message
-Support "hidden" /update page to upload web/js/css/etc files into SPIFFS for web server.
 This allows customization and rebranding for your solution without the need for Arduino code development.
 Put your own html/javascript in the device for user interface.
-Default web page is index.htm from SPIFFS. /root is handle_root from Page_Root.h
  i.e. http://ip/ will display nothing until index.htm is uploaded via http://ip/update.
  If you want to use the built in homepage, go to http://ip/root
  TODO: serve root automatically if no index.htm in SPIFFS
-Built in /root page converted from jquery to raw javascript for increased reliability and smaller size.
   This is critical when working in poor RF environments while directly connected to the device.
-Use template processor in ESPAsyncWebServer for config pages. There are problems with this, see:
-- me-no-dev/ESPAsyncWebServer#333 Must change TEMPLATE_PLACEHOLDER to '`'
    in \libraries\ESPAsyncWebServer\src\WebResponseImpl.h and trigger library re-compile
-- me-no-dev/ESPAsyncWebServer#374 Must use "AI-THINKER" ESP-12E units
-- Network setup /config.html NOT updated to templates for this reason.
-Moving to a single general tag processor function "send_tag_values"
-Moving to standard linking to .css and .js resources from config pages instead of the javascript window.onload functions.
-Add debugq macro to append to debugbuf for later output. This avoids delays when debugging web responses
-Increase max string length of ReadStringFromEEPROM from 60 to 65
-urldecode, avoids Strings, returns char*, expects length.
-urlencode, expects char* vs String (still returns String). Simplified via nibble2hex.
-HTMLencode added inorder to support all strings for scanf codes.
-Optional support for NeoPixel LEDs. NOT enabled by default.
-Start on a command processor language from server response or user input
BUGFIX:
IO pin 10 is NOT usable as SERIAL_ENABLE_PIN, back to IO5 D1
parseServer p1,p2 had not been initialized. Data returned from server for device could be lost.
JamesNewton added a commit to JamesNewton/esp8266WebSerial that referenced this issue Jul 2, 2018
-DEBUG levels: 1 for serial only, 2 for serial and display.
-User config device baudrate, poweron initialization string, data extraction and display:
-- New /device.html page to configure all connected device options
-- Send config.pwronstr to device pwrondelay seconds after startup
-- Extract up to 3 data items returned from device for local display via scanf code:
   http://www.cplusplus.com/reference/cstdio/scanf/
-- Extracted values multiplied by slope plus offset and shown with name on the display
-global.h config load/save simplified with EEPROM.get / EEPROM.put.
-CONFIG_VER version number added. This update will clear prior config data to default!
-txbuf to hold data waiting to be sent to the device so we can send this in a debug message
-Support "hidden" /update page to upload web/js/css/etc files into SPIFFS for web server.
 This allows customization and rebranding for your solution without the need for Arduino code development.
 Put your own html/javascript in the device for user interface.
-Default web page is index.htm from SPIFFS. /root is handle_root from Page_Root.h
  i.e. http://ip/ will display nothing until index.htm is uploaded via http://ip/update.
  If you want to use the built in homepage, go to http://ip/root
  TODO: serve root automatically if no index.htm in SPIFFS
-Built in /root page converted from jquery to raw javascript for increased reliability and smaller size.
   This is critical when working in poor RF environments while directly connected to the device.
-Use template processor in ESPAsyncWebServer for config pages. There are problems with this, see:
-- me-no-dev/ESPAsyncWebServer#333 Must change TEMPLATE_PLACEHOLDER to '`'
    in \libraries\ESPAsyncWebServer\src\WebResponseImpl.h and trigger library re-compile
-- me-no-dev/ESPAsyncWebServer#374 Must use "AI-THINKER" ESP-12E units
-- Network setup /config.html NOT updated to templates for this reason.
-Moving to a single general tag processor function "send_tag_values"
-Moving to standard linking to .css and .js resources from config pages instead of the javascript window.onload functions.
-Add debugq macro to append to debugbuf for later output. This avoids delays when debugging web responses
-Increase max string length of ReadStringFromEEPROM from 60 to 65
-urldecode, avoids Strings, returns char*, expects length.
-urlencode, expects char* vs String (still returns String). Simplified via nibble2hex.
-HTMLencode added inorder to support all strings for scanf codes.
-Optional support for NeoPixel LEDs. NOT enabled by default.
-Start on a command processor language from server response or user input
BUGFIX:
IO pin 10 is NOT usable as SERIAL_ENABLE_PIN, back to IO5 D1
parseServer p1,p2 had not been initialized. Data returned from server for device could be lost.

Merge branch 'master' of https://github.com/JamesNewton/esp8266WebSerial

# Conflicts:
#	esp8266WebSerial.ino
#	global.h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant