Git Product home page Git Product logo

magicremoteservice's Introduction

MagicRemoteService

Use your LG Magic Remote as a Windows mouse and control your PC with the LG Magic Remote from your LG WebOS TV. MagicRemoteService is a Windows service providing computer remote control from a WebOS app on LG WebOS TV. MagicRemoteService work without rooting your TV. Tested with WebOS 6.0 (OLED65C1, OLED48C1) and Windows 10.

Introduction

How it works

MagicRemoteService is composed of two apps, one for TV sending magic remote inputs and one other for PC reproducing mouse and keyboard inputs. The TV app uses WebOS API and DOM events to catch magic remote inputs, WebSockets (TCP) for main data and Node.js dgram (UDP) for Wake-on-LAN functionality. The PC app uses System.Net.Sockets to receive main data and SendInput Win32 API to reproduce mouse and keyboard inputs.

About security

There is no encryption data between the TV and the PC. Don't use it if you are unsure of the security of your local network. I strongly recommend to not use it on the internet without a VPN connection. Don't use it to enter password, bank card or any other sensitive information. I clear myself of any responsibility if you got data hacked.

Possible Improvement

  • I already tried Node.js net (TCP) for the main data exchange to get ride of the WebSockets exchange protocol, but using service on TV had really poor performance compared to WebSockets.
  • Find a way to detect focus in TextBox control on Windows to automatically pop up the WebOS keyboard.

Installation

  • Install WebOS Command line interface on your PC. Please refer to CLI Installation.
  • Install and activate developer mode app on your LG WebOS TV. Please refer to Installing Developer Mode app and Turning Developer Mode on.
  • Open MagicRemoteService on PC.
  • Add your TV. You need to switch on the "Key Server" option on the developer mode app on your LG WebOS TV before confirm. Please refer to Connecting with CLI.
  • Select a TV then configure and install it.
  • Configure PC and save.
  • (Optionnal) Configure Remote and save.
  • Others
    • (Optionnal) Setup Wake-on-LAN on your motherboard's PC.
    • (Optionnal) Setup Windows auto logon. Please refer to Turn on automatic logon in Windows.
    • (Optionnal) Setup a scheduled task to keep developer mode activated with ares command on your personal server. Please refer to ares-extend-dev.

Using MagicRemoteService

MagicRemoteService need to run PC and TV app. TV and PC need properly network and video input wired as you configured in installation step.

Default Magic remote inputs :

  • The red key shuts down or starts up your PC.
  • The yellow key sends a right click to the PC.
  • The green key opens Windows menu.
  • The blue key pops up the WebOS keyboard.
  • The return key sends an escape key to the PC.
  • The navigation keys sends arrows keys to the PC.
  • A short middle click sends a left click to the PC.
  • A long middle click sends a right click to the PC.
  • A wheel scroll is sent to the PC.

If you are stuck at startup because Wake-on-LAN didn't work, you can do a long press on the return button to relaunch the app or starts up PC manually.

Some debugs logs notifications can appear at the bottom of the screen. Short click on it to hide.

I strongly recommend adding a Windows automatic screen shutdown to prevent pixel remaining with OLED TV.

Updating MagicRemoteService

After almost all MagicRemoteService updates, for changes to take effect and to prevent compatibility bugs, you need to reinstall the TV app.

Be careful while updating MagicRemoteService on the PC if you have "Automatically launch at startup" option checked or older executable file version running. You need to stop MagicRemoteService in your Windows service list or any running instance and replace the executable file. Otherwise there is a chance, due to the unique allowed running instance and even if you launch a new version, to keep an older version running.

If you want to change the location of the executable file and if you have "Automatically launch at startup" option checked, you need to stop MagicRemoteService in your Windows service list and any running instance. Once you have done it, you will be able to move the executable. Finally, you will need to resave the PC tab to reconfigure the Windows service with the new path.

magicremoteservice's People

Contributors

cathwyler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

magicremoteservice's Issues

Failed Windows 11 attempt

Service had been stable. Upgraded htpc from Windows 10 to 11 and have run into an issue.

App appears to function correctly, can install on TV, but mouse control is not working.

Any thoughts? Otherwise I’ll just revert to W10.

