Parallax Wifi Module and the WWW
AwesomeCronk
Posts: 1,055
Hello, in the spirit of Mother's Day, I made a (very)basic webpage reflecting her, and loaded it on my Wifi Module. She sent the URL to my grandmother, and it only worked on OUR Wifi. I am sure that a webpage can be sent to the World Wide Web with Javascript, but I do not know how. Does anybody have any JavaScript syntax to do this?
Comments
How would one do that? I do not have a router. Could I get another ESP8266 and make it function as a router that would do this?
Assuming you have a simple network
Internet<---->Router with Wifi<---->WX module
You need to make changes on your router. You need to do port forwarding from the outside to the inside. It's normally under NAT section of your router. Some times call virtual servers. You will need to google your router type to find this out. Seems like every manufacture has a different approach.
Or put you page on a free www service and skip all this.
How are you connecting to the Internet? In my case I've got a WiFi enabled router routing around me the addresses of 192.168.1.100 to 192.168.1.124, and it is connected to my service provider's gadget who also supplies my phone service. The router interacts with a DDNS service to make whatever I need it to be allowed to be available. For a while that was how, my website, gregg.levine.name delivered to the rest of you.
When I switched service providers I switched to making it available from the same cloud based service that's handling our hosts service.
Depending on your service provider's gadget methods it might be possible to have your device facing it and using a DDNS service to properly enable it. Look up DDNS providers in Google and pick one who can provide what you want for free from there it should be possible.
Incidentally I strongly suggest that you should get a router, your computer's firewall may be working well for you, but you do need the router for its own methods. Do not buy a NetGear one or a D-Link one, both of those are impossible for what we do, they are nearly impossible to setup properly.
you are diving in uncharted waters.
Generally your internet-provider does not at all want you to run a Webserver from Home. For that they have way more expensive contracts with a fixed IP-Address and a registered Domain-Name.
So your provider gives you - mostly daily - a new public IP-Address and you can not register a Domain-name on it, because it is changing constantly.
Furthermore usually the IPs also block all traffic to port 80 of your current public IP - the standard webserver port. They do not want you to run a Webserver, see above.
Then they usually install a modem/router for you to access the internet over your dynamic IP, providing you with a internal network with internal IPs out of the 10.x.x.x range or the 192.168.x.x range, known as private internet addresses, not callable over the internet.
And that modem/router/firewall combination is ALSO set to block all incoming transfer, by standard settings.
Naturally this is all done to protect your home-connection to the internet from bad people. And to protect you from using your own Internet connection for PROVIDING services instead of using them.
Except you buy a more expensive commercial contract.
Or trick them out.
To do the later you need to do the following steps.
First you need access to the modem/router/firewall from your provider. That thing sitting in your house.
Usually you find ip-address, name and password either on that box or in your documents.
something like
192.168.1.1 user admin passwort whatever
Then you need to start your browser and type the ip in, some login screen might appear.
If lucky you end up in some configuration web-site, but be aware that every model/provider/ region have different boxes, so there are hundreds of different configuration websites.
So basically you are on your own there and have to scan the menus for port redirection settings.
You need to configure the internal local IP-address for your WX module and give it a port number- usually on the WX
And then you have to allow external requests on - say - port 3210 of your external address and redirect them to port 80 of your internal WX address.
Good luck with that step, google might help.
Then you finally are able to reach your WX module over another internet connection - your next door friends - on the current external ip address your provider gives you every 24 hours.
you will need to type in the browser something like http://123.123.123.123:3210/
where 123.123.123.123 is to replaced with your current external IP address and :3210 is to replaced by the port number you set up in your router.
If you have done all of that successful it will work, but every 24 hours change the address.
If you ever get to this point there are solutions like dyndns to solve that last hurdle.
And you have to remember that all these steps are needed to protect you from the evil internet. If you want to serve websites instead of consuming them.
Mike
Hello!
Mike..... That's exactly how I explained things. I know about Century Link. I certainly hope they are doing good things for you and yours. They have a very low to the ground reputation. Which is just above Comcast and Cox. Oddly enough TWCNY bought Charter to save them from being underground as far as providers goes, that is below that setting. And you don't want Cablevision, they needed to be bought out to prevent them from going out of business badly......
Anyway both Mike and I have summarized it perfectly. Oddly enough most service providers want people to make use of a router to the Internet connection of the MODEM.. Oddly enough the company that I switched from did not. They just refused to believe that 99% of their customers knew more then they did. However Spectrum just does not mind in my case.
So if you have any other questions? Please do ask.
But all of this is just needed to allow incoming traffic to find your WIFFY module.
If you have access to one existing webserver/webspace, say you own a domain and can access the files for the domain, you can build some web-pages, and scripts on that external webserver.
Then use the wify-module to talk to that server to transfer information there and access the information from there.
The configuration of modem/router/firewall usually just blocks INCOMING connections, OUTGOING connections are usually not blocked.
So your WIFY module can call out into the internet, but the internet can't call in.
Mike
http://whatismyip.com
Do it several days in a row. Contrary to what msrobots says, I'll bet the results stay the same. If they do, you can publish that address as a way to access your device -- at least until your power-off/reset your modem.
But that's not the end. You'll also have to "punch a hole" in your modem/router's firewall to allow incoming connections. I can't go into that here, but there is plenty of help online for how to do that.
-Phil
if you would have read the thread you might have noticed that the OP does NOT want to mess with poking a hole somewhere ...
So whatsmyip and dyndns does not cut it for him.
Enjoy
Mike
-Phil
I only say this from my own experience. My cable modem lets anything through in both directions. So I've interposed a Linux computer between it and my home network. I configured the Linux firewall to be quite restrictive, but I was able to code some exceptions for external access to some IoT experiments.
So if the modem does not include a router, and if it lets everything through, buy a cheap router to put between the modem and your equipment. Then you can configure that without touching the modem itself.
-Phil
I believe, however, that my Modem is both. My mother says that the firewall on it is designed to prevent anyone from accessing our network without a passphrase.
-Phil
So I will have to wait until I have my own network, then?
-Phil
I have decided to go with your idea. I am exrtemely inexperienced with HTML, so I tried a google search, which revealed nothing. I tried W3 Schools, which I could not make any sense of. Do you know of any source that explains how to request info from another webpage?
https://www.wired.com/2010/02/ftp_for_beginners/
-Phil
Uploading a file, having the site edit the file based on input, and then having my module request the updated file also works.