-->
Page 1 of 1

button problem through internet

PostPosted: Mon Nov 13, 2017 7:07 am
by jijix
Hi I made simple wireless switch. All working very good in local network. Through internet I see interface, but the buttons not working. Can you advice me? This is my code:
Code: Select all
cls 
let pinNo = 0
Timer 300, [refresh]
wprint "Led Lamp Kitchen & Temperature"
wprint "<hr width=350 align=left>"
wprint "<p>"
button " ON ", [SetThePinON]
wprint " "
button " OFF ", [SetThePinOFF]
wprint " "
button "Refresh", [TestExit]
wprint "<p>"
wprint "Relay status:"
wprint "<width=30> "
textbox pinStat
wprint "<br>"
wprint "Temperature:"
textbox curr
wait

[SetThePinON]
let pinStat  = "On"
io(po,pinNo,1)
wait

[SetThePinOFF]
let pinStat  = "Off"
io(po,pinNo,0)
wait

[TestExit]
wprint "<a href=''></a>"

[refresh]
curr = round(temp(0))
Wait


Re: button problem through internet

PostPosted: Mon Nov 13, 2017 3:44 pm
by Electroguard
I'm not in a position to try your code, but the first thing you should do is reduce the length of your var names to 10 or less.
Var name length was restricted to 10 characters the last I heard, so if you take the first 10 characters of your button [SetThePinON] and [SetThePinOFF] branches they both result in SetThePinO

Re: button problem through internet

PostPosted: Tue Nov 14, 2017 1:52 am
by jijix
Thank you. I tried this, but it is not the reason. Another ideas?

Re: button problem through internet

PostPosted: Wed Nov 15, 2017 12:06 pm
by Electroguard
If your script works locally, and you can connect to it from over the internet but not activate the buttons, my guess would be that you only have port 80 passing through your firewall, which is blocking your port 81 web-socket connection.