Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

On Screen Menu over a LAN

If you have a question or need help, this is the place to be.
User avatar
WharfRat
Experienced User
Posts: 159
Joined: Wed Dec 25, 2013 11:56 am

Re: On Screen Menu over a LAN

Post by WharfRat »

Problem 3: How to detect the presence of a remote computer

Sorry, I had some other things to take care of.

As noted earlier, the strategy for this would be:
  • local computer - UDP broadcast with IP address during Main.OnInit
    remote computers - TCP acknowledge with network name and IP address
For the UDP broadcast, we will use the Broadcaster plugin.

The Broadcaster plugin also took me a while to figure out correctly.
I think that this also had to do with the fact that I am using a simple crossover cable for the network.
For a long time I could not get the UDP broadcast to show up on the other computer.
Even playing around with the firewall settings and IP addresses of both machines were hopeless.
Eventually I got it working.
Usually I use the default settings for everything.
When I added the Broadcaster plugin, the UDP port was set to 33333.
When I added the Broadcast Action, the port was set to default.
I do not know if this problem is specific to crossover cable networks, but that will not work.
You have to change the port in the Broadcast Action settings to the same port in the Broadcaster plugin settings.

Fortunately, that can be achieved automatically in Python.
So instead of adding the Broadcast Action to the configuration tree, use Python to call the Broadcast method with the correct port setting.
Another advantage of using Python is that we can check if the computer is connected to the LAN.
If you are not connected to the LAN, then a UDP broadcast will cause an error.

This crossover LAN cable approach is proving to be quite useful.
It has provided two useful techniques that allow for robust configuration trees.

Earlier I asked for info about IP addresses on more elaborate LANs.
It would also be interesting to know if the default port of the Broacaster plugin behaves the same way in elaborate LANs.

There is something else that I have noticed with the Broadcaster plugin, it is not really a bug, but an inconsistency.
It does not show the payload in the Log window.
It is not such a big deal, just something that is unusual.

Now I just need to add the TCP acknowledge part of this problem.
I think I will post the PC1 and PC2 configurations that incorporate the problem 2 and problem 3 solutions when I have finished them.
Then we can tackle problem 4, which will give us a configuration that can be used on any computer, in networks with more than 2 computers.
EventGhost 0.4.1.r1640
PHX01RN plugin v3.0.1
Windows XP 32bit (v5.1 Build 2600 Service Pack 2)
Windows7 64bit (v6.1 Build 7601 Service Pack 1)
User avatar
WharfRat
Experienced User
Posts: 159
Joined: Wed Dec 25, 2013 11:56 am

Re: On Screen Menu over a LAN

Post by WharfRat »

OK...

Problem 3, which was easy to conceptualize, but more difficult to implement, has now been incorporated.
PC1_and_PC2_v05.zip
(7.98 KiB) Downloaded 117 times
This was certainly the most difficult part of the process.

The name and IP address of the computers are being exchanged.
Therefore the actual network name of each computer now appears in the computer menu.
And only the connected computers are displayed in that menu.

But the IP addresses are still not automatically configured in NES, and we are still limited to 2 computers on the LAN.

A lot of the Actions have been reimplemented as Python scripts for error checking.
The configuration tree has also been reorganized further.

However, there is still one small problem.
As I mentioned before, I use a crossover cable for my network.
If the LAN is not connected when one of the configuration is loaded, then Broadcaster will not receive the UDP broadcast from the other computer.
The problem is with the Broadcaster plugin.
The solution, although inconvenient, is to restart the configuration on the disconnected computer.
If there was a generated event when the IP address of the computer changes from 127.0.0.1 to its real IP address, then that could be a solution.
I would be interested to know if anyone with a LAN switch or hub can tell me if the IP address is 127.0.0.1 when the other computer is off, but the hub/switch is on.

Everything is in place for the switch from NES/NER to TCP Events.
Last edited by WharfRat on Tue Oct 21, 2014 12:57 pm, edited 1 time in total.
EventGhost 0.4.1.r1640
PHX01RN plugin v3.0.1
Windows XP 32bit (v5.1 Build 2600 Service Pack 2)
Windows7 64bit (v6.1 Build 7601 Service Pack 1)
User avatar
WharfRat
Experienced User
Posts: 159
Joined: Wed Dec 25, 2013 11:56 am

Re: On Screen Menu over a LAN

Post by WharfRat »

Problem 4: How to configure an instance of NES for each detected computer

The best approach, as mentioned before, is to use TCP Events instead of NES/NER.
The previous example configurations have been designed to do that simply.
I will post the result here today or tomorrow.
EventGhost 0.4.1.r1640
PHX01RN plugin v3.0.1
Windows XP 32bit (v5.1 Build 2600 Service Pack 2)
Windows7 64bit (v6.1 Build 7601 Service Pack 1)
User avatar
WharfRat
Experienced User
Posts: 159
Joined: Wed Dec 25, 2013 11:56 am

Re: On Screen Menu over a LAN

Post by WharfRat »

As promised, here is the solution to problem 4...
PCn_v05.zip
(3.96 KiB) Downloaded 106 times
It has the same version number as PC1_and_PC2_v05.zip because the configuration tree is almost exactly the same.
The only difference is that it uses the TCP Events plugin instead of NES/NER, and the context 'programs' are different.
It only has one configuration file in it, because it does not depend on which computer it is used for.

You will need to download and install the TCP Events plugin.

The benefits of this version (the TCP Events version) are:
  • no need to configure the IP adresses
    no limit to the number of computers with EventGhost on the LAN that can be controlled
It is completely automatic.

If someone with a more elaborate LAN (more than 2 computers) can test this for me, I would really appreciate it.
And, if anyone can tell me about the LAN hub/switch/router things I talked about here earlier, that would also be great.

Thanks, WharfRat..
EventGhost 0.4.1.r1640
PHX01RN plugin v3.0.1
Windows XP 32bit (v5.1 Build 2600 Service Pack 2)
Windows7 64bit (v6.1 Build 7601 Service Pack 1)
Post Reply