google / sagetv

SageTV is a cross-platform networked DVR and media management system
http://forums.sagetv.com/
Apache License 2.0
265 stars 174 forks source link

Feature Request web based channel tuning #488

Open prnstop opened 5 months ago

prnstop commented 5 months ago

In Canada, Shaw was bought by Rogers and are now phasing out all the traditional cable boxes in favour of the Ignite tv platform using Comcast Xfinity type boxes (xione & xi6). There seems to be no IR code used by the IR Blaster that can control the xione box, leaving no way to tune a channel change, that I am aware of, through SageTv. The learning mode won't work because the XR15 remote that comes with the xione is RF based, not IR. However, Shaw has a web page that can change channels if the xr15 remote fails... So a web based option should be available. The webpage is a simple graphic with the remote buttons on it. When you press a button on the web page it is transmitted to the xione box. If a button on a webpage can change the channel, those commands should be possible on a software tuner, alternative to Hauppauge's IR Blaster. Only the buttons 0 through 9, and the enter key, would need to be used (although the other buttons could also be taken). The software tuner would be a selectable option in the tuner control box(where IRBlaster currently is), under the video source setup menu. This would enable a lot of users to continue using SageTv when the traditional cable boxes are phased out.

jwittkoski commented 5 months ago

You can do this with the gentuner plugin. I believe it is still included in the docker images that are available if you are using a docker install, so you might already have it.

After installing it you just need to write a simple shell script to send the commands to your STB. The details will be specific to your STB and might require a little testing/experimentation. See the "Configuration" section (under "Test your version of gentuner with your setup directly from the command line to make sure it's tuning the devices as expected before trying it with Sage.") of the gentuner README for some suggestions testing examples.

An example script that uses wget to send a channel number to a web based STB is gentuner.IPSTB. The gentuner.HR44 script is a more complicated example that uses curl to simulate individual keypresses.

If you do get a script working and are willing to share it, I would appreciate it if you would open a Pull Request in the gentuner project and I can add it to the other examples that users have provided.

prnstop commented 5 months ago

Thanks for the reply. I don't know if I have a "docker" install.  I originally purchased the Sagetv v6 program (years ago), and just kept upgrading from there. I am now on the latest 9.2.6.976 (64 bit) version. Is the gentuner plugin available from the Sage "get plugins" menu option? It's been more than a few years since I've been there. As for the script, what language is it? My programming skills started with Fortran and ended with Turbo Pascal, both needed compilers. Do I need for this script? I will need to learn about this wget command...If you can direct me to a website where I can learn about this scripting language, and how to use it, I would be very grateful. Thanks

On Sat, 13 Jan 2024 12:13:05 -0800, John Wittkoski @.***> wrote:    

You can do this with the gentuner plugin. I believe it is still included in the docker images that are available if you are using a docker install, so you might already have it.

After installing it you just need to write a simple shell script to send the commands to your STB. The details will be specific to your STB and might require a little testing/experimentation.

An example script that uses wget to send channel digits to a web based STB is gentuner.IPSTB

If you do get a script working and are willing to share it, I would appreciate it if you would open a Pull Request in the gentuner project and I can add it to the other examples that users have provided.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

jwittkoski commented 5 months ago

If you've been upgrading since v6 then you likely aren't using docker. Most people use docker with a NAS like Synology or Unraid.

Unfortunately gentuner isn't available as Sage Plugin, you have to compile it yourself. It sounds like you may be running on Windows. gentuner should compile on Windows but I'm not familiar with the best way to do that and don't have a way to build or test it on Windows.

The script that gentuner calls to do the actual "tuning" can be written in whatever language you want, using whatever programs are available (wget and curl that I mentioned above are just programs that download web pages), it just needs to be executable. The examples are linked to in my earlier comment are Bash shell scripts intended to be run on Linux.

JustFred51 commented 5 months ago

If Sage is running on Windows, you can use EXEMultiTuner, which is already built into Sage. In short, Sage uses EXEMultiTuner to talk to a batch file that you'll need to create, which talks to the STB. Try to find a topic in the old Sage forums titled "Need EXEMultiTuner install help". I haven't been able to find any of the old posts. Others here may have figured out how.

Your batch file (using wget) is the glue between EXEMultiTuner and the STB's web page. That's the only programming needed.

You'll also need to create a Windows registry entry that tells Sage to send channel-change info to your batch file. Name the file whatever you'd like, and place it in whatever folder you prefer.

If running the 32-bit version of Sage, the registry entry should be placed in Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Frey Technologies\Common Else, if running the 64-bit version of Sage, the registry entry should be placed in Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Frey Technologies\Common

Correct registry entry (note location of double-quotes): Registry entry - right

