A Basic Interpreter written from scratch for the ESP8266

Moderator: Mmiscool

User avatar
By AlbrechtMe
#64017 Hi, on my ESP-01s I have a little test program, which shows the internet IP:
Code: Select allcls
print "Who am I? "
button "IP", [IP]

print wget("www.stat-econ.uni-kiel.de/ip")

With the (nearly default) settings
any PC or smartphone in the local net at home using the local IP of the ESP gets a result by clicking this "IP button".
If I set a port forwarding in my router for ports 80-81 to the local IP of the ESP, all is working nice on any PC outside in the world.
If I forward only port 80, the button shows up, but does not work.
I want to use the ESP through a porttunnel with an IP filter, which uses only one port.
(So I could restict the users of the ESP web page to only a few IPs).
Even if I try to use two port tunnels (one for port 80 and one for port 81), the IP button does not work.
Where is the trick or background, that the second port 81 (WS port) is really needed for a simple web page like this? I made many web pages and programmed them by PHP or Delphi (!!!) and they only need normal HTML (and/or Javascript) and only one port to work.
User avatar
By forlotto
#68488 you can forward both ports internally to port 80 or whatever port is acceptable I think I used port 90 before in tests externally so all data flows through one port if I am not mistaken I believe this is how I did it for one of my devices of course I was using tomato firmware which is a bit more configurable. I would have to look into portunnel and the IP rules you are setting I guess ... For me you may want to use a nodemcu as a server and have it pull the strings of your devices using mymsgbranch and wget if you want feedback this way you have one device exposed or if you wanted to use a pi like some other folks are doing in similar projects.
User avatar
By Mmiscool
#68491 Yes. You need to port forward both ports 80 and 81.

Port 81 is used for web sockets.