- Fri Jan 22, 2016 10:30 pm
#39471
Yes, there is a serial terminal output on each URL request ([po.pin] is called with URL request). How this issue can be solved?
Also, pls give solution to AP mode. Find code below:.
Default Program:
=====================
msgbranch [mybranch]
print "You can send msgs to the esp and do things based on accessing a URL"
let pin_No = 2
let pinStat = 0
let KeyCode = "Channel"
print "Pin Number"
textbox pin_No
print "Pin Stat"
textbox pinStat
print "Key-Lable"
textbox KeyCode
print "<br>"
button "Set Pin" [SetThePin]
button "Set Pin PWM" [SetThePinPWM]
button "Set Servo" [SetThePinServo]
button "Exit " [TestExit]
button "GetIP" [GetIP]
button "Load-myip-Prg" [RunProg]
wait
[SetThePin]
po pin_No pinStat
serialprint KeyCode
serialprint " : "
serialprintln pinStat
wait
[SetThePinPWM]
pwo pin_No pinStat
wait
[SetThePinServo]
servo pin_No pinStat
wait
[GetIP]
wprint "<br>"
wprint "IP:("
wprint ip()
wprint ")</br>"
wait
[RunProg]
load myip
wait
[mybranch]
MyReturnMsg = "Not a valid msg received"
msgget "pin" pinNo
msgget "stat" pinStatus
msgget "action" pinAction
msgget "KeyCde" keyCDE
if pinAction == "po" then gosub [po.pin]
if pinAction == "pi" then gosub [pi.pin]
if pinAction == "pwo" then gosub [pwo.pin]
if pinAction == "pwi" then gosub [pwi.pin]
if pinAction == "ai" then gosub [ai.pin]
print "DOne with retrn code"
msgreturn MyReturnMsg
wait
[po.pin]
po pinNo pinStatus
MyReturnMsg = keyCDE
serialprint keyCDE
serialprint " : "
serialprintln pinStat
return
[pi.pin]
pi pinNo MyReturnMsg
return
[pwo.pin]
pwo pinNo pinStatus
MyReturnMsg = "good"
return
[pi.pin]
pwi pinNo MyReturnMsg
return
[ai.pin]
ai MyReturnMsg
return
==========================================================================
WIFI Setting Code:
memclear
let ssid = " "
let password = " "
let ssid1 = " "
let password1 = " "
print "Remote WIFI(SSID):"
read "APname" ssid2
textbox ssid2
print "Remote WIFI PASSWORD:"
read "APpass" password2
textbox password2
button "Make AP" [create_ap]
print "<br>"
print "Router WIFI(SSID):"
read "WIFIname" ssid12
textbox ssid12
print "Router WIFI PASSWORD:"
read "WIFIpass" password12
textbox password12
print "<br>"
button "Connect-Router" [Connect-Router]
button "Load Default Prog" [RunProg-1]
button "getName" [GetName]
wait
[RunProg-1]
load default
wait
[create_ap]
ap ssid2 password2
wait
[Connect-Router]
connect ssid12 password12
wait
[GetName]
read "WIFIname" ssid2
print ssid2
read "WIFIpass" password2
print password2
read "APname" ssid12
print ssid12
read "APpass" password12
print password12
wait
end