Page 1 of 1

Total networking noob here, can someone help me?

Posted: Fri Dec 26, 2014 1:48 pm
by gaberosenfield
To start off, I understand almost nothing about networking. I have the wifi module and have configured it using coolterm such that my router recognizes it and the wifi module has a slow blinking green light only. But I can't understand exactly what I'm supposed to do to get it to communicate with the web portal. I added ReefAngel.AddWifi(); to the setup section in my ino file and ReefAngel.Portal("gaberosenfield", "passphrase"); to the loop section. I matched the passphrase in my portal settings. If I type the wifi module's IP address/wifi into my web browser from within my wireless network, I get a page that says the string I configured the wifi module to send to the remote TCP client when the TCP port is opened. I don't get anything else, and I really don't understand what this means. If I type the same address into my web browser from outside my wireless network, I just get a "web page is not available" page.

I tried to set up port forwarding on my router, but I don't really understand what I'm doing. When I tried to set up port forwarding, my router asked what port I want to forward from (I entered 80 because that's the port I configured the wifi module to use) and it asked what port I want to forward to. I didn't know how to answer the last question so I left it blank.

I also don't really understand if I need a static IP address and whether the static IP address should be for my router or the wifi module itself.

Help?

Re: Total networking noob here, can someone help me?

Posted: Fri Dec 26, 2014 4:37 pm
by pandimus
You want to set up port 80 to forward to the iPhone address of your reef angel wifi adapter

Re: Total networking noob here, can someone help me?

Posted: Fri Dec 26, 2014 6:25 pm
by cosmith71
What kind of router?

--Colin

Re: Total networking noob here, can someone help me?

Posted: Fri Dec 26, 2014 7:04 pm
by gaberosenfield
What is an "iPhone" address? Wait, was that an autocorrect from IP address? I'll try that.

The router is a Pace Plc, model number 4111N-030.

Re: Total networking noob here, can someone help me?

Posted: Fri Dec 26, 2014 7:11 pm
by gaberosenfield
I cannot forward port 80 to the wifi module's IP address. The maximum number of characters I can enter in the "Map to Host Port" field is 8; not enough for an IP address...

I don't know if this will help, but when I enter the wifi module's IP address with a "/wifi" at the end into my internet browser from within my wireless network, this is what I see:

You have connected to Gabriel Rosenfield's ReefAngel wifi moduleHTTP/1.1 200 OK
Server: ReefAngel
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Connection: close
Content-Type: text/html
Content-Length: 75

<!DOCTYPE html><script src='http://www.reefangel.com/wifi/ra2.js'></script>

Re: Total networking noob here, can someone help me?

Posted: Fri Dec 26, 2014 8:28 pm
by pandimus
http://portforward.com/english/routers/ ... liders.htm

Does this help?
Also I believe port 2000 is the one.. Not 80

Re: Total networking noob here, can someone help me?

Posted: Fri Dec 26, 2014 8:31 pm
by pandimus
And yeah my phone auto corrected to iPhone from ip

Re: Total networking noob here, can someone help me?

Posted: Fri Dec 26, 2014 10:10 pm
by gaberosenfield
Thanks for trying pandimus, but I already read that page. It doesn't answer any of my questions...

And I know port 2000 is the default one that the wifi module uses, but I changed it to port 80 when I was setting up the module. Should I change it back? Maybe I'll try that...

Re: Total networking noob here, can someone help me?

Posted: Fri Dec 26, 2014 11:05 pm
by pandimus
Yeah change it back.

Re: Total networking noob here, can someone help me?

Posted: Sat Dec 27, 2014 12:16 am
by gaberosenfield
As far as I can tell, changing it back had no effect. Here is the info I get when I type the "get i" command into coolterm while I'm connected to the wifi module, just in case it helps anyone help me:

get i

IF=UP
DHCP=ON
IP=192.168.42.72:2000
NM=255.255.255.0
GW=192.168.42.1
HOST=198.171.134.6:80
PROTO=TCP,
MTU=1524
FLAGS=0x6
TCPMODE=0x0
BACKUP=0.0.0.0
<4.41>

Re: Total networking noob here, can someone help me?

Posted: Sat Dec 27, 2014 12:45 am
by rimai
You need to forward port 2000 to ip address 192.168.42.72

Re: Total networking noob here, can someone help me?

Posted: Sat Dec 27, 2014 1:08 pm
by gaberosenfield
Ok, I think finally figured out how to properly forward port 2000 to static IP 192.168.42.72. But now when I try to go to my portal, it still doesn't work, says unreachable address, and pop up appears that says:
/status/proxy.aspx?u=http://192.168.42.72:2000&user=undefined&pass=undefined

Any ideas?

Re: Total networking noob here, can someone help me?

Posted: Sat Dec 27, 2014 1:46 pm
by rimai
The popup was me working on the code of the portal.
It's not there anymore.
If your port forwarding is setup correctly, you should see open when you test port 2000 here:
http://www.yougetsignal.com/tools/open-ports/

Re: Total networking noob here, can someone help me?

Posted: Sat Dec 27, 2014 3:16 pm
by gaberosenfield
Roberto,

The tool you linked says that port 2000 on 192.168.42.72 is closed. I'm not sure why...
But when I look into my router's firewall settings, it says:

Current Applications, Pinholes and DMZ Settings: Custom

Device Allowed Applications Application Type Protocol Port Number(s) Public IP
Static IP:192.168.42.72 ReefAngel Wifi to Portal - tcp 2000
142.254.24.170

When I use the tool you linked to test whether port 2000 is open on 142.254.24.170, it says it is open. But when I enter that into "ReefAngel Wifi Address" line on my profile page, the portal still says "address unreachable...

I don't even understand why there is a different public IP address...

I appreciate everyone's help; please keep it coming!

Re: Total networking noob here, can someone help me?

Posted: Sat Dec 27, 2014 3:59 pm
by rimai
You should not need to change the ip address in your profile if you have this in your code:

Code: Select all

ReefAngel.Portal("gaberosenfield");
Everytime the controller sends data to the Portal server, it will update that field automatically.
But, I'm looking at the history and I can't see any data sent to your forum id.
The test tool should be used on your public ip address.
That's the ip address that the portal can see.
The private ip address 192.168.42.72 is internal to your network and nobody can see it except you when you are connected to your wifi.
That's why you need port forwarding.... To direct traffic incoming on port 2000 to your controller inside your network.
Your router is programmed to block all incoming connections and assume they are all malicious. By using port forwarding, you are basically telling your router that any incoming connection on port 2000 is friendly and should be directed to your controller.

Re: Total networking noob here, can someone help me?

Posted: Sat Dec 27, 2014 4:34 pm
by gaberosenfield
Roberto,

I already have exactly the code you posted in the loop section of my ino. According to the port checking tool you linked, port 2000 on IP 142.254.24.170 is still open. According to my router, port 2000 is forwarded to 192.168.42.72, which I believe because when I enter "http://142.254.24.170:2000" into my browser, it takes me to a page that says "You have connected to Gabriel Rosenfield's ReefAngel wifi module". Yet my portal still says "unreachable address" and doesn't work... I noticed in my profile there is a place to enter a username and password for wifi authentication. Is this something I need to fill out? Also, I originally had the line

Code: Select all

ReefAngel.AddWifi();
in the initialization section of my ino. I tried removing it and it no effect either way. Does this line matter?

Thanks for your continuing help!

Re: Total networking noob here, can someone help me?

Posted: Sat Dec 27, 2014 4:53 pm
by rimai
I'm really confused.
I have no clue how you are getting this: "You have connected to Gabriel Rosenfield's ReefAngel wifi module"
It's not in our libraries, so it can't be coming from the controller.

Re: Total networking noob here, can someone help me?

Posted: Sat Dec 27, 2014 5:36 pm
by gaberosenfield
Sorry, I said it earlier in this thread. I configured the wifi module to say that when anything connects to it by typing "set c r You$have$connected$to$Gabriel$Rosenfield's$ReefAngel$wifi$module" when I was in command mode. Is that a problem?

Re: Total networking noob here, can someone help me?

Posted: Sat Dec 27, 2014 5:41 pm
by rimai
yes, it is.
It needs to be the preset we use or it won't work.

Re: Total networking noob here, can someone help me?

Posted: Sat Dec 27, 2014 6:11 pm
by gaberosenfield
I see! Now my portal is populated with my data, but it still says "unreachable address". I don't really understand that...

I am also unable to change a relay status from the portal. What do I need to do to fix that?

Re: Total networking noob here, can someone help me?

Posted: Sat Dec 27, 2014 7:41 pm
by rimai
There must be something still misconfigured in your wifi attachment.
I also can't see port open when checking your public ip address.

Re: Total networking noob here, can someone help me?

Posted: Sat Dec 27, 2014 9:53 pm
by gaberosenfield
That's strange; when I check port 2000 at IP 142.254.24.170 I get "Port 2000 is open on 142.254.24.170.".

I guess I'll try to reconfigure the wifi attachment again...

Re: Total networking noob here, can someone help me?

Posted: Sat Dec 27, 2014 10:26 pm
by gaberosenfield
Well by reconfiguring the wifi module following exactly what the guide first suggested, I was able to make it work like a charm! Thanks so much for all your help!

For the record, much of my confusion seems to have come from some unclear instructions in the wifi attachment manual. For example, it was not at all clear to me that if I changed the string that is sent to the remote TCP client when the TCP port is opened from the default to anything else, the portal wouldn't accept my wifi module's uploads. It also says that the flush size should be set to the largest possible value and that that value is 1420. So I set it to 1420. In the end, I had to change it back to 1024, which is also suggested in the manual, in order to get everything to work. Perhaps the manual should be made more clear. I would be willing to make the changes, but I'm not really sure how to make those changes to a PDF without a program to which I do not have access.

Thanks again everyone, especially Roberto!

Re: Total networking noob here, can someone help me?

Posted: Sun Dec 28, 2014 11:03 am
by rimai
I think 1420 size should work. The modules are shipped wit 1420.
1024 works too.