LG55EG9109, Blackscreen with small box, no inputs, no traffic?

Hi!
I was very excited when I discovered this program! Thank you very much for working on it!

So, here is my problem:
I installed everything using your description and I don't think I missed anything (I hope).
When I start the app on the TV I get a black screen with a small version of my PC-Display at the top left corner.
I also get no inputs from the remote on my PC.

I looked at the other resolved issues, but I was not able to solve mine.

My Setup:
TV: LG 55EG9109
Software version: 04.06.75

PC:
Win10 Pro Version 10.0.19045 Build 19045
Path: C:\Program Files (x86)\MagicRemoteService_1.2.2.2 (I have to run it as Admin)

image

image
image
image

I tried to log the traffic with wireshark.
I saw something happening on port 9922 after pressing the "install on TV" button.

image

I was however not able to see anything happening on port 9942 when just moving the remote or pressing buttons on it.
Although I am not sure if I set everything up correctly ... I am not exactly good with networking.
image

Would be super happy if you could help me to get this working. :)

Spanish traduction

Since the last update ( i had 1.2.2.2 and now 1.2.2.6) i get by default strings in FRENCH, my TV language is set to SPANISH, it should default to ENGLISH maybe?. Also i can help translating into Spanish if you are interested.

0-9 key binding, Swapped Middle and Right button

Wonderful tool! I've been looking for this since I tried a Magic Remote several years ago, and why LG won't make a USB receiver is beyond me, the accuracy of the mouse is the best I've found. And your implementation is genious, please make a Patreon so we can help fund this project.

If I can make a wish, I'd want to assign actions to all the buttons, using 0-9 to run programs for example.

I've found an error. When assigning the Middle click to a colored button, the Right click is selected and vice versa.

BindCreator.cs:

private void MouseLeft_CheckedChanged(object sender, System.EventArgs e) {
  if(((System.Windows.Forms.RadioButton)sender).Checked) {
    this.arrBind = new Bind[] { new MagicRemoteService.BindMouse(BindMouseValue.Left) }; //Left
  }
}
private void MouseMiddle_CheckedChanged(object sender, System.EventArgs e) {
  if(((System.Windows.Forms.RadioButton)sender).Checked) {
    this.arrBind = new Bind[] { new MagicRemoteService.BindMouse(BindMouseValue.Right) }; //Middle
  }
}
private void MouseRight_CheckedChanged(object sender, System.EventArgs e) {
  if(((System.Windows.Forms.RadioButton)sender).Checked) {
    this.arrBind = new Bind[] { new MagicRemoteService.BindMouse(BindMouseValue.Middle) }; //Right
  }
}

Solution for rooted (WebOSBrew Homebrew Channel) WebOS users?

Hi, your app looks amazing, but it seems to be incompatible with already rooted WebOS TVs, since it replaces the Developer Mode (TV) app with it's own port 22 SSH server and everything.

I have WebOS Dev Manager installed on a Windows PC, which could install an IPK file either via that software, or if it was added to the official WebOSBrew Homebrew Channel github, but I have been unsuccessful in trying to manually add the SSH root user and password into your MagicRemoteService app as a new device.

Think you could possibly add some way for rooted users to utilize your app as well?

Mouse cursor visual quality degradation when mouse regains control

Hi,

Here is the problem: Mouse cursor is fine, but quality becomes bad after regaining control of the cursor from the Remote to the Mouse.

Here are the repro steps:

  • Use Magic remote as cursor mouse as intended
  • Put the remote on a table for a few seconds or press a direction button on the remote. Both will result in regaining control of the cursor from the mouse.
  • Notice mouse cursor quality degradation. (attached pictures)

Note: I have set Windows Display Custom Scaling to 300% (DPI Scaling). Maybe this could be reason, but I'm sure this is a normal setting to have when using a 4K TV as monitor.

Thanks again for the software!
PXL_20240420_152827589
PXL_20240420_153057189

Error Message: "Uncaught TypeError: Cannot read property to `toString` of undefined ..." on WebOS 4.4.2

Hi,

first i wanted to thank you for your latest Release with the Overlay Function. I really do appreciate it. With the Version 1.2.4.2, i am getting the attached Error Message.

