conn:send('some string', wait())
but it does not seem to work.
Am I close? in left field? in the wrong zip code? What should the code look like that invokes the callback?
Explore... Chat... Share...
conn:send('some string', wait())
if using nodemcu after 0.9.6 use the Call Back's
Send 1
CB send 2
CB send x
CB close
Web page code is in flash -- loaded by require
-------------------------------
local function LBuf(scnt,c)
LBx = require("LB"..scnt) -- load LB0,1,2,3,4
local cbuf = LBx.B0()
vt[scnt] = #cbuf
if #cbuf>=1455 then
c:send(scnt.."---C Buffer > 1455 Error---\r\n")
else
c:send(cbuf)
end
cbuf = nil
package.loaded["LB"..scnt]=nil
collectgarbage()
end
============================================================================
--Rcv80 function snip
rfh=vt.rfh
cmx = vt.cmx
if vt.pass1 == 1 then vt.pass1=0 else vt.pass1=1 end
if vt.pass1 == 0 then vt.pass = vt.pass+1 end
collectgarbage()
Scnt=0
Send80(c)
end ----------------- end of Rcv80 function
=============================================================================
function Send80(c)
if Scnt==0 then -- 1st CB
LBuf(0,c) --LBuf(Scnt,c)
elseif Scnt==1 then -- 2nd CB
LBuf(1,c) --LBuf(Scnt,c)
elseif Scnt==2 then -- 3rd CB
LBuf(2,c) --LBuf(Scnt,c)
elseif Scnt==3 then -- 4th CB
while vt.pend == 1 do -- wait if [D] working
end
--LBuf(3,c)-- LBuf(Scnt,c)
vt[4]=100
local cbuf='<div><textarea name="cmds" cols="70" rows="18">'
..vt.sbuf..'</textarea></div><br>'
..vt[0].." | "..vt[1].." | "..vt[2].." | "..vt[3].." | "..vt[4].." | "
..vt[0]+vt[1]+vt[2]+vt[3]+vt[4].." Baud: "..vt.baud.." | "..vt.lua
vt[Scnt] = #cbuf
c:send(cbuf)
cbuf = nil
collectgarbage()
end
if Scnt >=4 then -- 5th - Last CB
c:close()
c=nil
collectgarbage()
end
Scnt=Scnt+1 --- increment the counter
vt.Lcb=vt[0]+vt[1]+vt[2]+vt[3]+vt[4] --vt[4]
collectgarbage()
end --function end
It takes about 20-25 seconds for home assistant c[…]
I tried to upgrade tof my sonoff basic R2 with the[…]
a problem Perhaps you want to define "Probl[…]
Rebooting your router will not give you a faster I[…]
There are no other notifications from esptool.py i[…]
Using the Arduino IDE, you'll learn how to set up […]
In this project, you will post to Twitter using an[…]
In this project, we will build a water level contr[…]
I guess I'm late, but I had the same problem and f[…]
Last night I received my first D1 Minis for a lear[…]
Although I am aware that this is an old post, I fe[…]