How to blast IR to an antenna rotator box when changing a TV channel (1 Viewer)

valdi

Portal Member
November 21, 2011
23
6
Toronto
Home Country
Canada Canada
GJC, A couple questions and issues for you,

1) Couch Potatoes are rejoicing everywhere...You have solved the issue of AirplaneInteruptus in my house. Now that I can pinpoint the antenna from within MediaPortal, the airplanes in the landing pattern passing above my house do not effect reception on any of my channels. As well, I can now access 4 more channels because of the pinpoint accuracy this plug-in enables without my getting up to manually move antenna.

2) When loading EventGhostAntennaRotatorEventGhostConfig.xml for the first time a Win7 Firewall Dialog presents itself asking for permission to exclude. I OK'd the exception and no errors presented themselves.

3) I don't use a HID device so I deleted that plugin from your .XML config file. Is that OK?

4) The attached is my AntennaRotatorEventGhostConfig log showing some errors whenever the Antenna event is fired. EventGhost is posting errors after every Antenna turn. Everything still works as it should, but up comes the script errors.

5) My MediaPortal is working on a triple monitor set-up. 2 LCD's in the office and 1 LCD in the Bedroom. When an Antenna change is requested and the Dialog Box presents itself, I would want the message to be displayed on the Monitor that MediaPortal is being displayed on. Instead, Monitor #1 is showing the Dialog Box and it is not showing on the monitor that I have MediaPortal being currently displayed on. Could you figure out a way to get the dialog over to my other monitor to which MediaPortal is being viewed?

6) To the above question, would it be possible to use the EventGhost built-in message dialog to let the user know Antenna is being moved?

7) During Set-up within Antenna Rotator Plug Configuration Screen within TV Server Configuration, I have set all my presets to zero and have not input the secondary Azimuth Degrees for each station. Meaning, if ABC gets good reception at 170 degrees and it also get good reception at 000 degrees, I have not entered ABC twice. Long-term will this be an issue when several Clients are requesting Antenna access? To clarify the question, all my channels are located within a 60 degree arc. I don't believe the Antenna will ever be out of that 60 degree range.

8) The last issue I have is that this plug-in will not do my Laundry or Vacuum my Stairs. Please rectify.

Excellent Work! You are very talented.

valdi
 

GJC

Portal Pro
March 10, 2012
97
11
Home Country
Canada Canada
Hi Valdi,

Thanks for the wonderful feedback! I've been checking the forum every day wondering if the plug-in installed ok and how it was working out. As a developer you can get into a certain way of doing things and can sometimes miss the obvious.

I'm surprised that you'd get a firewall warning when trying to import settings, but thankfully that's not a problem.

Did I leave that HID device stuff in there? Oops! Yes, it's ok to remove it. I have it in there to get my remote to work properly with MP.

I mentioned in the documentation (and in the script file) that you'll see an exception in the EventGhost log each time you rotate the antenna. The problem is that the timer function in the wx library needs to be run on the main application thread. If you don't, then a warning exception is logged. EventGhost doesn't run the python code on the main application thread, so I couldn't see anything I could do in a "timely" (pardon the pun) fashion. It also didn't seem worth much effort as the timer works anyway. I'll probably have a crack at another approach before I make an "official" release of the plug-in, but I'd be grateful if there's an experienced Python developer out there that can help out.

Regarding multiple monitors, I'm presuming that you have one PC and three monitors on it? I'd considered the possibility of 3 PCs and one TV Server. You'd have a copy of EventGhost running on each PC and then have the batch file on TV Server send the event to all 3 PCs through their respective EventGhosts. However, for a single PC and 3 monitors, the only thing I can think of would be to modify the script to display the dialog at a set of coordinates that maps to the monitor that has MP displayed. I think this could be done using the logic I have to find the MP window and then use its coordinates to determine the position of the message. Hmmm, I'll try to take a peek at that.

I considered the EventGhost message dialog, but it needs to be triggered as an event and I didn't know how to close it programmatically after the rotation period.

It's not necessary to enter additional azimuths for a station if there are no other stations near those azimuths. The idea is that you want "overlap" between azimuth ranges to help find a common position that will satisfy all active channels. Keep in mind, however, that you probably have several local stations that you can pick up at almost any azimuth, so you may have overlaps that you hadn't considered. Adding more azimuths will never hurt as long as you have reliable reception at those azimuths.

Couch potatoes will still have to vacuum the stairs and do laundry, at least for now. We'll look into that for version 2.0. ;)[DOUBLEPOST=1342731886][/DOUBLEPOST]BTW, thanks for posting the ChannelMaster codes. I'll incorporate them in the next release of the python script.
 

GJC

Portal Pro
March 10, 2012
97
11
Home Country
Canada Canada
Here's an updated version of the installation package. The plug-in hasn't changed except that I changed its compatibility tag to specify that it's compatible with MP 1.2.0 beta and later. Note that my testing was done on MP v1.2.3, but I would like to know if the 1.2beta release is also happy with it if someone out there can give it a try? I also updated the documentation (small tweaks).

Valdi, the AntennaRotatorEventGhostConfic.xml file contains a new EventGhost python script that includes your ChannelMaster codes and eliminates the exception that you reported. It also now has a progress meter to show the progress of the antenna rotation and it should place the window roughly in the center of the MP screen, regardless of which monitor you are using to display MP. Please give it a try and let me know how it goes!
 

Attachments

  • AntennaRotatorPlugin.mpe1
    25.5 KB
  • AntennaRotatorEventGhostConfig.xml
    14.3 KB
  • Antenna Rotator Plug.pdf
    847.5 KB

valdi