My TV:

LG 43UK6470
WebOS 4.4.2-11
Firmware: 05.50.15
Board: LM18A

The TV is rooted.

webos-dev-tmp-0ded2ec0-054d-4e4b-9432-a71ae61849fd

Thank you again...

BTW:

If you have any Ideas on how to solve this Problem, you can tell me what to do or try, too. Given that my TV is rooted, i can make changes directly in the App Files on the TV. Any Ideas or Help would be greatly appreciated.

I did not have this Problem with the last Release. I am going to try it without the "Overlay" Option to find out if the error still occurs.

IPK Verified Failed

image

Consistently getting this issue, homebrew installer has no issues installing apps/updates to the TV, have removed the working version of the app off the TV. Have tried going back in versions, reinstalling the CLI, different settings in the app to no avail.
TV Information below.

image

Feel free to contact me for more information, not sure if I covered everything correctly. Thank you.

mouse does not work and clicking inspect give error message

mouse does not work and clicking inspect give error message: ares-inspect ERR! uncaughtException Error: spawn cmd ENOENT

TV is: LG webOS TV UF770V
S/W version 04.06.25

using MagicRemoteService_1.2.2.8

TV in developer mode and install app works

Error code when installing on TV

I've reached the step of installing onto the PC, and MagicRemoteService sees the TV I added (with the name I chose so it's definitely there), but I receive this error... I've double checked the IP, Subnet mask, and MAC address on my PC and they're all correct. Any help much appreciated!

image

Selecting PC Display

Hi, I just tried installing this and it seems to work great when I set the TV to be my primary display, but when I don't it just moves the mouse on my computer screen instead of the TV. Is there some option I'm missing for that or is it something you could add support for? Either selecting which display it should be or maybe even auto detecting which of them is a TV.

Thanks for making and sharing it.

Black screen at app launch

After the app is installed on the TV, it doesn't seem to show the HDMI4 input. It's just a black screen with a small white rectangle at the top? I've tried reinstalling the app and switching inputs.

Is it possible to assgin service name?

Hi, this is a very helpful app, and the instruction is very helpful.
I am wondering if I can assgin service name instead of ""Magic Remote Service", because I might use more than one PC to connect to TV, so if I have installed two service, they both use the same name wihch make me confuse to choose, I thought it could be "Magic Remote Service HDMI1" and"Magic Remote Service HDMI2"? Thanks.

Multimedia Keys not assignable

When assigning a ney key to a button of the remote the programm does not react to "Multimedia Buttons" like the Play/Pause button. It would be nice to be able to bind these

Bind "ALT" Key (LEFT ALT) not possible.

Hi,

i have just installed your Software and i wanted to thank you. Its the first out of many "Apps" i tried that truly just works out of the Box and has some great functionality. So i would like to Donate if possible as a "Thank You". If you have a ko-fi Account please let me know.

However i have one issue with the Key-Bindings. I cannot bind the "ALT" (left ALT) Key. I am trying to bind my back Button (REMOTE) to "ALT" + "Arrow Left" i.o. to have it go to the previous Page in Chrome.

If i use the "ALT Graph" + "LEFT ARROW" Keys on my Keyboard, it does work in CHROME. But when i bind the same combo in MRS to the BACK Button it doesn't work. I don't know why the combo would work with the Keyboard but not when bound in the tool.

Would be great if there was a way to bind the "LEFT ALT" + "LEFT ARROW" Key. Or if the "ALT Gr" + "LEFT ARROW" Key would do what it "should" do?

I would really appreciate any Advice in this regard. I have no ideo if this is a WIndows issue.

Thank You again for this great priece of Software...

Support multiple screens

Hi, my PC has multiple screens (with the TV as one of them).
It would be amazing if the magic remote mouse could move between them! (currently you have to choose a specific screen for it to be on)

Can't make it work with 49UJ6307

It looks everything is OK, I didn't get any error messages during the installation, but the magic remote is not controlling my PC mouse.
they are on the same LAN.
PC OS: W10
The settings:
kép

