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.

X10 MouseRemote

Questions and comments specific to a particular plugin should go here.
Post Reply
Catscradler
Posts: 4
Joined: Fri Jun 10, 2011 1:58 am

X10 MouseRemote

Post by Catscradler »

This is a plugin for the serial X10 MouseRemote. Specifically for the MK19A package which consists of the JR20A RF remote along with the JR21A receiver which connects to a COM port (it can also connect via a PS/2 mouse port, but that's not part of this plugin).
mouseremote.png
mouseremote.png (10.29 KiB) Viewed 4200 times
To install the plugin, extract the attached X10Mouse.zip to your EventGhost\plugins directory. It should create an X10Mouse folder with two files inside.


Here's some notes for this plugin:

-When Windows sees the receiver for the first time, it installs the drivers for a Microsoft Serial Mouse. Go into the Windows Device Manager and disable it.

-If any other program has an open connection to the COM port that the receiver is on, EventGhost will fail to open it and give you an error message similar to
Exception in thread Thread-113:
Traceback (most recent call last):
File "threading.pyc", line 525, in __bootstrap_inner
File "threading.pyc", line 477, in run
File "C:\Program Files (x86)\EventGhost\eg\Classes\SerialThread.py", line 376, in ReceiveThreadProc
SerialError: (6, u'The handle is invalid.')

Make sure that the MS Serial Mouse device is disabled and that no other serial programs such as Hyperterminal, the original X10 software or maX10 are running.

-Once this plugin is enabled there's about a 20 second delay before it starts receiving events. Watch the red LED on the receiver. If it flickers when you press something on the remote, EventGhost should be getting input.

-MouseMove events carry a payload of relative x and y coordinates, where positive is right or up, and negative is the reverse. Here's a macro to make use of it:
mousemove.png
mousemove.png (6.94 KiB) Viewed 4200 times
That one in the middle is an EventGhost->Python Command with the text "eg.plugins.Mouse.MoveRelative(2*eg.event.payload['x'], 2*eg.event.payload['y'])"
In the autorepeat command, all the settings are 0.05
Fiddle with the numbers in the above two commands until you find something that works for you.

-With all the stray radio signals being thrown around these days the RF receiver gets quite a bit of junk input, pretty much all of which come in as valid mouse moves. I'd suggest dedicating one of the MouseRemote buttons (I use the A.B button) for only enabling the mouse functions when you want to use them.

-The mouse buttons on the MouseRemote only send buttondown and buttonup messages, so you won't be able to drag using it. I'll look into adding some macros to the Mouse plugin to solve that.
Attachments
X10Mouse.zip
(13.01 KiB) Downloaded 241 times
igvk
Experienced User
Posts: 60
Joined: Wed Jan 09, 2013 7:22 pm

Re: X10 MouseRemote

Post by igvk »

Hello,

I am trying to use this plugin, and it actually works, and I see the events from my X10 MouseRemote, connected via old USB-to-COM.

The strange thing is that when I also enable X10 plugin for my Snapstream Firefly, I see that same error "SerialError: (6, 'The handle is invalid.')".
Seems like there is some race condition or something - is X10 plugin trying to open the same port?

I need to manually re-enable the X10 MouseRemote plugin, and then they both work in parallel.
Is it possible to fix this problem?
Catscradler
Posts: 4
Joined: Fri Jun 10, 2011 1:58 am

Re: X10 MouseRemote

Post by Catscradler »

It looks like the X10 plugin doesn't do anything with the serial port, so it shouldn't interfere with this plugin. Loading up X10 after X10mouse doesn't cause that for me, but I don't have anything that X10 could connect to. In case something else is trying to use that port you could try changing the serial port assignment (Device Manager -> Ports -> (COMx) -> Port Settings -> Advanced) and set X10mouse to match.

If the COM port juggling doesn't work, you might be able to work around it by adding to the end of your Autostart:
Disable an item: Autostart -> X10 MouseRemote
Wait some time: 5
Enable an item: Autostart -> X10 MouseRemote
igvk
Experienced User
Posts: 60
Joined: Wed Jan 09, 2013 7:22 pm

Re: X10 MouseRemote

Post by igvk »

Changing COM port number does nothing to avoid this error.

But the wait trick solves the problem, so there is certainly something in X10 code that interferes with MouseRemote COM port opening.
This is a hack, but it works - although I didn't uderstand the reason for the error.

Thanks for the hint!
Tal56
Posts: 20
Joined: Tue Jun 22, 2010 6:47 pm

Re: X10 MouseRemote

Post by Tal56 »

There are a couple keys on the remote that are missing. Like the "TV" "CBL" "SAT"

I noticed they are not on the _init_.py file, I'd like to add them but how did you get the keytable code numbers for the buttons? Thanks
Catscradler
Posts: 4
Joined: Fri Jun 10, 2011 1:58 am

Re: X10 MouseRemote

Post by Catscradler »

The buttons "TV" "CBL" "SAT" and "VCR" switch the remote to IR mode so they're not detected by the RF receiver. Same with any other button presses while in an IR mode. The three other buttons that aren't detected by the receiver are "SETUP" "X10" and "TIMER".

You can confirm this with a terminal program such as RealTerm set to 1200 baud, no parity, 7 data bits and 2 stop bits, best displayed in binary with a width of 27 columns.

The keytable and most of the decoding logic came from the maX10 project.
Tal56
Posts: 20
Joined: Tue Jun 22, 2010 6:47 pm

Re: X10 MouseRemote

Post by Tal56 »

Thanks Catscradler, really appreciate the info and the quick response. I love how this works as I picked up a couple of these remotes/receivers and they are just great for sending commands because of the RF and can use them anywhere. Thanks so much for the plugin.
Post Reply