Incorrect registry entry (don't double-quote anything but the batch-file path & name): Registry entry - wrong

prnstop commented 5 months ago

checked to make sure EXEMuliTurner was in the SageTVx64\common folder Added the 64 bit key- Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Frey Technologies\Common\EXEMultiTunerPlugin Added the string command- cmd.exe /c "notepad.exe" %channel% Basically followed the forum post:

 https://forums.sagetv.com/forums/showthread_t_43947.html?t=43947

Removed, and added, the hauppauge video source with the EXEMultiTuner tuner control. All good there. Verified sagetvx64 service allowed to interact with the desktop.   If I paste the string command onto the command line notepad starts fine, but for some reason it won't start from sagetv when I change the channel Not sure where I went wrong, but out of time for now, will try more in next few days.

On Mon, 15 Jan 2024 15:23:37 -0800, Keith Fischer @.***> wrote:    

If Sage is running on Windows, you can use EXEMultiTuner, which is already built into Sage. In short, Sage uses EXEMultiTuner to talk to a batch file that you'll need to create, which talks to the STB. Try to find a topic in the old Sage forums titled "Need EXEMultiTuner install help". I haven't been able to find any of the old posts. Others here may have figured out how.

Your batch file (using wget) is the glue between EXEMultiTuner and the STB's web page. That's the only programming needed.

You'll also need to create a Windows registry entry that tells Sage to send channel-change info to your batch file. Name the file whatever you'd like, and place it in whatever folder you prefer.

If running the 32-bit version of Sage, the registry entry should be placed in Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Frey Technologies\Common Else, if running the 64-bit version of Sage, the registry entry should be placed in Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Frey Technologies\Common

Correct registry entry (note location of double-quotes): Registry.entry.-.right.jpg (view on web)

Incorrect registry entry (don't double-quote anything but the batch-file path & name): Registry.entry.-.wrong.jpg (view on web)

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

prnstop commented 5 months ago

I now have EXEMultiTuner passing on %DEVICE% and %CHANNEL% to my batch file, and logging results to another text file, so that part is working. Now I need to learn how to change the channel on the Xfinity set top box.  When I open the webremote webpage in a browser, inspect, then go to the console, I can use a defined function called submitTextCommand to change the channel.  But i'm afraid tracing where this command comes from to see what parameters I need to use this from my SageTv batch file, is overwhelming me. Using VsCode I downloaded the resources from the website as a zip file.  Can anyone help me go through the code and tell me what I need to do?  

On Mon, 15 Jan 2024 15:23:37 -0800, Keith Fischer @.***> wrote:    

If Sage is running on Windows, you can use EXEMultiTuner, which is already built into Sage. In short, Sage uses EXEMultiTuner to talk to a batch file that you'll need to create, which talks to the STB. Try to find a topic in the old Sage forums titled "Need EXEMultiTuner install help". I haven't been able to find any of the old posts. Others here may have figured out how.

Your batch file (using wget) is the glue between EXEMultiTuner and the STB's web page. That's the only programming needed.

You'll also need to create a Windows registry entry that tells Sage to send channel-change info to your batch file. Name the file whatever you'd like, and place it in whatever folder you prefer.

If running the 32-bit version of Sage, the registry entry should be placed in Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Frey Technologies\Common Else, if running the 64-bit version of Sage, the registry entry should be placed in Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Frey Technologies\Common

Correct registry entry (note location of double-quotes): Registry.entry.-.right.jpg (view on web)

Incorrect registry entry (don't double-quote anything but the batch-file path & name): Registry.entry.-.wrong.jpg (view on web)

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

JustFred51 commented 5 months ago

Please post the zip file of the webpage so we can have a look.

prnstop commented 5 months ago

Sure. Guess it didn't work as an email attachement. webremote.shaw.ca.zip

JustFred51 commented 5 months ago

It looks like web control of that STB via IP is anything but simple. Commands from their web interface go out to Comcast/Rogers servers and then back to the STB, with alot of messy authentication. There appears no straightforward (and reliable) way for direct IP control. Web searches found attempts by others to implement this, but without success. On the other hand, IR control is possible. https://communityforums.rogers.com/t5/Ignite-TV/Solved-Controlling-Rogers-Ignite-guide-with-Samsung-One-Remote/td-p/518268

prnstop commented 5 months ago

Thank you for looking at this JustFred51. Yes, I also saw in the Shaw support forum where people had success using the Harmony universal remote on the Xione. So, I went and bought an inexpensive universal remote (IR) and also had success using it on the Xione. Then used the universal remote to learn the new ir codes for the ir blaster. Tried it more than a dozen times, successfully learned the code, but it won't work on the xione. When I look in the HCWBlast.ini file, the code changes everytime I successfully learn the code, but the code does nothing for the xione. Guessing it is something to do with the "learning process"? My next step is to buy an external ir blaster and try it again.... is usb-uirt still the way to go?

JustFred51 commented 5 months ago

The fact that the codestream (in HCWBlast.ini) changes with each 'learn' cycle indicates it's not faithfully learning the IR stream. I never had a lot of success with the Hauppage blaster, but have been using usb-uirt with a pair of STBs for over 5 years; great product. Sage does a good job of learning IR codes for it. In general, it's preferable to learn from the STB manufacturer's remote, rather than learning from a remote that had learned from the mfgr's. For various reasons, learning from subsequent copies isn't always reliable. If you decide to install usb-uirt, it needs a driver that links it to Sage. Be aware that there was a minor issue when installing on Win-x64, sometimes incorrectly installing the x86 driver on an x64 OS. I can't recall which installer had the issue: Was it the one packaged with SageTv-x64, or was it the one from the usb-uirt website?