Also I tried with the default settings, without changing anything, or with the default port what the program gives (maybe 43210?) and with the correct LAN IP. Or changing the values during "Connecting with CLI" .
But yes, they can connect (webos CLI and PC), ares-device-info --device tv2 says the right informations about the tv. So the error should be with my settings in MagicRemoteService? After I click to the Install on TV button, the TV screen is going black (with a white rectangle on the upper left corner ~it is something new app on the TV, I can choose it from the app menu, magicremoteserice, but it can't show my desktop, and also if I change back to HDMI1, it can't control the mouse), and the PC program turns inactive for a few seconds... then nothing happens, no errors.

What settings are wrong? Or is my TV too old for this program?

Thank you for the help.

Black Screen on OLED65C3PUA

Hello, I've gone through the instructions and have successfully set up both TV and PC with the service. My PC is plugged in through a Denon AVR to the TV but only a black screen shows when the TV app is active.

I can RDP into my PC I can see that the remote is registering mouse movement and button presses corresponding to the TV cursor which is visible on the TV display. For what it's worth, I do not see a small white box like other issues have mentioned.

Model: OLED65C3PUA
WebOS Version: 8.2.0-710

How to uninstall from TV

Hi! I have tried installing the app, but now I want to remove it from by TV, how can I do that?

MR23 Setting up play pause option

The magic remote doesn't come with dedicated play pause option, i want to change the long click to do the play option.
the remote screen on the app doesn't let you select play or pause or any of the media functions, (temporarily using space)

Also if possible there should be option for double click.

Wake-on-LAN not working

I have set my PC to work with Wake-on-LAN, and I have tested it with this app on my phone to make sure the settings are correct, and it works perfectly. However, MagicRemoteService's WOL function does not work for me.

Bind a key to launch a program [enhancement]

Hello,
Thank you so much for your effort. It's working really great.

I was wondering if it was possible to bind a key to launch a executable file. So far it seems I can only bind to a Key or a to Mouse action.
For instance, using programs like NirCmd will bring endless possibilities.

Thanks again!

Can't see TV

Hi Cathwyler,
This is a genius app, and thanks for putting it out there !!
I'm having a problem though. I've built it (VS2022), built and runs fine, but its not seeing my TV and I'm definitely on the same network.
Is there a way of specifying the TV IP address ?
I've got windows firewall off, so ports shouldn't be an isse.
Any help, gratefully received.
Cheers, Phil

MAP BUTTON

I WANT TO THANK YOU FOR THIS EXCELLENT TOOL.
SECONDLY CAN I MAP THE PROGRAM UP AND DOWN AND VOLUM UP AND DOWN BUTTONS.
THIRDLY YOU MENTIONS THE BUTTONS THAT ARE NOT AVAILABLE IN REMOTE EXAMPLE AVANCE RAPID AND REMBOBINE WHY?

Keyboard on screen - no input

First of all thank you for great job! Today I managed to set it on LG 43UK6470 WebOS 4.4 and Windows 11 Pro. It works! But... blue button pops-up on screen LG keyboard but I can't write/input any text. It just does not work. Red button allows me to shutdown (not sleep) my PC so I'm not able to wake up Windows but even when PC goes asleep (or I force sleep mode in power menu) I can not wake it. When I choose MagicRemoteService in TV source menu I have option to push button Start to wake up but there is message that Wake on Lan doesn't work. (I tried also red button). Wake on Lan is set up because I'm able to wake up PC via android phone or chromebook. PC MAC address is correct in MagicRemoteService app so I dont know why it doesn't work.
Thank you in advance for support regarding keyboard and wake on lan issues.

the system can not find the file

hi, every time I open the MagicRemoteService.exe I got an error that says "the system can not find the specified file" (window titled error refreshing tvs) if I try to add a new tv also gives me an error

thanks in advance

Captura de pantalla 2023-12-12 222947

Using Magic Remote microphone as text input?

I have tried starting voice input from the WebOS keyboard, however, it only sends the first letter of the recorded words to the MagicRemoteService application when MRS is trying to send the speech-to-text output to Windows.

Would it be possible for the application to receive speech-to-text input when pressing the Mic button on the remote while the MRS application is active on the LG TV, instead of it activating a "Universal Voice Search" across all WebOS applications?

Error when opening the interface (VPN problem?)

