我无法从 Web 服务器获得任何输出到无线客户端。我使用的确切脚本(逐字)似乎比我尝试过的任何其他脚本都更加优雅和稳定。
将上面链接中的 3 个脚本上传到 NodeMCU Dev (ESP8266-12E) 并按下复位后,脚本会按预期通过串口输出状态:
Communication with MCU...
Got answer! AutoDetect firmware...
NodeMCU firmware detected.
=node.hStatus = 0 (Idle)
eap()
36936
> Status = 0 (Idle)
Status = 0 (Idle)
Status = 0 (Idle)
{ repeats for 30 seconds ... }
Status = 0 (Idle)
Status = 0 (Idle)
network not found, switching to AP mode
Starting up AP with SSID: Unconfigured-2c:36
GET received
上面的输出显示我用另一个客户端连接到这个 AP(收到 GET),但客户端上从来没有任何输出。浏览器页面为空白。
输出 HTML 页面调用的函数位于 configServer.lua 中:
function sendPage(conn)
conn:send('HTTP/1.1 200 OK\n\n')
...
这些conn:send()
语句都不会在客户端上生成任何输出。我尝试过使用多个客户端和多个浏览器。我还在print()
这个例程中设置了一些语句,并且可以看到它正在完全执行。
有谁知道什么类型的问题会导致这种情况或如何解决它?似乎这些脚本对其他尝试过它们的人来说效果很好。
我运行使用http://nodemcu-build.com构建的 NodeMCU 。它基于 SDK v1.4.0。它似乎工作得很好:
NodeMCU custom build by frightanic.com
branch: master
commit: c8037568571edb5c568c2f8231e4f8ce0683b883
SSL: false
modules: adc,bit,cjson,coap,crypto,dht,enduser_setup,file,gpio,i2c,mqtt,net,node,pwm,rtctime,spi,tmr,u8g,uart,wifi
build built on: 2016-02-03 23:59
powered by Lua 5.1.4 on SDK 1.4.0