connecting between PCs (dynamic & static IPs)

If you have a question or need help, this is the place to be.
Zohan
Posts: 13
Joined: Sat Jul 06, 2019 2:08 am

connecting between PCs (dynamic & static IPs)

Post by Zohan » Wed Jul 24, 2019 1:43 pm

My ISP has a dynamic IP address and i have a dedicated server that has a static IP

I was wondering if it's possible with EG to send events between two machines that have dynamic IPs by using the dedicated server as a pass-through?

[Dynamic IP] <-> [Static IP] <-> [Dynamic IP]


EDIT: to be more specific:

Is it possible for EG to listen for events on the dedicated server running EG?

So when i want to send a command from machine A to machine B (both dynamic ips).
the command has to be sent from machine A to the dedicated server first, then machine B sees the command from the server?

User avatar
kgschlosser
Site Admin
Posts: 5495
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: connecting between PCs (dynamic & static IPs)

Post by kgschlosser » Wed Jul 24, 2019 10:56 pm

With EG anything is possible!!!

I need more information on this.

Dynamic IP addresses are Dynamic by design. But also by design so long as the lease does not expire for a specific mac address you can technically have the same IP address forever.. Now we all know this may not happen.. Due to DHCP server reboots and things of that nature.


Now that being said..

I need more specifics on your setup.. I need to know where the internet is in relation to the machines.

is it something like this.
Network10.png
I guess it really does not matter. so long as a single machine has a static IP address then you can ping pong events.

This is going to be a custom thing to make it work. the network event sender and receiver both use UDP so that will not work. we need to create a direct TCP connection.

the 2 machines with the dynamic IP's are going to have to initiate the connection to the single machine that has the static IP.

Or optionally you can use a service like changeip that provides you with a DDNS host which will periodically sync you IP with their servers to ensure the record is correct.
If you like the work I have been doing then feel free to Image

Zohan
Posts: 13
Joined: Sat Jul 06, 2019 2:08 am

Re: connecting between PCs (dynamic & static IPs)

Post by Zohan » Thu Jul 25, 2019 1:11 pm

Thanks for the reply!

Yeah one of my setup is similar to your diagram, i also use multiple phones with their own LTE connection, all dynamic IPs of course.
I use an app called "MacroDroid" on my android phones to send commands between multiple various machines, most of them are connected to different Network/ISPs.

So i thought it would be best if all of these machines just connect to EG that is installed on the Dedicated Server and listen to any command that comes from any other source.

User avatar
kgschlosser
Site Admin
Posts: 5495
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: connecting between PCs (dynamic & static IPs)

Post by kgschlosser » Thu Jul 25, 2019 10:18 pm

OK good.

what are the devices you want to use to send information to EG?
are they windows PC's?
If you like the work I have been doing then feel free to Image

Zohan
Posts: 13
Joined: Sat Jul 06, 2019 2:08 am

Re: connecting between PCs (dynamic & static IPs)

Post by Zohan » Fri Jul 26, 2019 2:13 pm

Android Phones.

I already know how to send commands from the android phones to EG on the Dedicated server by using (Webhooks) on MacroDroid to trigger the events on EG.

User avatar
kgschlosser
Site Admin
Posts: 5495
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: connecting between PCs (dynamic & static IPs)

Post by kgschlosser » Fri Jul 26, 2019 9:15 pm

ok so ya lost me then.

if you have android devices and they are able to send events to EG running on a "server" that has a dedicated IP and this is already working.. then what do you need help with exactly?
If you like the work I have been doing then feel free to Image

Zohan
Posts: 13
Joined: Sat Jul 06, 2019 2:08 am

Re: connecting between PCs (dynamic & static IPs)

Post by Zohan » Fri Jul 26, 2019 11:35 pm

Sorry i know my posts were confusing, it's a little hard to explain, but let me try to clarify it with a diagram:

Image


Basically all i want is to have any PC with a dynamic IP to listen for any sent commands ON the dedicated server that came from a phone.

