-->
Page 1 of 4

Command (light LED) does not work for external ip

PostPosted: Fri Oct 07, 2016 10:58 am
by rodrigocirilo
Hello. I ask your help because I made a small code to be able to trigger an LED (pin 2 nodemcu ESP12E) and accessing the local network works and nodemcu responds to the request.

Then I opened a router port and dedicated to an ip that gave the ESP. Then I do access via smarfone (4G internet) and access to the page ESPbasic he already is to run automatically program.bas, so I send command and esp does not respond !! I wonder why?

Here the code:

let pinNo = 2
let pinstat = 0
print "porta"
textbox pinNo
print "status"
textbox pinstat
button "aciona",[SetThePin]
button "exit",[TestExit]
wait

[SetThePin]
io(po,pinNo,pinstat)
if pinstat = 0 then
pinstat = 1
else
pinstat = 0
end if
wait

[TestExit]
end

Re: Command (light LED) does not work for external ip

PostPosted: Fri Oct 07, 2016 2:11 pm
by Mmiscool
You need to port forward port 80 qnd 81 on your router in order to access the web interface from an external ip address. You can then send from your external ip address.

Re: Command (light LED) does not work for external ip

PostPosted: Fri Oct 07, 2016 3:54 pm
by rodrigocirilo
I forward port 8282 to the IP ESP, and the settings settings esp I put this IP and this port. I can access the inerface an external IP, but the small command code I have done, which is to light the LED pin 2 nodemcu not work.

Since the local network it triggers normal.

look:
Image

Re: Command (light LED) does not work for external ip

PostPosted: Sat Oct 08, 2016 3:52 pm
by Oldbod
As you're using a nodemcu, how about putting some serialprint commands in at various points in your program to show whats being activated when? A simple terminal emulator is all you need to see them, if you haven't used one before I've been using this https://sites.google.com/site/terminalbpp/ for a few weeks - it works fine.

Mimiscool posted a very simple example for this a while back, which showed how to access an internal esp8266 then from that unit control a second esp8266 and blink the led. I simplified that even further to blink the led on the first unit accessed. It works fine using ports 80 and 81. I'd get it working that way, then think about changing your port numbers.

Is it that the led doesnt blink, or that you don't get the communications to your phone that you expect?