General area when it fits no where else

Moderator: Mmiscool

User avatar
By jijix
#71812 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

User avatar
By Electroguard
#71824 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
User avatar
By Electroguard
#71866 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.