Network Broadcast Sender / Listener

Questions and comments specific to a particular plugin should go here.
Post Reply
kingtd
Plugin Developer
Posts: 78
Joined: Fri Jul 13, 2007 7:39 am

Network Broadcast Sender / Listener

Post by kingtd » Tue Feb 05, 2008 5:06 pm

UPDATED: 10/12/09 - Several changes
- Replaced threading code to fix issues with socket delaying Eventghost exit.
- Added checkbox to toggle "self" broadcasts
- Other minor bug fixes and configuration dialog improvement.

UPDATED: 9/29/09 - Better support for payloads

UPDATED: 6/27/08 - Now Broadcaster uses a single plugin for send and receive.

I've got several PC's at the house and they act as part of my overall automation system. Not only do they all run Eventghost so that they can trigger various events, but in many cases, I want to send commands to all of them at once. The existing "Network Sender" is good for many things, but it has some shortcomings:

- For each PC you want to target, you need to have a Network Sender plugin added to your Eventghost file
- For each command you send, you have to send it as many times as you have PC's
- In some cases, PC's may not be on and you'll get a delay and an error when the Network Sender doesn't work.

One key example of how this is limiting for me is my distributed OSD. My computers are near my main TV/Living room where the stereo is typically playing. I have the capability to change the volume of the stereo through my PC's using Eventghost, programmed to media keys on my keyboard. In order to see the current volume level (using my HK receiver plugin I previously contributed), I send that information back to my other PC's. But this means for every volume change, I have to send the same thing 5 times - once to each PC - and this can take longer than it does for the actual volume to change.

With this pair of plugins, you can simply broadcast informational messages like this over your network, and anyone who's listening can pick them up. You wouldn't want to have this turn your oven on or do dangerous actions since it lacks the basic security of the Network Sender, but it works great for general low impact items.

Another example of how I use this ties into my overall movie watching scheme. If you're in the main room and you hit the "movie" button, it dims all of my insteon lights, turns on some hallway lighting, switches media center to DVD, turns on the receiver, and the projector. With this plugin I also send a "Not Busy Off" broadcast, and any of my PC's which don't have a user actively working on them will switch their monitor off and go into minimal power mode. More darkness+quiet = better movies. =)

I've got a bunch of other esoteric uses, but enough about that. Here are the plugins. Simply provide a port and a broadcast address (the default will work for most people) and you're all set.

-K
Attachments
Broadcaster.zip
(3.03 KiB) Downloaded 718 times
Last edited by kingtd on Mon Oct 12, 2009 8:26 pm, edited 3 times in total.

CollinR
Experienced User
Posts: 265
Joined: Tue Sep 05, 2006 7:16 am
Location: Oklahoma
Contact:

Re: Network Broadcast Sender / Listener

Post by CollinR » Sun Feb 17, 2008 6:16 pm

I really like this concept but I have been having troubles getting it started.

Is there a specific process I must go through or anything to modify to get this running?

I am using version 3.6.941

This is the error I get

Code: Select all

 Can't read __init__.py for plugin "BroadcastListener"
 Traceback (most recent call last) (941):
   File "C:\Program Files\EventGhost\eg\PluginTools.py", line 262, in GetPluginInfo
   File "plugins/BroadcastListener/__init__.py", line 25, in <module>
   File "C:\Program Files\EventGhost\eg\Init.py", line 285, in __getattr__
 AttributeError
 Can't read __init__.py for plugin "BroadcastSender"
 Traceback (most recent call last) (941):
   File "C:\Program Files\EventGhost\eg\PluginTools.py", line 262, in GetPluginInfo
   File "plugins/BroadcastSender/__init__.py", line 25, in <module>
   File "C:\Program Files\EventGhost\eg\Init.py", line 285, in __getattr__
 AttributeError
Thanks this is a great addition, no idea why it took me soo long to play with it. Also no clue why this doesn't have 20 replies. lol

kingtd
Plugin Developer
Posts: 78
Joined: Fri Jul 13, 2007 7:39 am

