Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,149,699 members, 7,805,885 topics. Date: Tuesday, 23 April 2024 at 07:54 AM

Does Anyone Know How To Connect To A Generic Device Via Internet - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Does Anyone Know How To Connect To A Generic Device Via Internet (749 Views)

Please, Does Anyone Know How To Connect Javascript To A PHP Socket Server On A L / Does Anyone Know About Decagon? / Do Anyone Know What Happened To Learnerstv.com (2) (3) (4)

(1) (Reply) (Go Down)

Does Anyone Know How To Connect To A Generic Device Via Internet by sagieramos(m): 8:46pm On Jun 06, 2021
I could connect to my device with my phone when they are on the same router. Does anyone know how to connect to the same device outside my router or via the internet?

I use TP-LINK TL-MR6400 as my private router

Re: Does Anyone Know How To Connect To A Generic Device Via Internet by AdolphBrian: 9:32pm On Jun 06, 2021
I assume that by "connect" you want to access some resource available on your device (most probably through a server of some sort).

In this illustration I'll assume that the resource you want to access is available on a HTTP server running on your device.

Step 1:
Get the WAN (public) IP address of your router, <router_public_ip>

Step 2:
Assuming that the HTTP server is already running on your device, get the port number the server is exposed on

Step 3:
Confirm that the server is bound to the same network interface as your router on port <server_port> (which is typically within the range of [1024, 65535] unless you're running the server with superuser privileges

Step 4:
Access the "control panel" of your router.
You should be able to do so by navigating to your router's local ip address from your device

Step 5:
Search for a feature called "port forwarding" (or "port mapping"wink

Step 6:
Enter in the (local) ip address of your device and an arbitrary port number, <forwarded_port>, as the source and as the destination, the <port_number> the server on your device is available on

Step 7:
Open a web browser (on your phone) and type in http://<router_public_ip>:<forwarded_port>/path/to/resource/on/the/server/running/on/your/device
Re: Does Anyone Know How To Connect To A Generic Device Via Internet by dochenaj: 2:34am On Jun 07, 2021
sagieramos:
I could connect to my device with my phone when they are on the same router. Does anyone know how to connect to the same device outside my router or via the internet?

I use TP-LINK TL-MR6400 as my private router
You'll also need dynamic DNS running on your router, in order to have a consistent address for it. I suppose your router IP address is not static.
Re: Does Anyone Know How To Connect To A Generic Device Via Internet by sagieramos(m): 4:21am On Jun 07, 2021
AdolphBrian:

Step 1:
Get the WAN (public) IP address of your router, <router_public_ip>

Step 2:
Assuming that the HTTP server is already running on your device, get the port number the server is exposed on

Step 3:
Confirm that the server is bound to the same network interface as your router on port <server_port> (which is typically within the range of [1024, 65535] unless you're running the server with superuser privileges

This part is where I'm having limited knowledge. How do I confirm the server is bound to the same network interface as the router port?
Re: Does Anyone Know How To Connect To A Generic Device Via Internet by sagieramos(m): 4:31am On Jun 07, 2021
dochenaj:
You'll also need dynamic DNS running on your router, in order to have a consistent address for it. I suppose your router IP address is not static.
I made an IP reservation for my device, so I'm sure my device got a static ip with this method. With the external ip, I'm using no-ip to manage my ddns. I thought noip was the problem not until I failed to access my device through the external ip that was assigned to my router at that moment
Re: Does Anyone Know How To Connect To A Generic Device Via Internet by dochenaj: 8:36pm On Jun 07, 2021
sagieramos:
I made an IP reservation for my device, so I'm sure my device got a static ip with this method. With the external ip, I'm using no-ip to manage my ddns. I thought noip was the problem not until I failed to access my device through the external ip that was assigned to my router at that moment
Can you ping your router IP address from your phone?
Re: Does Anyone Know How To Connect To A Generic Device Via Internet by sagieramos(m): 10:39pm On Jun 07, 2021
dochenaj:
Can you ping your router IP address from your phone?

I don't understand. I thought port forwarding will allow me access my device via an external ip, hence it should ping at a given interval depending on the firmware of the router
Re: Does Anyone Know How To Connect To A Generic Device Via Internet by AdolphBrian: 5:53pm On Jun 10, 2021
sagieramos:

This part is where I'm having limited knowledge. How do I confirm the server is bound to the same network interface as the router port?

Uhmmm.... Okay. Let's start from here. The "device" that's running the server, what is it, i.e: laptop or ....
Re: Does Anyone Know How To Connect To A Generic Device Via Internet by sagieramos(m): 9:50pm On Jun 10, 2021
AdolphBrian:


Uhmmm.... Okay. Let's start from here. The "device" that's running the server, what is it, i.e: laptop or ....
It's a micro controller (WROOM-32)
Re: Does Anyone Know How To Connect To A Generic Device Via Internet by AdolphBrian: 1:04pm On Jun 11, 2021
sagieramos:

It's a micro controller (WROOM-32)

Okay. I'm gonna need you to scan your LAN

You can do this using a Laptop or a phone. The utilities you'll need will be

- just nmap (for a laptop/desktop)
- termux and nmap (for Android)

You can get termux from the Google play store

You can get nmap for your OS from https://nmap.org

I'm willing to help but I'm not always online on nairaland. Feel free to contact me via messenger at https://m.me/adophilus.brian so that we can resolve your issue quickly

(1) (Reply)

My Gmail Account Got Disabled, HELP!!!!!!! / App Developer Needed / You Can Use Php For That Chat Application Instead Of Expensive Node.js

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 20
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.