Page 1 of 1

Generic HID - LG Magic Remote

Posted: Sun Dec 28, 2014 10:28 pm
by Mando
Good day,

I purchased an LG Smart TV and the magic remote "AN-MR500G" comes bundled with it. So I started looking around on how to use the magic remote with its gyroscope capability to control my HTPC.

It connects to Windows normally through Bluetooth HID and label it "LGE Magic Remote MR14" as a Bluetooth HID mouse. Naturally, no interactions at all from the remote with Windows after pairing.

I launched EG and added the Generic HID plugin and choose LG Magic Remote checking the "Trigger Enduring events for buttons" and once I press OK, a stream of input keeps rolling in the log as shown in the image attached.
magic-1.jpg
magic-2.jpg
I was wondering how to go from here and try to get the remote`s buttons and gyroscope functionality to work with EG.

Thank you and have a Happy New Year!

Re: Generic HID - LG Magic Remote

Posted: Mon Dec 29, 2014 12:21 am
by zian
read read read, break, fix, repeat.
read more.

gyro remote sounds fun.
good luck.

Re: Generic HID - LG Magic Remote

Posted: Mon Dec 29, 2014 4:48 am
by Mando
Hi Zian,

Thank you for the quick reply.

Any pointers or hints ? I wouldn`t mind a link or two to read them ;) ... I searched the forum a couple of times and googled the subject thoroughly but currently I am stuck.

For example... Why the HID.Values are ascending even though I kept the remote stationary to limit any readings.. I am assuming a lot of data is being transmitted i.e.: gyro data. button data, battery status and so on.

Re: Generic HID - LG Magic Remote

Posted: Mon Dec 29, 2014 12:18 pm
by zian
The remote looks like it IS working with EG (see left side of your images?)

What do you want EG to do?
That would be the right side of your images.... Event/config tree.
You have nothing there but the one.
FILL it. Do stuff.
Add plug in's, add programs, add tasks... do stuff.
Drag and drop.

http://www.eventghost.net/docs/

http://www.eventghost.net/mediawiki/ind ... =Main_Page

Re: Generic HID - LG Magic Remote

Posted: Mon Dec 29, 2014 6:07 pm
by Mando
zian wrote:The remote looks like it IS working with EG (see left side of your images?)

What do you want EG to do?
That would be the right side of your images.... Event/config tree.
You have nothing there but the one.
FILL it. Do stuff.
Add plug in's, add programs, add tasks... do stuff.
Drag and drop.

http://www.eventghost.net/docs/

http://www.eventghost.net/mediawiki/ind ... =Main_Page

I agree with you that it seems that EG is working with the remote. However, the events keeps scrolling fast in the log (left side of the image) even when I leave the remote on the disk i.e.stationary. I would like to be able to control mouse cursor when the remote is moved (take advantage of the gyroscopic function of the remote). Is there any link to where I can link gyro and axis of the mouse X, Y. Or even to start understanding the data flowing from the remote ?

Thank you for the links. I tried linking HID.Values from the log to the Mouse->Move absolute and also with Move Relative but to no avail. Obviously I do not understand the meaning of the values the remote is generating.

Thank you again Zian.

Re: Generic HID - LG Magic Remote

Posted: Tue Dec 30, 2014 2:41 am
by Mando
So I figured that I am not getting something helpful with the "Trigger Enduring events for buttons" so I changed it "Use Raw Data as event name".

I am attaching a picture illustrating my findings... Obviously the raw data shows that the remote sends a block of data with several bytes ...Each byte is responsible for sending a particular output from the remote. I am not aware of the significance of each byte yet.. Hopefully someone who knows would help ..that would be greatly appreciated. The bytes I am aware of by now are the red underlined in the picture "8044" corresponds to "OK" or enter button and "8007" which corresponds to the left button... by continuing the trials I can get all the codes of other buttons that is no problem... but I still do not know which parts corresponds to the X and Y axis of the gyroscope.

At this stage ...any help would be truly appreciated...
rawdata.jpg

Re: Generic HID - LG Magic Remote

Posted: Wed Dec 31, 2014 4:59 am
by Mando
At this stage, I am half way through understanding the bytes that LG Magic Remote sends through the Bluetooth HID, but I have no Python background to make a python script comparing hexadecimal strings and linking the results to EG actions. If anyone is willing to help writing the python code I could continue testing and come up with the rest of the used bytes which I do not understand yet.

Re: Generic HID - LG Magic Remote

Posted: Wed Dec 31, 2014 12:18 pm
by zian
Gyro to me = someplace in space = Damn near infinite possibilities, codes, signals...

=

Goodluck infinatim

=

Me smart allic.

Re: Generic HID - LG Magic Remote

Posted: Sat Jan 03, 2015 6:52 am
by Mando
Hi Zian,

I managed to start a python script which can now check if the value 8044 is pressed or not.

Code: Select all

newValue = str(eg.event.suffix)
test1 = newValue[10:14]

if test1 == '8044':
    eg.TriggerEvent("LeftMouseBtn")
else:
    print "NO"
For some reason I can not interact directly with the Mouse plugin and have to let the script call an event linked to the Mouse plugin.

When I am testing the script now...if I press the "OK" button I get the left mouse click .. but the script is only ON when I am testing it.
I have two easy questions which I hope you can help me with.

1- How to get the python script to always "listen" to eg.event.suffix ? since I am getting continuous events, I want the script to be always checking the new values.

2- Is there a way to directly access the Mouse plugin so I can start working on the relative and absolute movement of the mouse ?

Thank you

Re: Generic HID - LG Magic Remote

Posted: Sat Jan 03, 2015 10:38 am
by krambriw
1) add an event with just a star (*) to the macro

2) use the famous 'Copy As Python' command and paste the result into your script. As example for Mouse actions, this is how it will look

Code: Select all

#move the cursor to center  of screen
eg.plugins.Mouse.MoveAbsolute(None, None, None, True)

#move the cursor to position x=8, y=15
eg.plugins.Mouse.MoveAbsolute(8, 15, None, False)