[Phone] --(send command)--> [Dedicated Server] <--(PC Listens from server)--> [PC]

User avatar
kgschlosser
Site Admin
Posts: 5495
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: connecting between PCs (dynamic & static IPs)

Post by kgschlosser » Sat Jul 27, 2019 12:12 am

OK that is simple to accomplish.

do you want any security? AES or the like?
If you like the work I have been doing then feel free to Image

Zohan
Posts: 13
Joined: Sat Jul 06, 2019 2:08 am

Re: connecting between PCs (dynamic & static IPs)

Post by Zohan » Sat Jul 27, 2019 12:38 am

Great! :D

These PC's are all private, so I guess security is not really needed.

User avatar
kgschlosser
Site Admin
Posts: 5495
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: connecting between PCs (dynamic & static IPs)

Post by kgschlosser » Sat Jul 27, 2019 1:14 am

Is the information between the server and the PC going to pass through the internet?
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 5495
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: connecting between PCs (dynamic & static IPs)

Post by kgschlosser » Sat Jul 27, 2019 1:16 am

Oh also.. is this going to be one way communication only?
If you like the work I have been doing then feel free to Image

Zohan
Posts: 13
Joined: Sat Jul 06, 2019 2:08 am

Re: connecting between PCs (dynamic & static IPs)

Post by Zohan » Sat Jul 27, 2019 10:09 am

Correct, passing through the internet.

But not a one way communication.

Snowbird
Experienced User
Posts: 374
Joined: Fri Jul 03, 2009 10:04 am

Re: connecting between PCs (dynamic & static IPs)

Post by Snowbird » Sun Jul 28, 2019 8:51 am

the easiest way to accomplish what you want is to use the MQTT plugin :
viewtopic.php?f=9&t=5728

all you have to do is to install the Broker (MQTT server) on your server with the static IP, then you install the plugin on any computer that is running EG (the IP can be dynamic it doesn't matter), and finally you need to install an MQTT client app for Android or IOS (depending on your phone OS).

How does it work ? you subscribe to a topic of your choice from your computer, this will create the topic on the broker, when a client (your phone, or any other device that has the MQTT plugin installed) sends a message to this topic, every member of this topic (your computer) will receive the message. The beauty of this, is that you can have several members for the same topic, meaning you send one unique message and it will be delivered to all the machines that have subscribed to this specific topic. The possibilities are endless.

Zohan
Posts: 13
Joined: Sat Jul 06, 2019 2:08 am

Re: connecting between PCs (dynamic & static IPs)

Post by Zohan » Sun Jul 28, 2019 1:19 pm

Thanks, Snowbird
I downloaded the plugin that was posted by the user "holdestmade" on the last page of the thread.

I'm having trouble understanding which plugin/action goes on which machine, i would really appreciate it if you can guide me.
I followed the OP and couldn't really understand.

Snowbird
Experienced User
Posts: 374
Joined: Fri Jul 03, 2009 10:04 am

Re: connecting between PCs (dynamic & static IPs)

Post by Snowbird » Sun Jul 28, 2019 3:32 pm

you should download the latest version found here :
https://drive.google.com/drive/folders/ ... k04dXNzYzA
version 1.2.2

1/ you simply install it on your computer that needs to receive commands, once installed go in the "add action" menu to add the following action : "Start a new MQTT subscription", leave everything with the default values by pressing "OK".

2/ on your Android phone, install any mqtt client, for example "MQTT Dashboard" (there are plenty others), add a broker and enter the same values in the settings as the ones you had in the plugin in step 1, now all you have to do is "Publish" to the topic named "eventghost" any message you want, and it will generate an event on your computer with your message as a payload.

You have noticed that you don't need any server, because the server is already located on the internet : test.mosquitto.org. In case you want to run your own MQTT server (broker), you need to install a broker, for example this one : https://mosquitto.org/ this way you will have full control of the server and clients part. But it's easier for you to start with the 2 easy steps I described above, once you get the hang of it you can go further and do more.

Post Reply