Portal Member
November 21, 2011
23
6
Toronto
Home Country
Canada Canada
Fantastic GJC, I have some free time on Thu, I'll load it up and try it out. FYI, I have had not one hiccup concerning your plugin. Even been through 4 or 5 reboots and it just keeps working. I'll let you know later in the week if any issues. Thanx very much!
 

valdi

Portal Member
November 21, 2011
23
6
Toronto
Home Country
Canada Canada
GJC, Works great, like the fact that MediaPortal plugin has been removed from the EventGhost Config file. Makes it easier to add back in existing MediaPortal macros. You've got the message coming up on the screen according to where MediaPortal is being displayed. All good. Thanks very much. Still no laundry or stairs though.

Question: Within the DoShowDlg Class beginning at line 148 within your Python script, would that be the place I could make use of a bigger font using win32gui? I've got a 1920x1050 LCD and the dialog box is rather small to view from 10' away. It doesn't give the "ohh cool" factor because you have to squint at the screen to read the message. The win32gui is a little over my head at the moment. If I figure out how to increase the font size by adding some code, would the msgbox dynamically increase size to accommodate a larger sized font? Sorry to be picky and/or ignorant.
 

GJC

Portal Pro
March 10, 2012
97
11
Home Country
Canada Canada
Hi Valdi,

Thanks for the feedback! So far it looks like you are my only beta tester, and you're doing a great job.

No problem with the font. I'll try to sort it out as soon as possible. My 25" monitor is only 2' in front of my face, so I never thought the font was too small...that's why we need "real world testers"! :)

Hopefully I'll get a bit of time to look at this tonight.

I'd like to work on the laundry and stairs issue, but my wife doesn't think I could do a good job of it.:rolleyes:
 

GJC

Portal Pro
March 10, 2012
97
11
Home Country
Canada Canada
Hi Valdi,

Give this a try. I had to throw out Python's version of wx.ProgressDialog and create my own in order to set the font size. If you want the font bigger still, go to line 184 and change '18' to something bigger. The box will resize accordingly.
 

Attachments

  • AntennaRotatorEventGhostConfig.xml
    15 KB

valdi

Portal Member
November 21, 2011
23
6
Toronto
Home Country
Canada Canada
Hi, Very nice GJC, 18 point font was just right.

Thanx again. Can't say anything bad about this except when you issue the EventGhostConfig.xml add in the MediaPortal plugin, but don't add the tree of actions. That way I can just cut and paste my customized MediaPortal Action Tree easy peasy.

One small thing: Is it possible to set the font size of dialog message box inside of TV-Server config?

One big thing: Now....feel free to tell me to jump in the lake, BUT....I do understand your receiving variables from TV-Server in order to determine where to position the antenna; would it be possible to send info back to MediaPortal NOT TV-Server? Then, MediaPortal is displaying the messages rather than Windows, that way, maybe you could get the message information from Python Script into a "skin-like?" dialog box? Making this little gem a seamless integration/experience? I know, I know, what is this guy's problem. In general, the more "behind the scenes" or subdued visually something is, the more it becomes part of the background and not noticed. Your little plugin though, should not be on the sidelines. I show your plugin to anyone who will look. I mean, come on, I grew up on TRS-80 being able to have X-10 turn on and off a light. That was very cool back then. Now I got a full DVR, File Server and TV all in one. Oh and it's the office computer too. All that and not paying the Cable Company *hit. Displaying a Windows system generated message box is fine, but it doesn't match what's going on behind it on a HTPC screen. If that information was displayed in a MediaPortal visual cue, then that would be noticed, commented upon and look really cool and professional. (Does your Rogers Box do that, I ask?)

Anyways, that probably would entail writing another plugin interfacing with any number of skins. Too much too ask I'm sure. Not sure it's even possible, but hey, just throwing an idea into the air.

Thanx much for all your hard work. It is much appreciated!!

Let me know if you need anything I can provide, more than happy to return the favor.

Valdi
 

GJC

Portal Pro
March 10, 2012
97
11
Home Country
Canada Canada
Hi Valdi,

I guess the lake is warm this time of year...;)

I don't quite understand your comment about the "EventGhostConfig.xml add", am I'm missing something about EventGhost's abilities to import data?

To specify the dialog font size inside TV-Server config is certainly possible, but it will add yet another parameter to the batch file and I don't think it's really necessary. Anyone who wants to tweak that just needs to look at the script. I suppose I could make it a variable under the TODO section at the top of the script to make it easy though.

I posted a request to other developers to tell me how to display the message on MediaPortal from TV-Server and all I got was silence. I think that there is some handshaking that goes on between the two, but it looks like MediaPortal interprets the handshake codes and displays the message itself. This actually makes sense since TV-Server may also be used by XBMC and ForTheRecord, not just MP. If there's a way to do it, well, it would have saved me a lot of hassle with Python.

Thanks again for all your beta testing. I'll look at officially releasing the plug-in soon, I just have to figure out how to submit my documentation to the Wiki, the rest looks to be reasonably well explained in the MP Developer's Wiki.
 
Last edited:

valdi

Portal Member
November 21, 2011
23
6
Toronto
Home Country
Canada Canada
Hi GJC, Sorry out of town for a few days,

Concerning the EventGhostConfig.xml...What I mean is that when you distribute the Config file include the MediaPortal Plugin but don't include the action tree so that its easy to cut and paste my own custom action tree.

Don't worry about the font size change in the TV-Server configuration screen, i'll change via the python script.

One thing I have noticed recently is that when dialog box comes up informing of direction change, the box does not close without pressing button on remote or mouse click on open MediaPortal window.

PS, One other thing, would it, or how is it possible to select which port/jack emits the IR signal? Rather than having All ports emitting?

V
 
Last edited:

Users who are viewing this thread

Top Bottom