Everything works fine I think (ie the remote works as a mouse as intended and all the buttons seem to work as I configured them), except that occasionally when trying to open MagicRemoteService's settings, I get this error. I have to reboot my PC, open MagicRemoteService, then click to install it on my TV again. Occasionally I get an error again and have to repeat.

(FYI I am using a VPN, but have enabled passthrough for MagicRemoteService. Maybe I need passthrough on something else?)

image

************** Exception Text **************
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at MagicRemoteService.MacAddressBox.set_Value(PhysicalAddress value)
at MagicRemoteService.Setting.TVDataRefresh()
at MagicRemoteService.Setting..ctor(Service mrs)
at MagicRemoteService.Application.Setting(Object sender, EventArgs e)
at System.Windows.Forms.NotifyIcon.OnDoubleClick(EventArgs e)
at System.Windows.Forms.NotifyIcon.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.NotifyIcon.WndProc(Message& msg)
at System.Windows.Forms.NotifyIcon.NotifyIconNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9181.0 built by: NET481REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll

MagicRemoteService
Assembly Version: 1.2.0.0
Win32 Version: 1.2.0.0
CodeBase: file:///D:/MagicRemoteService_1.2.0.0/MagicRemoteService.exe

System
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9172.0 built by: NET481REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll

System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9181.0 built by: NET481REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9037.0 built by: NET481REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

System.ServiceProcess
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9037.0 built by: NET481REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.ServiceProcess/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.ServiceProcess.dll

System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9037.0 built by: NET481REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll

System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9181.0 built by: NET481REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll

System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9037.0 built by: NET481REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll

HGIG / Black-Level / PC mode no longer available

first of all thank you for this awesome application! Controls work super smooth on a rooted LG C9

the only thing that is not working as i would have hoped is the source/input setting.

when configuring HDMI inputs via LG's device connector you can choose "PC" and set up the connected PC accordingly.
this enables among others Chroma 4:4:4:4 and some HDR features such as HGIG mode (under dynamic tonemapping). It also let's you control / adjust black levels (in "picture settings" and "expert settings" respectively)

now, since MagicRemoteService creates a "new" HDMI input device the settings from PC mode do not carry over. Instead the HDMI input is treated like a "normal" HDMI device. This means losing HGIG, BlackLevel adjustment and probably some other features.

long story short: it would be great if MagicRemoteService could be configured to actually emulate a "PC" device HDMI input the way LG understands it :)

thanks again!

[solved] Overlay mode: no automatic start + no automatic stop of the service on TV

Hi
further tests with the overlay mode i have experienced two problems:

  1. after shutting down the PC and TV the App is not started automatically on the TV the next time it is turned on. i had to "install on TV" again from the Windows Application. It was probably still installed on the TV just didn't start when powering on

  2. what's worse is that the TV-App didn't "stop": After shutting down the PC i switched to another HDMI channel. Suddenly i got a grey message box informing me that the MagicRemoteService on PC could not be reached and asked whether i wanted to "start" the PC again. There was no other option but to press "start". When that failed i got another message box that the PC/MagicRemote service was unreachable. The problem: this message box was not dismissable. it stayed on screen... i had to turn of the TV to get rid of it.

all of this did not happen with the previous (non-overlay) version of MagicRemoteService

for testing purposes can you tell me the CLI commands to start/stop the App on TV manually?
that would be a temporary workaround because currently i cannot really use it

thanks!

Customising remote’s key actions

Hi. Thank you for your work! I wonder if it would be possible to customise some of the keys sent to PC from the Magic Remote (even if only by modifying the code before running it on the PC)?

Let me describe my use case. I would like to be able to control Plex HTPC PC application using Magic Remote. My PC is connected to the LG TV via HDMI and they are on the same network. Sadly, Plex HTPC doesn’t work well with the PC mouse, but I would like to avoid yet another remote to control the PC. One option would be something like Flirc.

Your app does the scroll, direction keys, etc. Great! But I would love to be able to have eg. Pause on some of the colour buttons. So, basically, what Windows calls Media Keys, I suppose? I’m not a developer, but maybe I could follow what you did eg. here, if I could find codes for Windows Media Keys?

Sensible/possible? Not possible/stupid?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.