WiFi Module And BS2
jack3585
Posts: 3
in BASIC Stamp
I am following the tutorial that teaches how to turn on leds from a web page. That's fine and it works with the web page loaded in the wifi module which is connected to my LAN.
What i'm not getting is how to access that page from the internet at some remote location.
Any help?
Jack3585
What i'm not getting is how to access that page from the internet at some remote location.
Any help?
Jack3585
Comments
[edit] Sorry, I didn't notice the BS2 in the title, so most of this (below) is Propeller-centric. At any rate, I'll try a test on my home router and report the steps.[/edit]
In the meantime, there are some examples in ...\parallax-esp-2016-11-02-1804-x\Examples\Propeller C that make the Wi-Fi module get information and send updates through various services.
- IFTTT Send Email.side
- Temperature from OpenWeatherMap.side
- Text from www page with TCP.side
Tutorials for these are in the queue, but not posted yet.
The OpenWeatherMap app is pretty straightforward, just subscribe to a free account, and use the info they give you in the program.
If-This-Then-That takes a little work to figure out how to set up their events after setting up the account. Here are the details of the Maker Event I created to make IFTTT Send Email.side work:
If Maker Event "MicrocontrollerEvent", then send an email from SomeTempAddressYouCreated@gmail.com
Receive a web request
This trigger fires every time the Maker service receives a web request to notify it of an event. For information on triggering events, go to your Maker service settings and then the listed URL (web) or tap your username (mobile)
Event Name
The name of the event, like "button_pressed" or "front_door_opened"
Send an email
This Action will send an email to up to five recipients from your Gmail account.
To address
SomeTempAddressYouCreated@gmail.com
Subject
The event named "MicrocontrollerEvent" occurred on the Maker service
Body (optional)
What: {{EventName}}<br>
When: {{OccurredAt}}<br>
Extra Data: {{Value1}}, {{Value2}}, {{Value3}},
Many of the routers I have worked with require a static IP address in order to use Port Forwarding properly.
You'll have DHCP issues on the LAN and WAN. For the LAN, use the reservation, or set a static IP on the device. For the WAN, you can get something like this - http://www.noip.com/free
What router are you using?
If you're troubleshooting using ping, you may or may not be able to ping your router from afar. There's usually a setting called "allow ICMP echo" that needs to be enabled for ping to work.
The firewall is going to block LAN traffic from the WAN. If you're on your LAN, be sure to use the LAN IP (and port 80), not the WAN IP (and port 12000) or the NoIP hostname, as they will not be reachable from your LAN (with most routers).
Start by making sure you can access an application web page with your BS2 and Wi-Fi module joined to your home router's network using these pages:
- Test the BS2 to Webpage Connection
- Join Another Wi-Fi Network
Make sure that you can go to the ip address that your wireless router assigned your Wi-Fi module. For example, if it assigned your Wi-Fi module 192.168.1.100, make sure that http://192.168.1.100/files/val-from-micro.html works.
Next is the tricky part since the approach will vary with Wi-Fi router. For example, if you have a DLINK DIR-625 or ATT UVerse router, instructions on this page (starting at "Setting up the router for port forwarding") are helpful.
http://internetofhomethings.com/homethings/?p=490
Those two examples might either be enough to tweak the settings on your router, or at least provide search nomenclature for a similar example that uses your router. I followed the AT&T NGV-589 instructions on the page. Even though I have a different model, the the overall link path was similar. I used 12000 to 12000 as the port range and mapped it to port 80 on the connection to my Wi-Fi module.
After that, I went to http://www.whatsmyip.org/ to find my router's address (though it's also accessible while you are in the router's configuration pages). For this example, I'll use 123.456.789.123.
Then, I used my phone (disconnected from the network) to go to http://123.456.789.123:12000/files/val-from-micro. The page came up, and I clicked the button repeatedly and got new values from my BS2. Fun!
Welcome to the forums!
First attempt sounds like a winner.