Re: Network Broadcast Sender / Listener

Post by kingtd » Sun Feb 17, 2008 7:42 pm

I've been using the beta builds for a while so it might be that there are certain configuration options that aren't supported on your build. Currently I use the 1242 build with the 1262 update - basically the last build that they put out before the 2008 hiatus. http://www.eventghost.org/downloads/

Not sure if that's an option for you to upgrade or not, but unfortunately is probably the only way it would work.

Thanks for all the kind words - a plugin like this that doesn't require complex handshaking or even check for a device to be on is very useful for certain things in my environment, and I'm glad to hear it sounds useul to someone else as well.

-K

User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: Network Broadcast Sender / Listener

Post by Bitmonster » Wed Feb 27, 2008 6:38 pm

Well, the Network plugins surely need some rethinking and enhancements. They were created to be compatible to Girder and therefore they have inherited all the problems and limitation of the Girder implementation. I don't want to drop the Girder protocol completely, because it is also used by Netremote. And I don't want to have half a dozen different Network plugins, because this would only confuse the users. So every enhancement should be merged into the old plugins if possible.

Using UDP is a nice idea, but actually I would like to stay with TCP/IP (because UDP won't work with Girder/Netremote). One approach to achieve a similar functionality would be to create some list of computer names in the Network Sender configuration dialog. There the user can define a bunch of single IPs and give them more readable names. The action dialog would then get a checkbox list with these names, where the user can enable/disable individual machines that should receive the event.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!

kingtd
Plugin Developer
Posts: 78
Joined: Fri Jul 13, 2007 7:39 am

Re: Network Broadcast Sender / Listener

Post by kingtd » Wed Feb 27, 2008 10:10 pm

Using TCP/IP is not going to work in several cases as I mentioned before. When you make TCP calls you have to wait for the remote device to either respond or time out. For me, there's no way of knowing which devices will be on or off at any given time. While it could potentially be written to thread out and attempt to communicate in parallel, this seems far more complex than simply supporting a broadcast mechanism. The core benefit here is that UDP is connectionless and for simple status messages like "Volume on the receiver was increased to -30", or "if you're a computer that's on, please blank your screen" it's much faster and easier to broadcast a single time and let anyone who's listening act appropriately on the info.

Sure you wouldn't want to have "a half dozen plugins" for networking, but TCP is not necessarily the answer. You definitely want to keep the secured handshaking girder compatible version too, but it doesn't solve every problem.

I'd also point out that there's not a lot of code releases coming from the devs at the moment, so I wouldn't recommend be too rough on those of us in the community that have come up with unique solutions unless you plan on sitting down and incorporating this directly in the product. The whole point of solutions like this is to be
open and flexible.

-K

User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: Network Broadcast Sender / Listener

Post by Bitmonster » Wed Feb 27, 2008 10:51 pm

kingtd wrote:I'd also point out that there's not a lot of code releases coming from the devs at the moment, so I wouldn't recommend be too rough on those of us in the community that have come up with unique solutions unless you plan on sitting down and incorporating this directly in the product. The whole point of solutions like this is to be
open and flexible.

-K
My post was not intended to offend you. I just wanted to collect ideas to get a "Network V2 Plugin" someday, that could supersede the current implementations of the Network plugins. For example Pako also had some ideas regarding the limited payload support of the protocol, that are surely missing in the current implementation. It is fine, if there is a plugin for every special case, but I like to unify things, so one plugin can solve many special cases.

UDP absolutely has its elegance, because it uses little resources on multicast and it is easy and readable to implement. It would also be possible to add a "use UDP" checkbox to the current Network plugins for example and merge your code into them. But using multiple TCP requests with threading wouldn't be impossible I guess, since most users will never control more than a handful of machines in their setup. And it would have the benefit of a more "unified" way. But it might have a bad impact on CPU consumption for example that needs to be checked.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!

User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: Network Broadcast Sender / Listener

Post by Bitmonster » Wed Feb 27, 2008 11:36 pm

Uhps, it wasn't Pako with the payloads. It was your modification here. :)
Pako made another enhancement request here.

There are also some modifications from owagner regarding bi-directional Netremote support, that need to be merged someday.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!

JoeInBend
Posts: 10
Joined: Mon Mar 10, 2008 2:59 pm

Re: Network Broadcast Sender / Listener

Post by JoeInBend » Thu Mar 13, 2008 3:30 pm

Hi Kingtd... I am VERY interested in your plugin, because of your mention that you control your Insteon hardware with it. This has been something I have poured over the forums with no success. Can you give a quick how-to tutorial on setting this up to send/receive data to the Insteon PLC? This would really nail down a major milestone in my HA and xLobby integration!! :D

kingtd
Plugin Developer
Posts: 78
Joined: Fri Jul 13, 2007 7:39 am

Re: Network Broadcast Sender / Listener

Post by kingtd » Fri Jun 27, 2008 10:56 pm

@Joe

I had been using a custom Java command-line implementation that talked to my ISY-26, so if you've just got a standard PLC/PLM - my stuff isn't going to help you too much. I had tons of problems with reliability with the USB based PLC that I had, to the point where things would be broken more often than they were working.

Earlier today I posted my latest Insteon integration focus - the EventGhost plugin for the ISY-26. Probably doesn't help unless you own one, but so far for me it's been fantastic.

~K

specter333
Experienced User
Posts: 95
Joined: Thu Dec 27, 2007 12:26 am

Re: Network Broadcast Sender / Listener

Post by specter333 » Tue Dec 02, 2008 2:20 am

Thank you for this plugin. I was just going through the forums again to try to figure out what was wrong with the network event sender this time. I don't know if my network settings change or what but it will work for a while then just quit. Sometimes it would come back by it's self but it hasn't worked now in a few weeks.

I added this pugin and everything worked correctly right off the bat, no settings I had to change. I have control of both computers again.

Thanks again.

User avatar
Fiasco
Plugin Developer
Posts: 215
Joined: Fri Jul 24, 2009 5:32 am
Location: St. Louis MO
Contact:

Re: Network Broadcast Sender / Listener

Post by Fiasco » Fri Sep 25, 2009 1:21 pm

Does this plugin automatically forward any events to the network?

User avatar
Fiasco
Plugin Developer
Posts: 215
Joined: Fri Jul 24, 2009 5:32 am
Location: St. Louis MO
Contact:

Re: Network Broadcast Sender / Listener

Post by Fiasco » Sun Sep 27, 2009 9:56 pm

Is there anyway to set this plugin up to automatically broadcast all events or do you have to create broadcast events for every event I want to forward (which will be alot)

How do I broadcast an event that is a constantly changing variable (like tuner frequency or volume level)?

kingtd
Plugin Developer
Posts: 78
Joined: Fri Jul 13, 2007 7:39 am

Re: Network Broadcast Sender / Listener

Post by kingtd » Sun Sep 27, 2009 10:14 pm

I haven't found a way to just wildcard all events and broadcast. Not specific to this addon, just in general. ~K

User avatar
Fiasco
Plugin Developer
Posts: 215
Joined: Fri Jul 24, 2009 5:32 am
Location: St. Louis MO
Contact:

Re: Network Broadcast Sender / Listener

Post by Fiasco » Sun Sep 27, 2009 10:49 pm

I figured it out.

Use a wildcard for the event * and use {eg.event.string} for the argument passed.

User avatar
Fiasco
Plugin Developer
Posts: 215
Joined: Fri Jul 24, 2009 5:32 am
Location: St. Louis MO
Contact:

Re: Network Broadcast Sender / Listener

Post by Fiasco » Wed Sep 30, 2009 12:02 am

Big shortcoming in this plugin. It doesn't pass payload along.

I was hoping it passed the event + payload intact.

For example, in my Onkyo plugin, I fire a MVL event and the payload is a hexidecimal string representing the volume level I want to jump to. Broadcaster doesn't transmit the payload instead sending the IP address of the sending computer's IP as the payload.

huge bummer

Post Reply