Delphi: Is there any way to use App Tethering with internet connection? - delphi

I'm using Embarcadero RAD Studio Delphi XE8.
Multi-Device Application app tethering components are designed for traditional WiFi and Bluetooth coupling. Does it support also Internet connections?
I would like to try to make small p2p app. I'm using App tethering via Wifi but I would like to connect App tethering via internet connection.
how to do that ?

Taken from the documentation
Connecting to Applications Outside Your Subnet
By default, both AutoConnect and DiscoverManagers perform the
discovery on the subnet of the local area network (LAN) where the
device running your application is. However, you can use their
optional parameter Target to override this behavior, and specify an IP
address or subnet: To specify an IP address to search for remote
managers, specify that IP address as the Target. To specify a subnet
of IP addresses, specify an IP address with a 0 as its fourth number.
For example, if you specify "192.168.4.0" as the Target, your manager
searches the 192.168.4.x subnet for remote managers. Note: You can not
specify wider subnets. For example, "192.168.0.0" is not supported.
In other words you need to use the IP address as the optional ATarget parameter of the mentioned calls. The differences to local tethering are minor, which I guess is why there are not many examples.
See the Embarcadero web site for more details

Try VPN connect two device. If your 2 device is same vpn (For ex: Softether , Openvpn). you can discover other device around the world. (Dont forget enable vpn server settings to discover other devices options)

Related

Can grpc communicate with mac address insted of ip

Currently my program use the IP of the other device in order to communicate over grpc.
Unfortunately the IP is changing all the time and I cannot continue the connection between the devices without updating it manually.
The connection between the devices is only on LAN and should blocked access from WAN.
Locking the IP of the device in the rowter settings is not an option this time.
Does grpc have a way to communicate over LAN (inside my network) using identification number or mac address that does not change over time?.
Related questions I found:
grpc: Identify clients from same IP address
Reason for both a MAC and an IP address
In order to locate a machine based on its MAC address, you are talking about implementing ARP. This is something that is not supported in dart nor am I sure it would be advisable to go this route anyway. If setting a DHCP reservation on your router is not an option, are you able to skip DHCP and set a static IP on the receiving machine?
You could look into dynamic DNS which your router may support, or you may need to set up separately, but that will also require a static IP (for your DDNS server). If your machines can connect to the internet there are many DDNS services you can sign up for, but it sounds like that is not the case.

Connect to a peer based on IP address and port

I've got an app that supports Bonjour and manually connecting to an IP (all within the same local network). I'm now looking at whether I can use MPC instead and while it obviously would be able to replace Bonjour, I haven't seen anything that allows me to replace the functionality around manually connecting to the IP. For context, my app runs in networks that have multicast disabled which is when users fall back to manually entering the IP address.
I could have the receiving app host a webserver and send a request there. Could I create a Peer based on the ip:port combination? That would allow me to make use of MPC for the MCSession aspect.
Is it possible to set up a Multipeer Connection based on an ip:port rather than having it automatically discovered via multicast?
I'll go with a solution based on NWConnection which uses NWEndpoint and can be created with both IP:port and a Bonjour-established service.
If I would've had access to the full Network.framework then I could've used that for both discovery & communication but due to SDK constraints I'll be using MultipeerConnectivity for the discovery aspect instead. By providing the device its IP & port when broadcasting the Bonjour service, another device can discover it automatically and then use the extra info to create an IP:port-based NWConnection.

Identifying WiFi clients connected to ESP8266

I'd like to know that a specific device (phone/tablet) has joined my WiFi network created by ESP8266 microcontroller. It shouldn't require any installed apps on that phone/tablet, if possible, to simplify the whole setup.
So I think I need to somehow identify connected clients, and MAC is not an option because it is subject to change randomly on, say, Apple devices.
Maybe it's possible to collect host names of connected clients?
I know that Windows and Ubuntu clients send their host names when getting IP from DHCP server (see here). Also, it's possible to find such information on, say, home Wi-Fi router admin web page (i.e. host names, their IPs and MACs).
I'm running DHCP server on ESP8266, but I haven't found any API that allows to get peer host name (i.e. reverse DNS). Does ESP8266 support getting such information?

How to use App Tethering with internet connection?

I'm using Embarcadero RAD Studio Delphi XE8.
Multi-Device Application app tethering components are designed for traditional WiFi and Bluetooth coupling. Does it support also Internet connections?
I would like to try to make small p2p app. I'm using App tethering via Wifi but I would like to connect App tethering via internet connection.
how to do that ?
Yes, TCP/IP (LAN and Internet) is also supported. This is clearly explained in the documentation.
Using App Tethering
The app tethering feature does not depend on a specific transport or protocol, and new transports and protocols can be implemented using the app tethering API. The RTL provides built-in support for IP and Classic Bluetooth connections. IP support includes connecting applications running on the same device.
IP connections are not limited to WiFi only. WiFi is just a wireless connection to a LAN, much like Ethernet is for wired connections. IP works the same regardless of the type of connection used.
Connecting to Remote Applications Using App Tethering | Connecting to Applications Outside Your Subnet
By default, both AutoConnect and DiscoverManagers perform the discovery on the subnet of the local area network (LAN) where the device running your application is.
However, you can use their optional parameter Target to override this behavior, and specify an IP address or subnet:
To specify an IP address to search for remote managers, specify that IP address as the Target.
To specify a subnet of IP addresses, specify an IP address with a 0 as its fourth number. For example, if you specify "192.168.4.0" as the Target, your manager searches the 192.168.4.x subnet for remote managers. Note: You can not specify wider subnets. For example, "192.168.0.0" is not supported.

How to link/pair HTML 5 with a hardware device?

I have two entities which I would like to be able to start a communication:
Hardware Device Using Atmel ATSAMS70 and WINC1500 Wifi Module
HTML 5 App
The idea to have a HTML 5 app is to be able to communicate easily with most of the commercial devices like: Windows computers, Android Phones, Mac OSX computer and iOS devices. Apart from that, I would avoid working with native code at all.
Currently, they can talk with each other using WebSockets but somehow the IP address of the custom board has to be known from HTML 5 to initiate the communication.
In order to do this, I can think of 3 options:
Using WebRTC I can get the local IP address of the browser and then I could do a scan of the local devices considering a 255.255.255.0 network mask.
Have an external server that the hardware device can send its local address which will be later retrieved by HTML 5.
Using Bonjour or some sort of device discovery service between the board and HTML5.
I could not find a way to achieve #3 but #2 seems feasible to me. #1 is what I am doing now, but WebRTC is currently not supported on iOS.
So, is there any other better possibility to achieve this communication?
You don't mention how the WINC1500 unit is being connected to the network but presumably this is in STA mode (acting as a wifi station rather than becoming a software access point or part of an ad-hoc network) and is being provided with its IP details through an existing access point?
Ordinarily I'd suggest that once connected, the device ought to start indicating its availability on the network via a regular UDP broadcast on a specific port but my (admittedly limited) understanding of WebSockets it is that it creates TCP connections. The only implementation of Bonjour that I've seen uses UDP messaging too, that may be why you've had trouble with your third approach.
Your second approach seems more likely to work well. A server at a known (or discoverable) IP on the local network which allows the Atmel device to register itself (and its IP address) and also allows other applications (your HTML 5 WebSockets applications) to request that connection information to allow them to create the WebSocket TCP connections they need.
I suppose that doesn't really answer your question as to "Is there a better way?", other than to say "Not that I can think of, your second approach looks good to me...". Sorry! Sounds like a very interesting project, overall,

Resources