Wifi Module loses connection

Expansion modules and attachments
Post Reply
saltwaternoob
Posts: 18
Joined: Mon May 23, 2011 9:39 am

Wifi Module loses connection

Post by saltwaternoob »

So this whole thing i kinda confusing for me to set up the addon, but i was able to get it going. I have port forwarding allowed on my router and the Wifi utility did everything correctly.

I can access the RA from my home network perfectly fine, but every few days i have to unplug the utility from the RA and use the utility again to gain outside my network access. I am not using a remote DNs service as my router wont let me forward to one. I use my IP adddress with the :2000 and it works for a few days then stops.

Any words of advice to get it going 100%?
150g 1" Acrylic Reef 48x32x24

24g picasso clown tank
AlanM
Posts: 263
Joined: Wed Jan 01, 2014 7:26 am

Re: Wifi Module loses connection

Post by AlanM »

Remote dns is independent of forwarding. Put a line in your setup() function at the end that looks like:

Code: Select all

ReefAngel.DDNS("home"); 
where "home" is whatever you want your DDNS suffix to be.

Then you can configure the app to point at:

saltwaternoob-home.myreefangel.com and port 2000 and it should work forever assuming your reef angel is successfully talking to the portal.

Make sure it is talking to the portal by putting

Code: Select all

ReefAngel.Portal("saltwaternoob"); 
at the end of your loop() function right before the show interface function.
saltwaternoob
Posts: 18
Joined: Mon May 23, 2011 9:39 am

Re: Wifi Module loses connection

Post by saltwaternoob »

This is the last 3 lines of code, and it appears that i have that already.


ReefAngel.Portal( "saltwaternoob" );
ReefAngel.DDNS( "76.xxx.xx.xxx:2000" ); // Your DDNS is saltwaternoob 76.xxx.xx.xxx:2000.myreefangel.com
ReefAngel.ShowInterface();
}
150g 1" Acrylic Reef 48x32x24

24g picasso clown tank
AlanM
Posts: 263
Joined: Wed Jan 01, 2014 7:26 am

Re: Wifi Module loses connection

Post by AlanM »

saltwaternoob wrote:This is the last 3 lines of code, and it appears that i have that already.


ReefAngel.Portal( "saltwaternoob" );
ReefAngel.DDNS( "76.xxx.xx.xxx:2000" ); // Your DDNS is saltwaternoob 76.xxx.xx.xxx:2000.myreefangel.com
ReefAngel.ShowInterface();
}
That DDNS command is wrong. You don't put your IP address in there. Put a word in there like "home" or "reef" or "fishtank" or whatever. You're not allowed to have colons in DNS names. You're allowed to have periods and numbers, I guess, but it makes no sense since your number will be changing.

Also the Portal and ShowInterface commands should go in the loop() and the DDNS command should go in setup(). Together those are the two main sections of your .ino file. The setup() command gets run once when your RA+ is booted. The loop() runs as fast as it can run over and over while it has power.
saltwaternoob
Posts: 18
Joined: Mon May 23, 2011 9:39 am

Re: Wifi Module loses connection

Post by saltwaternoob »

Interesting because i used the Wizard to generate the code and that is where it put it? My main question is why does it work for a few days as is and then quit on remote access, when i am not on my home network? When i am home it still works fine.
150g 1" Acrylic Reef 48x32x24

24g picasso clown tank
AlanM
Posts: 263
Joined: Wed Jan 01, 2014 7:26 am

Re: Wifi Module loses connection

Post by AlanM »

saltwaternoob wrote:Interesting because i used the Wizard to generate the code and that is where it put it? My main question is why does it work for a few days as is and then quit on remote access, when i am not on my home network? When i am home it still works fine.
I have no idea what the wizard does or doesn't do.

It likely works from on your home network because you're going to your direct wifi IP address, and it's not doing DNS request at all.

I assume it's working from remote for a couple of days because even though you put that weird hostname in to the app with the colon and stuff in it, it is truncated into just ip address and port number which eventually changes as your ISP changes your external IP.

Are you really resistant to trying what I said would fix it?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Wifi Module loses connection

Post by rimai »

Your internet is most likely a dynamic ip address, which means that every so often, your internet provider will change your ip address to a new one. When that happens, you would not be able to connect anymore because you are trying to connect to the old ip address.
If you want to have static ip address, which will never change, you should contact your internet provider and let them know that you would like static ip address. That would usually mean an increase of a few dollars in the monthly fee.
The other alternative is to use dynamic DNS, either from an external source such as dyndns.org, no-ip.com or the one mentioned above by AlanM.
Roberto.
saltwaternoob
Posts: 18
Joined: Mon May 23, 2011 9:39 am

Re: Wifi Module loses connection

Post by saltwaternoob »

Not "resistant" at all, more curious why it would work and then stop is all. I do have a static IP as it hasnt changed since setting up the module.

I will try the mentioned fix. Thanks
150g 1" Acrylic Reef 48x32x24

24g picasso clown tank
Post Reply