PDA

View Full Version : Help with PIC+Internet project



Tina10
- 14th June 2013, 20:28
Hi, during my summer holidays now, I would like to do some project involving internet + PIC. I have bought a module ($15) which can connect to wifi. Can work as server and client. Can be used in adhoc or infrastructure mode.
Following the advise in the device's manual and using the provided software, from my laptop I can configure the module ->> I am able to load my home network details into the module and it then connects to my home wifi fine. I can also load the server address and port number where it can then send data to (which currently is my laptop IP, running a server software and listening to the that port). Connected to the same network, I can send data from the module and receive it.

I would like to know if there is any thing out there which can help me see if the data can be sent outside my home network somewhere on the web. I would like to know if there is any service which can give me an ip address and port number to which I can send data and then see it.

The ultimate aim is to control something at my home via an app on the phone or something. Thanks

Demon
- 14th June 2013, 22:08
What module is that?

Keep us updated on any progress, I have the same project coming soon (residential alarm system).

Robert

andywpg
- 14th June 2013, 23:16
What module is that?

Keep us updated on any progress, I have the same project coming soon (residential alarm system).

Robert


I too would like to know. When my smoker controller is running well in automatic mode, I want it to be able to update me via text message.

Tina10
- 15th June 2013, 00:40
What module is that?

Keep us updated on any progress, I have the same project coming soon (residential alarm system).

Robert

I tried uploading the user manual but it breached the limit. Here is the link to it - http://sdrv.ms/13MwvSh

amgen
- 15th June 2013, 16:23
Briefly,
1)Your router gives your wifi device a local address, 192...., 127..... or 10...., (unless you set a static address that must be the same local network) and you set your port number on your wifi device to listen on and/or send recieve.
2)Log on to router and add a setting in 'port forwarding' to direct recieved (from internet) request with port number of your device to go to your local address of your device.
3)now, if your PIC simply, continously ser-out's stuff, and you can place wifi device to tcp-listen mode, HyperTerminal can connect and continously display your data until closed.
4) you can connect locally as you said you did, and ...... use 'WHO AM i' web site to get your Internet Service Providers given address to connect to your device the same way from the internet.

don

Tina10
- 15th June 2013, 18:30
Thanks Don. 1 problem, I can't find the port forwarding option. I have taken a screenshot of (what I think is) the closest option. Please guide me through this. Thanks7008

Tina10
- 15th June 2013, 21:23
I saw some videos on your tube and found out how it is done. But before I start making changes to the router I would like to confirm
1) If the information (based on my understanding) in the attached picture is correct?
2) If yes then: Would it be correct to enter the external port 30000 and internal port 25000? (I just chose these ports randomly)
3) If Yes then: Should I start listening to the 25000 port number at my laptop? As any data sent to the external IP of my router at port number 30000 should arrive at port 25000 of my laptop (provided I enter my laptop's IP in internal host (eg 192.168......) ?

I am just a little worried about messing something up as I do not have any knowledge about this. All help is appreciated. Thanks

amgen
- 15th June 2013, 23:38
back to you when company leaves, you are on right track
d

Tina10
- 16th June 2013, 00:24
back to you when company leaves, you are on right track
d

Thanks. I am sorry but I did not understood the expression "back to you when company leaves".

I tried the above settings. This is what I did:
1) Wrote IPconfig on the command window and got my laptop's internal IP-->> Inserted it at 'internal host'
2) Chose a random port 5579 (external) & 2500 (internal)
3) Chose protocol TCP/UDP
------SAVED THE SETTINGS SUCCESSFULLY ------

Got my iPad, downloaded an app where if you supply ip and port, it sends a UDP packet to that address at that port. Ran the NETAssist software on laptop, chose UDP data, and started monitoring port 2500 at my laptops ip address.

App tried to send data to my routers external IP which I got from google by typing 'my ip' at port 5579.
----RESULT: NOTHING SHOWED AT Net Assist software------

Tried the same with TCP settings instead of UDP. Still nothing.
Tried making both the ports same (internal/external) still nothing.
What can I try next?

amgen
- 16th June 2013, 00:45
check firewall on laptop (windows.....xp,7 ??) and allow or open for port 2500 and/or NetAssist program....... to allow data passing through firewall.
d

Tina10
- 16th June 2013, 01:12
I have gone through endless options in Norton Internet Security to allow port 5578 (External port) but could not find any option. (Using windows 8).

I tried sending the data through my ipad app internally (internal IP of laptop rather than external IP or router) directly to port 5579 (Internal port being monitored currently on laptop) and data did arrived. DO you still think it is a problem of firewall? As it does work internally but when sent to external IP of router it does not arrive. Could it be a setting on router, not opening the port 5578?

Thanks

amgen
- 16th June 2013, 02:23
windows8 .........control panel>system and security>windows firewall.........allow an app........... etc

Tina10
- 16th June 2013, 02:39
Thanks. The problem is HALF solved.

I get the data if it comes from another place, I mean--> I switched on my phone's 3G connection --> I connected my ipad to internet by creating a hotspot through my phone --> I sent the data through the app to my router's external IP and this time it showed up on my laptop.

Why is it not coming when my iPad is connected to the net through home wifi?

amgen
- 16th June 2013, 03:03
seems like it... is external port 5578 or 9 and internal port 2500, then net assist should be listening on 2500

Tina10
- 16th June 2013, 03:08
Sorry for the confusion earlier. As I kept experimenting, I kept changing the ports as well. For now, external is 5578, internal is 5579.

aerostar
- 16th June 2013, 08:49
Port forwarding in routers normally only work for traffic coming from external IP addresses, it will not work if you are logged on internally, that is why your Ipad when connected to 3G works, it is an outside access.

Tina10
- 16th June 2013, 14:53
Port forwarding in routers normally only work for traffic coming from external IP addresses, it will not work if you are logged on internally, that is why your Ipad when connected to 3G works, it is an outside access.

Is there any way around it?

Thanks for the help everyone.

amgen
- 16th June 2013, 17:23
at first i thought i could connect back to my LAN through router using the WAN (external address) because on connect, data was being returned,,,,,,,,,,but, unpluging the WAN cable to router, the data STILL continued comming.....meaning the router itself looped the connection back without exiting the LAN......
looks like real external testing needs external sourcing.

Tina10
- 16th June 2013, 18:54
I have a hosting space. Is it possible to have some kind of arrangement like some kind of code or something which can listen to the incoming data at some port and then redirect it to the routers external address at specified port?