Making the XBee WiFi module accessible via the internet
MJHanagan
Posts: 189
I got an XBee WiFi module the other day and managed to get it configured on my home WiFi network. Using techBASIC installed on my iPhone I successfully connected to the XBee WiFi module and can send serial data back and forth with relative ease. The XBee module is wired to a Propeller Activity Board so I can turn LEDs on and off using a simple app on my iPhone.
The next feat I wish to accomplish is to do the same type of serial data communication with the XBee when I am not home (i.e. not connected to my home WiFi). As you might have guessed this is the beginnings of some home automation with remote capabilities.
It seems from this link (http://www.savagecircuits.com/content.php?201-XBee-Wi-Fi-via-WAN-IP) that this can be done. However, I am in no way internet savvy and so starting from the lowest of levels. From what I have been able to piece together I need to do something called "port forwarding" on my home router in order to expose the XBee to the internet. My home internet service is Verizon FIOS. To complicate things a bit more I have an Apple Time Capsule hard wire connected to the FIOS router. The XBee and my iPhone connect to the Time Capsule's WiFi and not the FIOS WiFi. So I am guessing I need to do some type of port forwarding on the FIOS router to expose the Time Capsule and then port forward on the Time Capsule to the XBee. Does this sound right? Can someone point me in the right direction of how to get my XBee exposed to the internet?
Assuming my XBee is now "open" to the internet can I expect to use the same techBASIC openTCPIP( filenum, IPaddr, port, ) routine to establish a TCP link with the XBee via the WWW? This sounds a little too easy to be true, but would be great if it were! Are there any step-by-step instructions on how to communicate with an XBee WiFi module via the internet?
By the way, for those just learning the basics of these XBee WiFi modules you should ave a look at this Savage Circuit video of using the XCTU to configure the S6B modules: http://www.savagecircuits.com/content.php?219-Short-Circuits-3-XBee-Wi-Fi-Setup-for-Existing-Wireless-Networks Chris did a really nice job of explaining some of the basics of these nifty devices. Thank you, thank you, thank you!!
The next feat I wish to accomplish is to do the same type of serial data communication with the XBee when I am not home (i.e. not connected to my home WiFi). As you might have guessed this is the beginnings of some home automation with remote capabilities.
It seems from this link (http://www.savagecircuits.com/content.php?201-XBee-Wi-Fi-via-WAN-IP) that this can be done. However, I am in no way internet savvy and so starting from the lowest of levels. From what I have been able to piece together I need to do something called "port forwarding" on my home router in order to expose the XBee to the internet. My home internet service is Verizon FIOS. To complicate things a bit more I have an Apple Time Capsule hard wire connected to the FIOS router. The XBee and my iPhone connect to the Time Capsule's WiFi and not the FIOS WiFi. So I am guessing I need to do some type of port forwarding on the FIOS router to expose the Time Capsule and then port forward on the Time Capsule to the XBee. Does this sound right? Can someone point me in the right direction of how to get my XBee exposed to the internet?
Assuming my XBee is now "open" to the internet can I expect to use the same techBASIC openTCPIP( filenum, IPaddr, port, ) routine to establish a TCP link with the XBee via the WWW? This sounds a little too easy to be true, but would be great if it were! Are there any step-by-step instructions on how to communicate with an XBee WiFi module via the internet?
By the way, for those just learning the basics of these XBee WiFi modules you should ave a look at this Savage Circuit video of using the XCTU to configure the S6B modules: http://www.savagecircuits.com/content.php?219-Short-Circuits-3-XBee-Wi-Fi-Setup-for-Existing-Wireless-Networks Chris did a really nice job of explaining some of the basics of these nifty devices. Thank you, thank you, thank you!!
Comments
I took a stab at the port forwarding on my FIOS router without success. I have an Actiontec MI424WR Rev I router. My S6B has a static IP address of 10.0.1.38 and uses port 9720 (hex 2000). Here are the networking and address setting on the module:
Address settings: Network settings:
And here is how I attempted the port forwarding:
It seems to have been accepted by the router:
I can use my WIFI TCP Test Tool on my iPhone to connect to the module using an IP address of 10.0.1.38 and port 9750. Using the XCTU tool I can send data to my iPhone app and receive data sent by the iPhone.
I then got my router's IP address using whatismyip.com. I disconnected my iPhone from my WiFi network and used the cell phone connection. I then replaced the 10.0.1.38 address with the router's IP address and used the same 9750 port but unfortunately I could not connect to the XBee module using my iPhone.
Any thoughts as to where I went wrong with the port forwarding?
Also you mentioned port 9720 and 9750, looks like you have 9750 configured in the router.
You could have a blocked port too, don't rule out the ISP, use another way to test it.
I checked the Time Capsule and it was set for "DHCP and NAT" so I changed it to "Off (Bridge Mode)". After making that change my S6B fell off the network (two short blinks followed by an off). I tried refreshing the connection using XCTU and reentering the WiFi passphrase but that did not help. I then ran the "Active Scan" on the XCTU software and according to XCTU successfully reconnected to the WiFi network, but the blue LED on the USB board for the XBee S6B still indicates no network connection.
I then changed the Time Capsule back to the "DHCP and NAT" mode and was able to reestablish the WiFi connection.
Is there some other setting I need to change on the S6B module to get it to connect when the Time Capsule is in the "Off (Bridge Mode)"?
I can use my TCP tool on my iPhone to connect and converse with the XBee S6B and my techBASIC code can also communicate with the device once again. However I still cannot connect to it via the internet (i.e. my iPhone WiFi turned off). So, I have the Time Caplsule in the Bridge Mode but still unable to connect via the outside internet connection. Do I need to go back to Static IP addressing?
XBee WiFi S6B module configuration settings:
When the Time Capsule was in NAT mode it created a 10.0.1.0 network while your router's NAT created a 192.168.1.0 network. When you bridged the TC the XBee couldn't communicate with the old settings on the new network. Essentially the TC is now a wireless access point and no longer a router of its own. It will use the 192.168.1.0 network's router for services like DHCP.
Usually when something works on the LAN but not via the internet it could have an invalid gateway specified. The gateway is your router's LAN IP.
It could also be a port forwarding issue, those range from mismatched settings to ISP blocking.
Be sure to reboot your router if you haven't.
Sigh, this is complicated stuff, I just went two steps back!
I checked my TC's WiFi speed this morning and found it was in the 20-25 Mbps range. Previously, when the TC was setup as its own router (DHCP and NAT mode) I was routinely getting 50+ Mbps download and upload speeds. When I am connected to the FIOS router's WiFi I generally get speeds in the 25-30 Mbps range. So in the fog of morning I decided to reconfigure the TC back to being its own router and in doing so broke it (lesson learned: don't fiddle with network settings while you are trying to make coffee and get out the door to work). Looks like a hard reset and full reconfiguration for the TC when I get home.
However, in my fiddling around yesterday I seem to recall at one point having configuring the XBee S6B module to be connected to the FIOS router's WiFi network AND was able to connect to it using the TCP tool on my iPhone when the iPhone was connected to the TC's WiFi. So if my recollection is correct and my iPhone can see/connect with the Xbee S6B when connected to the FIOS WiFI while the iPhone is connected to the TC's WiFi network then I would much prefer that setup. This gets me back to a much faster WiFi network which is handy when the kids are each hogging bandwidth watching Netflix. This may also make it easier to port forward if the XBee is on the FIOS router's WiFi.
So I am going to try reconfiguring the whole thing this evening with the new found knowledge.
I have a Time Warner cable modem that presents me with an IP address. It has no routing services and no WiFi. Behind it are a pair of Time Capsules that provide the WiFi in my house and all routing within my 10.x.y.z home network.
TC#1 is set to "DHCP and NAT" in it's Network tab and is directly connected to the TW Modem. It is the boss of my internal network and acts as a gateway to the TW network (174.100.80.x).
TC#2 is set to "Off (Bridge Mode)" in it's Network tab. It has a WiFi connection (used to be Ethernet) to TC#1 and is just a WiFi extender and Ethernet AP at the other end of the house plus TC and storage functions, of course.
The house is one big happy, private Ethernet and WiFi network.
To expose one of my internal IP addresses to the Internet, I go to TC#1, and on the Network tab, there is a section called Port Settings. From there I can hit the "+" to add an item and then fill out the dialog presented. Name, public port, private IP, private port, etc. and save it. Once I reboot my TC, it will be exposed.
Your situation will be different, since you have a FIOS router sitting in the middle with its own network. Plus Verizon may be blocking traffic. I Haven't been blocked on anything by Time Warner yet.
Tonight's goal to to get the XBee S6B back on the WiFi.
The wifi issue half the speed is probably not dual band, hard to say though. The XBee doesn't care about bandwidth as much as it does latency.
What you wrote makes sense, not sure if you should exploit it or not but if you were to call tech support and ask they help you bridge your current FiOS router I don't see how you could be doing anything wrong regardless of what speed you pay for. Wifi isn't a good judge of ISP speed though, it's better to use a wired test to measure your ISP. Wireless can be crippled by all kinds of other factors. Especially if you have two in the same space and they are on the same channel.
So far it sounds like bridge the FiOS router and disable it's WiFi and use TC #1 as your router and access point for the best results.
Yes, I have been reading up on if/how the Actiontec could be retired in favor of the TC. I saw a few posts on the Apple Discussion board that says this can be done. I currently have a coaxial cable supplying the WAN connection to the Actiontec so this would need to be replaced by an Ethernet cable (something that Verizon apparently needs to come out to do). My only fear is that in doing so is Verizon somehow imposes a speed limit much like the 30-40 Mbps I get using the Actiontec's WiFi and when my work laptop is hard wired to one of the its LAN ports. If I instead connect the laptop via the TC's WiFi I get speeds in the 50-60 Mbps. I use the OOKLA website on the computers and their app on my iPhone to test the connection speeds. I can't explain the speed duality since the TC is fed from the Actiontec. The speed really tanks when I have to connect to the company's VPN, it drops to 8-10 Mbps since the traffic now needs to be routed to and from the VPN server in MN.
Retiring the Actiontec and using only the TC would likely simplify things on my end as I would have just one router that seems to be fast and easy to configure. Then maybe I could get back to playing with the toys rather than wrestling with the network beast. Probably worth a call to Verizon to what it would take.
Yes, it could work, if you use correct network settings.
The only things you need is your wan-ip (whatsmyip.com) , your local ip (network) and port settings. <= what calculator you are using???
Xbee needs Hex port values, router needs decimal values
You can ask Chris if he had a backup for that thread.
And you want to connect your xbee while you are not on your home network: take a look here: http://www.noip.com/
i'm working on XBEES6B module but i'm not able connect XBEE S6B with wifi router . can u send please arduino program and xctu connection
Welcome to the Parallax forums!
We can help you here with code for Parallax microprocessors (Basic Stamp, Propeller).
Do you have one of those you'd like code help with?
You can find examples here: http://learn.parallax.com/tutorials/language/spin/propeller-board-education-project-builders/wireless-xbee-communication-0