IceTV Forum

IceTV IceBox => General => Topic started by: TimC on July 12, 2023, 11:41:04 PM

Title: How does the Remote Control work?
Post by: TimC on July 12, 2023, 11:41:04 PM
It sounds like a silly question, but there is a good reason for asking.

In my setup I use a HDMI Matrix switch, a HDMI extender and an IR extender to extend the outputs of the various devices I have to the Main bedroom at the other end of the house.

This allows my wife to watch programs she has recorded while she does Heamodialysis in her bedroom.

so far I having difficulty achieving this. So far the signal doesn't quite make it (likely a configuration issue). As a result, I can't really tell if the remote will work or not once I get the configuration issue sorted (Another thread).

The remote control is another issue. I have the impression that the remote uses RF rather than Infrared hence the little dongle supplied.
However, I notice that the IR extender I use lights up, when I use the Icebox remote in the bedroom, as if it has detected an Infrared signal, so perhaps it also uses Infrared after all.
I also note that the Remote shows a led indication when a button is pressed when it is a long way from the Icebox. I'm not sure what the LED is supposed to show. It doesn't seem to be described anywhere.

I'm not sure what this all means, but I need to find out how to extend to remote signal to allow it to work from the bedroom, otherwise the Icebox will not serve our needs. I will have to bin the Icebox and find an alternative PVR.

Any ideas?
Title: Re: How does the Remote Control work?
Post by: DeltaMikeCharlie on July 13, 2023, 09:03:18 AM
The IceTV remote that I have is RF-based.  It has a LED indicator light, but when I point it at my IR receiver, I see no activity.  You can also test it with a digital camera.  With a normal IR RCU, you will see flashing lights when you point the RCU at the camera lens and press a button.  I also tried this with my ICE RCU and saw nothing.

The IceBox will work with an after-market remote control unit.  Which is exactly what I do.

The IceBox is simply expects input from a USB HID (Human Interface Device) such as a USB keyboard, USB mouse or other device that uses the HID protocol.

If you already have an IR extender, then you could purchase an IR receiver for the IceBox and pick the RCU of your choice.  The IceBox will also understand way more buttons than the handful that the native ICE remote provides.

Have a look at a 'Flirc USB': https://flirc.tv/products/flirc-usb-receiver?variant=43513067569384

You can train/configure it to work with a wide range of IR RCUs.  The Flirc receives the IR code from the RCU and then produces a HID output that the IceBox can understand.  I think that you need a Windows PC to run the configuration software.

I personally use an old RCU/receiver that came with a Windows Vista laptop many, many years ago and it worked fine out of the box with no configuration required at all.

RC6.jpgIR RX.jpeg

EDIT/NOTE: The IR receiver that I use does not generate HID output.  However, there are tools that allow the Linux kernel to interpret the IR codes.

The following post specifically addressed Topfield remote controls, but the principle would be the same for any IR RCU.  Learn the IR codes, put them in a configuration file and map those codes to Kodi functionality.

https://oztoppy.forumchitchat.com/post/remote-control-testing-12529503

You may need some Linux command-line skills to accomplish this.

EDIT/NOTE 2: Perhaps the IceBox supports HDMI-CEC.

If your TV and the IceBox support HDMI-CEC, and you can already control your TV via IR extender, perhaps enabling CEC will allow you to control your IceBox.
Title: Re: How does the Remote Control work?
Post by: DeltaMikeCharlie on July 13, 2023, 01:40:46 PM
Quote from: DeltaMikeCharlie on July 13, 2023, 09:03:18 AMIf your TV and the IceBox support HDMI-CEC, and you can already control your TV via IR extender, perhaps enabling CEC will allow you to control your IceBox.
I tried CIC with my IceBox and it did not work for me.
I also found that there is a device that will intercept HDMI-CIC commands and send them via USB.
https://www.pulse-eight.com/p/104/usb-hdmi-cec-adapter (https://www.pulse-eight.com/p/104/usb-hdmi-cec-adapter)
Title: Re: How does the Remote Control work?
Post by: IanL-S on July 14, 2023, 01:06:38 PM
I found this discussion very interesting. Many thanks for you input Delta Mike Charlie.
Title: Re: How does the Remote Control work?
Post by: TimC on July 16, 2023, 01:19:23 PM
Thanks DMC,

I'll try the Flirc and see what happens.



Title: Re: How does the Remote Control work?
Post by: TimC on July 19, 2023, 12:31:18 AM
OK, I received m new Flirc IR Receiver.

Interesting. Basically the receiver comes in a little box. Thats it! No Instructions.

I knew enough to know that I needed to plug it into a PC to go further and yes, when I plugged it in to my PC and access to the internet was available, the unit took me to a website.
Again, not much in the way of instructions, but I went to the download section and selected the unit I purchased and downloaded the Windows version of the Software, which runs on my PC.
I opened the exe file, after a bit of a battle with my firewall, and the software opened.

From there it was fairly straight forward.

I chose the KODI remote from the list of controllers and configured the buttons shown with my old Skippa remote.
Select a button on the screen and press the equivalent button on the remote. I added the number buttons in the hope that I would be able to use them to switch channels.

I saved the configuration and removed the receiver and plugged it into one of the side USB ports of the icebox, and the remote immediately started working, mostly.

There are still a few issues to work through though.
I will need guidance on how to get the Home and IceTV buttons working.
I can get by, but it would be better if I can get something up and running.

The number buttons worked as well, but there are some issues with how the numbers worked.

Initially pressing "1" gave me Channel 10, "2" Channel 2, "90" Channel 90, etc, except "7" and "9" didn't work.
Note: I had set the "Use channel numbers from back end", but when I logged into IceTV on my PC, looked at my IceTV Channel settings, I found that I had 9 and 7 disabled.
However enabling and saving the changes didn't work.

I then tried a soft reset and rescan, but that didn't work either as the rescan assigned 5 digit numbers to all channels except for the 7 group.  7 works though.

The 5 digit numbers seem to come from the Backend, whatever that is.
If I disable the "Use channel numbers from back end" option the 5 digit numbers change to the mor normal 1/2 digit numbers, but they no longer line up with the correct channel numbering.

I have tried several scans and the insanity, i.e. doing the same thing and expecting a different result, prevailed.

Is there a way to do something in the "backend" that will stick?
Title: Re: How does the Remote Control work?
Post by: DeltaMikeCharlie on July 19, 2023, 08:45:49 AM
Quote from: TimC on July 19, 2023, 12:31:18 AMThere are still a few issues to work through though.
I will need guidance on how to get the Home and IceTV buttons working.
I can get by, but it would be better if I can get something up and running.

With 'Home' and 'IceTV. buttons on the Skippa remote, what functions did you want them to perform in Kodi?  Once you know that, you can find the keystroke that Kodi uses and then map those keystrokes to those RCU keys.

As far as I know, the Flirc emulates a USB keyboard and translates the IR codes into USB keystrokes.  The Kodi template that Flirc used probably just had the ability to map the most popular functions for Kodi.

If the Kodi functions that you wish to perform are already configured within Kodi to have Keyboard shortcuts, then you just need to manually configure your Flirc to generate those codes.

If the Kodi functions do not already have a keystroke, then you will have to find a keystroke that Kodi dopes not use and then build a custom keymap to invoke that function from that keystroke.  You will then need to configure Flirc to send the keystroke that you used.

I think that you can save the Flirc config file.  If you are willing, perhaps you could share that config file on the forum so that other people could use it too.

Quote from: TimC on July 19, 2023, 12:31:18 AMIs there a way to do something in the "backend" that will stick?
The frontend is Kodi and the backend is 'tvheadend' (TVH).

You can get to the TVH configuration screen using a web browser, go to:
http://{IceBox IP Address}:9981

Within TVH, when you tune, you tune to a 'Service', not a 'Channel'.  If you go into 'DVB Inputs | Services', you should see two services called 'Channel 9 Sydney' (for example).

If you look to the right on the list, you can see the 'Service ID' and the 'Local channel number'.  One of the services should have LCN 9 and the other LCN 91, at least in Sydney.  The service IDs should be identical.

If you click in the little 'info' button on the services list, you will see that they use all of the same PIDs.  These 2 services are simply aliases for the same content this is so that 'Channel 9' can still be found on channel 9.  As far as I can tell, the IceTV setup only creates a 'channel' for 91, not 9.

Now, if you go into 'Channel / EPG | Channels', you will see the list of channels that you get in Kodi and this is where the 'backend numbers' come from.  You should find that there is no channel with the number 9.  However, considering your success with 91, you should be able to find that.

At this stage you can do 1 of 2 things.  Create a new 'channel' for LCN 9, or simply renumber 91 to 9.

If you want to create a new channel 9, just copy the settings for 91 calling it '9 New' temporarily.  Do not set a channel number or select a service.  This is because from this screen, if you select a service, you can't tell the difference between 9 and 91.

Go back into 'services' and find the one with LCN 9.  Edit it and then select '9 New' from the dropdown channel list.  Go back to 'channels' and rename your new channel to what it should be.  The number should be 9.  Make sure that it is enabled.

In Kodi, make sure that you enable using the front end numbers.  The new channel should turn up in Kodi immediately, however, the EPG data may take some time to come through.
Title: Re: How does the Remote Control work?
Post by: TimC on July 19, 2023, 11:30:28 AM
DMC,

Slight Misunderstanding here.
Quote from: DeltaMikeCharlie on July 19, 2023, 08:45:49 AMWith 'Home' and 'IceTV. buttons on the Skippa remote, what functions did you want them to perform in Kodi?  Once you know that, you can find the keystroke that Kodi uses and then map those keystrokes to those RCU keys.

These are keys on the Icebox Remote that don't have equivalents on the Skippa remote. Not the other way around.

As for the Channel number mappings. I found that all the channels that have 5 digit numbers have a Local Channel Number of 0.
I assume something in the setup sees the 0 and automatically assigns the 5 digit numbers.

OK I have a fix.

Next question is why isn't the back end picking up the local numbers correctly?

Also, If I go through the process fixing this up manually, will the settings hold through a soft reset?

My guess is no. I imagine every time there is a rescan all these settings go away.

I really don't want to be assigning 40 odd channel numbers every time a soft reset is required.
Title: Re: How does the Remote Control work?
Post by: raymondjpg on July 19, 2023, 11:31:41 AM
Quote from: DeltaMikeCharlie on July 19, 2023, 08:45:49 AMWith 'Home' and 'IceTV. buttons on the Skippa remote, what functions did you want them to perform in Kodi?  Once you know that, you can find the keystroke that Kodi uses and then map those keystrokes to those RCU keys.
I think the question (probably implied) is what did those buttons do on the Skippa? I suspect something that cannot be done in IceBox. Navigation around Kodi is pretty straightforward using arrow keys and enter, also backspace and escape keys to go back in menus. However the behaviour (resulting actions) of the backspace and escape keys are slightly different in IceBox from a Windows Kodi implementation. This difference cannot be changed by remapping Flirc keys. There may also be some functions in media playback such as volume control and subtitle toggle that are controllable by remappimg remote buttons using the inbuilt Kodi template in Flirc but I haven't tried that myself.

Quote from: DeltaMikeCharlie on July 19, 2023, 08:45:49 AMAs far as I know, the Flirc emulates a USB keyboard and translates the IR codes into USB keystrokes.  The Kodi template that Flirc used probably just had the ability to map the most popular functions for Kodi.
Yes, it shows up in Windows as a HID keyboard device.


Quote from: DeltaMikeCharlie on July 19, 2023, 08:45:49 AMNow, if you go into 'Channel / EPG | Channels', you will see the list of channels that you get in Kodi and this is where the 'backend numbers' come from.  You should find that there is no channel with the number 9.  However, considering your success with 91, you should be able to find that.
I may be wrong but the only way I could get channel order right was to manually renumber them in the Number column. So I have numbered 1-25 the channels I want to see, with the Enable column checkbox enabled. Then clicking the Number column head to line them up to check all is correct. Then on Kodi enabling the first three options under PVR & Live TV|Channels settings.
Title: Re: How does the Remote Control work?
Post by: DeltaMikeCharlie on July 19, 2023, 11:50:51 AM
Quote from: TimC on July 19, 2023, 11:30:28 AMThese are keys on the Icebox Remote that don't have equivalents on the Skippa remote. Not the other way around.

My apologies.  Here is a map of that key codes the ICE RCU create.

https://forum.icetv.com.au/index.php?topic=7571.msg39109#msg39109 (https://forum.icetv.com.au/index.php?topic=7571.msg39109#msg39109)

'Home' produces a 'home' keyboard keystroke and 'Ice' produces a 'back space'.

Quote from: TimC on July 19, 2023, 11:30:28 AMNext question is why isn't the back end picking up the local numbers correctly?

I don't know.

Quote from: TimC on July 19, 2023, 11:30:28 AMAlso, If I go through the process fixing this up manually, will the settings hold through a soft reset?

I agree, these changes would probably be lost after a soft reset.
Title: Re: How does the Remote Control work?
Post by: DeltaMikeCharlie on July 19, 2023, 11:58:51 AM
Quote from: raymondjpg on July 19, 2023, 11:31:41 AMI may be wrong but the only way I could get channel order right was to manually renumber them in the Number column. So I have numbered 1-25 the channels I want to see, with the Enable column checkbox enabled. Then clicking the Number column head to line them up to check all is correct. Then on Kodi enabling the first three options under PVR & Live TV|Channels settings.
This sounds like what I do.  In TVH, the channel numbers need to be set to the desired LCN.  In Kodi, backend ordering/numbering needs to be enabled.
Title: Re: How does the Remote Control work?
Post by: raymondjpg on July 19, 2023, 01:59:40 PM
Quote from: TimC on July 19, 2023, 11:30:28 AMThese are keys on the Icebox Remote that don't have equivalents on the Skippa remote. Not the other way around.
There is a home button on the Flirc Kodi template that any Skippa key could be mapped to. Just remember that Skippa keys can only be mapped to one function, not multiple functions, in Flirc, so choose a "free" key. The home key just jumps back to the first Kodi setup screen you see on bootup.

What exactly the IceTV key achieves with the IceBox RCU I do not know.

Quote from: TimC on July 19, 2023, 11:30:28 AMAlso, If I go through the process fixing this up manually, will the settings hold through a soft reset?

My guess is no. I imagine every time there is a rescan all these settings go away.

I really don't want to be assigning 40 odd channel numbers every time a soft reset is required.
I don't know because I do not have an IceBox, but any reset that just involves an IceBox reboot will not affect channel numbering, whereas I'd say that any reset that involves a channel scan or rescan probably will.

Edit: I just checked the IceBox RCU on a Virtualbox installation of IceBox BYO and if by IceTV key you mean the blue star key then that takes IceBox direct to TV Recordings. There is no equivalent key in the Flirc Kodi template, but as DMC pointed out it is just a backspace that can be mapped to a Skippa key. No matter where in the IceBox Kodi setup you are that key will always take you to TV Recordings. The same behaviour is not seen in vanilla installations of LibreELEC so it looks like a custom mapping in IceBox. Quite how that is achieved, I haven't looked into, but it would explain the difference in behaviour of the backspace key between IceBox and Windows installations of Kodi.
Title: Re: How does the Remote Control work?
Post by: TimC on July 20, 2023, 12:59:15 AM
Finally I managed a decent scan that only left the Channel 10 services without the correct numbers, which I could correct fairly easily. I am a bit concerned about doing the same thing and getting different results, but hopefully I won't need to do a soft reset again. I think there's an emoji for that.  A really nervous looking one.

Quote from: DeltaMikeCharlie on July 19, 2023, 11:50:51 AMHere is a map of that key codes the ICE RCU create.

Unfortunately the key codes don't help as the Flirc doesn't provide any info about what codes it is using where.

I eventually ended up with a mapping of the Skippa remote that sort of works.

You can change channels using the number buttons and a press of the menu button once or twice brings up a list of recordings.

Sort of workable but not all that intuitive.  The record button doesn't work and I had some difficulty getting a recording to play.

I suspect the Flirc's Kodi keyboard doesn't line up with The Icebox one.

Quote from: DeltaMikeCharlie on July 19, 2023, 08:45:49 AMI think that you can save the Flirc config file.  If you are willing, perhaps you could share that config file on the forum so that other people could use it too.

Yes I can save the config to a file, but it would only be of use to someone with a Skipp Remote.

How do you add a file to this forum?  I can see how to add a picture, a link, an email, even a Youtube video, but not a file.

Finally some thoughts on the Flirc.

While the concept is great, it has limitations.
While you can program a configuration easily enough, there is no was to check what you have set up.
It would be good if you could press a button on your remote and see which button the Flirc recognises it as.
The Config file is not human readable so you cant tell what the Flirc is doing.
Support is not all that good as the designer is the only person providing support. He relies on Forums for most of the  support and given how little data is accessible, no one else knows much either. The forums are prety broad brush.

The list of remotes it emulates is pretty limited. Most are really gaming or streaming remotes, i.e. not really set up for things like a PVR.

I'm not sure where to go from here.
Title: Re: How does the Remote Control work?
Post by: DeltaMikeCharlie on July 20, 2023, 06:30:14 AM
Quote from: TimC on July 20, 2023, 12:59:15 AMUnfortunately the key codes don't help as the Flirc doesn't provide any info about what codes it is using where.

I eventually ended up with a mapping of the Skippa remote that sort of works.

...

I'm not sure where to go from here.
You could consider a completely manual mapping process.  After all, the Flirc is just pretending to be a USB keyboard.

Here are some pages describing Kodi keyboard shortcuts:

https://kodi.wiki/view/Keyboard_controls (https://kodi.wiki/view/Keyboard_controls)
https://www.maketecheasier.com/cheatsheet/kodi-keyboard-shortcuts-cheatsheet/ (https://www.maketecheasier.com/cheatsheet/kodi-keyboard-shortcuts-cheatsheet/)
https://beebom.com/kodi-keyboard-shortcuts/ (https://beebom.com/kodi-keyboard-shortcuts/)
https://github.com/xbmc/xbmc/blob/master/system/keymaps/keyboard.xml (https://github.com/xbmc/xbmc/blob/master/system/keymaps/keyboard.xml)

(I'm sure that your search engine of choice can find more.)

Where there is an obviously equivalent function, match that key ('stop' = 'x').  Where there is no obvious equivalent, like the Skippa AutoSkip/Unskip, perhaps map them to something that you do all the time.
Title: Re: How does the Remote Control work?
Post by: raymondjpg on July 20, 2023, 10:55:46 AM
Quote from: TimC on July 20, 2023, 12:59:15 AMUnfortunately the key codes don't help as the Flirc doesn't provide any info about what codes it is using where.
It looks to me like the IceBox custom keyboard mapping is a bit difficult to interpret, so better not to try. Just focus on what the Skippa remapping with the Flirc is capable of doing.

Quote from: TimC on July 20, 2023, 12:59:15 AM...a press of the menu button once or twice brings up a list of recordings.
We've already covered this. A Skippa key remapped to backspace will always bring up a list of recordings.

Quote from: TimC on July 20, 2023, 12:59:15 AMSort of workable but not all that intuitive.
This is a misundertanding of what the Flirc is capable of. It is just a keyboard device, and you can map any Skippa key to any keyboard function. Which key it's mapped to is immaterial, and the remapped function of that key may bear no relationship to how that key is labeled. I don't consult the face of my remotes to work out which key does what, I do it by feel, and if you are going to use a remote like a Skippa then be prepared for functionality that is completely alien to what the remote used to do on the Skippa

Quote from: TimC on July 20, 2023, 12:59:15 AMThe record button doesn't work and I had some difficulty getting a recording to play.
I found that the record button of the IceBox RC on its own doesn't do anything, but a joint press of the record and enter keys seems to do something.I have no idea what keystrokes are sent as "previoussong".

This is one of the occasions where, at least for the time being, it is probably easier to use the context menu. Map a Skippa remote key to "c" and use the arrow keys to move up and down the menu then enter.

Quote from: TimC on July 20, 2023, 12:59:15 AMI suspect the Flirc's Kodi keyboard doesn't line up with The Icebox one.
I think we've already established that the IceBox has some custom keyboard mapping.

You are not limited to the Flirc Kodi template, use the full qwerty keyboard template as well. You can mix and match.

Quote from: TimC on July 20, 2023, 12:59:15 AMWhile the concept is great, it has limitations.
As a programmable keyboard emulator I doubt you'll find an equivalent, let alone anything better.

Quote from: TimC on July 20, 2023, 12:59:15 AMWhile you can program a configuration easily enough, there is no was to check what you have set up.
The best check is the proof that the keypress does what you intended with the remapping!

Quote from: TimC on July 20, 2023, 12:59:15 AMIt would be good if you could press a button on your remote and see which button the Flirc recognises it as.
If you have a Windows PC then install Flirc, open up Notepad, and press keys on the remote.

Quote from: TimC on July 20, 2023, 12:59:15 AMThe list of remotes it emulates is pretty limited. Most are really gaming or streaming remotes, i.e. not really set up for things like a PVR.
It will work with any IR remote that issues keyboard commands. Use the qwerty template.

Quote from: TimC on July 20, 2023, 12:59:15 AMI'm not sure where to go from here.
Persist.
Title: Re: How does the Remote Control work?
Post by: TimC on July 20, 2023, 10:40:19 PM
OK I think I am there. Basically I had to use trial and error across multiple Controllers in Flirc to find equivalent commands.

The key for others to set up, is to know which Flirc controllers and buttons to align with their equivalent on the IceBox remote. 

Which keys are used on your remote is up to you, but I will explain what I did for my remote at the end.
I did the set up in a Windows OS, but there are Mac and Linux versions of the software available.
I am assuming you know how to download and install the Flirc software.

With the Flirc Software running and the Flirc USB receiver plugged into a UBB port on your computer, the process is to:
1. On the Flirc window select "Controllers menu > Kodi" - This presents a standard? Kodi keyboard on the window
2. On the Kodi Keyboard:
  a. select the "1" button and press the 1 key on IR Remote of your choice
  b. Repeat for all the number keys, 2, 3, 4, 5, 6, 7, 8 ,9 and 0.
  c. Repeat for the navigation keys, Enter, Up, Down, Left and Right.
  d. Repeat for the Sound Control keys, Mute, Volume_Down and Volume_Up.
  e. Repeat for the playback control keys, Rewind and Fast Forward - the other playback control keys need to come from another controller.
  f. Repeat for the data display keys, Info and EPG.
3. On the Flirc window select "Controllers menu > Full Keyboard" - This presents a US style keyboard on the window
4. On the Full Keyboard:
  a. select the "Home" button and press your choice for an equivalent Home key on IR Remote (I chose the Menu key on my Skippa remote)

5. On the Flirc window select "Controllers menu > Microsoft WMC" - This presents a Microsoft WMC keyboard on the window
6. On the Microsoft WMC Keyboard:
  a. select the "Record" button and press the Record key on your IR Remote
7. On the Flirc window select "Controllers menu > Media Keys" - This presents a Media Keys keyboard on the window
8. On the Media Keys Keyboard:
  a. select the "Next" button and press the Stop key on your IR Remote
9. On the Flirc window select "Controllers menu > Fire TV" - This presents a Fire TV keyboard on the window
10. On the Fire TV Keyboard:
  a. select the "Menu" button and press your choice for an equivalent Menu key on IR Remote (I chose the Blue key on my Skippa remote)
  b. select the "Back" button and press the Back key on your IR Remote
  c. select the "Play/Pause" button and press the Play key on your IR Remote
  d. select the "Home" button and press your choice for an equivalent Home key on IR Remote (I chose the Menu key on my Skippa remote)

That gives you a Remote with more capabilities than the IceBox remote.
You can:
* choose your channels using the number keys
* Fast Forward and Rewind your recordings
* Open the EPG directly from the remote

For those who want to see what other keys can be included, the approach I used was to plug both the RF and Flirc USB units into my PC and using the Keyboard Tester (https://www.passmark.com/products/keytest/) software.

Once you have installed the Keyboard Test software and have both USB units plugged into your PC, simply pressing the RF Remote key gives a code for the RF Remote key you need to look for.
From here it is messy as I was unable to find any info about what codes the Flirc is generating.
Its a matter of trial and error of selecting a Keyboard and Button in the Flirc software and programing a spare button on you IR Remote, and then looking at what code is displayed in the Keyboard Test software when you press the newly programmed button on your IR Remote.

Tedious but doable.

Postscript: The Flirc can be susceptible to Infrared generated by TV LED Backlighting causing spurious key code generations.  A scan through the Flirc Forums suggests two things.
1. Shield the Flirc from direct exposure to Infrared from the TV Screen.
2. When programming the keys, hold the Remote Control button down for 3 seconds. As soon as the Flirc detects the IR from pressing the button the app responds with the Recorded Successfully message, but sometimes fails to get a good enough recording. The result being that the Flirc can misinterpret the TV Backlight Infrared.
I redid mine and put the Flirc directly in the screen (I have the Flirc on a USB lead) and connected it to a laptop running an online Keyboard tester (How I discovered the initial issue) and left it running for a while and there were no longer any spurious key codes generated.

Postscript:  I have noted an error in the procedure (step 4). The procedure has been corrected with the addition of Step 10. d.
Title: Re: How does the Remote Control work?
Post by: IanL-S on July 21, 2023, 08:18:31 AM
Thanks for posting the detailed process that you used. I am sure that many of us will find it very useful.
Title: Re: How does the Remote Control work?
Post by: raymondjpg on July 21, 2023, 08:56:10 AM
Quote from: TimC on July 20, 2023, 10:40:19 PMThe key for others to set up, is to know which Flirc controllers and buttons to align with their equivalent on the IceBox remote.
If you have a networked PC in the bedroom area then a better solution would be to install Kodi on that with the TVHeadend PVR addon using IceBox as the back end. That would give you live TV, and the option either to play back recordings from the TV or Video menus.

One significant advantage of this setup would be that it would enable Flirc configuration for Kodi without the complication of the IceBox custom key mapping. Also playback of recordings using an external player if you are so inclined.
Title: Re: How does the Remote Control work?
Post by: TimC on July 21, 2023, 12:10:32 PM
Quote from: raymondjpg on July 21, 2023, 08:56:10 AMIf you have a networked PC in the bedroom area then a better solution would be to install Kodi on that with the TVHeadend PVR addon using IceBox as the back end. That would give you live TV, and the option either to play back recordings from the TV or Video menus.

While a simple enough for getting the Icebox running on its own, my case is more about integration with other technology.
My entertainment setup involves several bits of technology.

A Fetch TV box
An Apple TV box
A Toppy (as Backup)
Two Skippas (Now dying and to be replaced by the IceBox)
A BlueRay DVD Player
An AV amplifier (in the lounge room)

All these feed through a 2 x 6 way HDMI Matrix Switch to the main TV in the Lounge Room and to a HDMI Extender/Receiver linked by ethernet cable to the Main Bedroom at the other end of the house. An RF HDMI extender doesn't quite make it. About 20 Meters and 3 walls is a little bit beyond the range of the RF.
I use a separate Infrared extender to improve reliability.

This allows My wife access to entertainment from all our devices while she is in the bedroom doing dialysis. which involves 4 to 6 hrs attached to a dialysis machine every second day. Entertainment becomes essential. It is also simple enough for my wife to operate.

In addition, I make use of RCA AV Video outputs from the devices via an AV switch and an RF AV Video extender to other TVs in the Family Room and second bedroom. The one thing that ties all this together is Infrared.
 
This setup allows all our entertainment technology to be used from anywhere in the house.

Unfortunately the RF Remote just didn't fit in with this arrangement, hence all my efforts to implement an InfraRed remote.

Title: Re: How does the Remote Control work?
Post by: TimC on July 21, 2023, 02:39:31 PM
By the way I found that the pic following appears to show incorrect code numbers.
RCU Scancodes.jpg

The following images shows the code numbers my Key Test program shows.

 RCU Scancodes-Corrected.jpg

Note: I couldn't find what the power key code was, as every time I tested it, my PC turned off.

Postscript:  I have noted an error in the second picture The Key code for KEY_VOLUMEDOWN is actually 174 (not 74).
Postscript: An omission noted in the second picture. The Key code for the KEY_PLAY_PAUSE button is 179.
Title: Re: How does the Remote Control work?
Post by: raymondjpg on July 21, 2023, 06:55:11 PM
Some useful information about Flircs and keycodes at https://forum.flirc.tv/index.php?/topic/2706-flirc-harmony-keyboard-how/:

Controllers are interchangeable. They only group different keys together, but Flirc doesn't store information about selected controller. So you can record some keys from one controller and some keys from another. Most controllers (like Kodi for example) are just a collection of pre-configured, ready to use keyboard shortcuts and you can actually achieve the same functionality using full keyboard controller if you know those shortcuts.

Flirc doesn't deal with key codes. It works on a lower level and maps your IR signals to USB HID codes. It's up to your OS to interpret them and emit key codes to applications (which is done by the keyboard layout selection in most OSes). You can use flirc_util for more precise control as there is a "record_api" command which takes two 1-byte values (decimal) as a key definition. But you need to enter HID codes, not key codes.

I like to use this http://www.freebsddiary.org/APC/usb_hid_usages.php to get my HID codes. Scroll down to table 7 (keyboard). Bear in mind that information on that page is only true for US QWERTY and other compatible layouts. HID codes are assigned to a physical key location on the keyboard, not to a specific letter or symbol. So key "Y" on QWERTY will have the same HID code as key "Z" on QWERTZ.
Title: Re: How does the Remote Control work?
Post by: DeltaMikeCharlie on July 22, 2023, 04:59:00 PM
Quote from: TimC on July 21, 2023, 02:39:31 PMBy the way I found that the pic following appears to show incorrect code numbers.
The numbers provided are the correct Linux event codes.
https://github.com/torvalds/linux/blob/d192f5382581d972c4ae1b4d72e0b59b34cadeb9/include/uapi/linux/input-event-codes.h#L191
 (https://github.com/torvalds/linux/blob/d192f5382581d972c4ae1b4d72e0b59b34cadeb9/include/uapi/linux/input-event-codes.h#L191)What are the numbers that you have provided?  They don't seem to be the HID codes.
Title: Re: How does the Remote Control work?
Post by: TimC on July 22, 2023, 05:58:33 PM
They are the codes that the Keyboard Tester software showed when each button on the Icebox remote was tested.  I couldn't test the Power Button as it turned my PC off when I pressed it.
Title: Re: How does the Remote Control work?
Post by: raymondjpg on July 22, 2023, 06:28:40 PM
Quote from: DeltaMikeCharlie on July 22, 2023, 04:59:00 PMWhat are the numbers that you have provided?  They don't seem to be the HID codes.
Virtual Key code decimel https://cherrytree.at/misc/vk.htm
Title: Re: How does the Remote Control work?
Post by: NBOSTI on July 22, 2023, 08:32:29 PM
Hi TimC, I have been following this thread since started, more out of interest and hoping to learn something along the way. I am not going to pretend I understand half the things discussed, I am in no way into coding and most of it is gibberish to me. I'll leave all that to the likes of those that know their stuff,.. and there seem to be a lot out there, makes me feel somewhat inadequate in my limited knowledge of such things.

I thought I might contribute this as a possible solution.
 You have mentioned that the HDMI Matrix allows you to access all media in different rooms, and that you have an Apple Tv in the setup.
If you are able to watch AppleTV content from those locations, have you tried Infuse on the AppleTV.
I use that to watch all recordings I have from my EyeTV device. I copy the recordings from the device to a folder on my serving iMac. It reads those files with no issue, even showing all description in the thumbnail when scrolling through the library. If it can work with EyeTv files, I don't see why it would not work with IceBox recordings. It reads all sub-folders and collates them into one that shows on the App.
Just a matter of pointing Infuse to any network attached device and choosing which folder to add to the library.
A simple interface with many settings/options available. Maybe try a free version to see if it works for you. I have the Pro but had no issues accessing any files with the free.
Just thought it might solve the issue of not being able to control those recordings with the RF remote, ..just use the Apple TV to do that.
Hope this is of some help.
 
Title: Re: How does the Remote Control work?
Post by: TimC on July 22, 2023, 11:35:03 PM
NBOSTI,

Quote from: NBOSTI on July 22, 2023, 08:32:29 PMIf you are able to watch AppleTV content from those locations, have you tried Infuse on the AppleTV.

No I haven't heard of infuse. It sounds interesting, but in any case, what I have setup works fine.

The key point is that I am trying to keep the operation simple, so that my wife can operate it easily (and me). I don't have to move files. I just point a remote and play whatever is available on whatever device I am watching.

The trick was to integrate an IceBox into it all.
Using the Flirc allowed me to repurpose my Skippa remotes to operate it.
Title: Re: How does the Remote Control work?
Post by: TimC on July 22, 2023, 11:49:48 PM
Raymond,

Quote from: raymondjpg on July 22, 2023, 06:28:40 PMVirtual Key code decimel https://cherrytree.at/misc/vk.htm

These codes seem to align with what I found.
I don't see one in there to align with the Power Key though.

One thing I would like to know though, is what other keys in that list do something on the IceBox. For example, provided there are suitable Local Channels Numbers set up, you can use the number keys to navigate channels.

What other keys do something?

An exit key would be nice to allow you the come out of whatever you are in back to the live screen.
Title: Re: How does the Remote Control work?
Post by: raymondjpg on July 23, 2023, 10:48:52 AM
Quote from: TimC on July 22, 2023, 11:49:48 PMThese codes seem to align with what I found.
I don't see one in there to align with the Power Key though.

One thing I would like to know though, is what other keys in that list do something on the IceBox. For example, provided there are suitable Local Channels Numbers set up, you can use the number keys to navigate channels.

What other keys do something?

An exit key would be nice to allow you the come out of whatever you are in back to the live screen
That would be because there isn't one, but even if there were, then that reference I posted from the Flirc forum would tell you that knowing what keycodes do won't be of any great benefit in configuring Flirc. If you want to power down IceBox then use the arrow keys to navigate to the lower left icon on the home screen on Kodi and Enter, but you probably know that already.

Again, knowing what other keys in that list do in Kodi would be pointless when coming to configure a Flirc. I thought from earlier posts that you had the option of using a keyboard to control the IceBox so you have the opportunity to experiment with what keystrokes or combinations could usefully be mapped to the Flirc. Also, that you were 99% of the way there with the remapping, so maybe there are just one of two things that couldn't be covered where the context menu would be the best option.

Although perhaps not so elegant as one-touch solutions, the context menu in Kodi is effective, repeatable and reliable, and easily navigable with the arrow keys that are probably the easiest to locate by feel on a RCU. However there is a significant difference between the IceBox and Windows or vanilla LibreELEC implementations of Kodi. With the latter two you can go back a step in menus with the backspace key, but in IceBox that key is custom mapped to bring up a list of recordings. In Icebox you have to use the Esc key which works in a similar way to the backspace but which with some menus shells back to the home screen. If you use Esc on a context menu for a recordng it will take you back to the list of recordings, but on some other menus in IceBox you will see two dots at the top of the list that you won't see in vanilla Kodi implementations. Selecting those two dots and Enter behaves like the backspace key, moving back a step.

So to answer your question the Esc key may be the answer to get back to the "live" screen, or it may not. I don't know exactly what you are refering to, or if by "live" screen you mean live TV or the home screen.
Title: Re: How does the Remote Control work?
Post by: TimC on July 25, 2023, 11:09:17 PM
Found a weakness for the Flirc. It can pick up Infrared from TV screens and interpret it as a key.

Apparently, the backlight LEDs on TVs can put out a fair amount of Infrared.
I originally had the Flirc mounted on a short USB cable attached to the bottom edge of our TV.

I discovered that recording playbacks would randomly jump forward from time to time.
When I connected the Flirc lead to a Laptop and ran a Keyboard tester I found that random keys were being generated (Usually "."s). On the Icebox, the "." does the equivalent of the Right arrow key hence the random jump forwards.

I have now relocated the Flirc to a position under my center home theatre speaker.
This is location allows me to still point the IR Remote generally in the direction of the TV Screen, but is shaded from the TV screen. I had to tuck it a fair way under Infrared reflects all over the place. It all seems to be working now.
Title: Re: How does the Remote Control work?
Post by: TimC on July 26, 2023, 09:20:35 PM
As promised I did some experimenting with a keyboard to see what the Icebox does when different keys are pressed.
You can make use of this data to enhance the settings of a Flirc and the capabilities of an IR Remote Control.

Virtual Key Codes that do something in the IceBox.docx

I am no expert on all the functions of an IceBox or the common names those with more knowledge use.
Occasionally "Something" happened, but I had no idea what, so I have provided a description of what I saw.

The reality is though, that you don't have any need to set up a remote button for these.

That being said though, I did find several keys that are quite useful and I have implemented them in my remote.

Please feel free to do some experimenting and modify the descriptions on the Microsoft word document. Let me know if you can't open a Microsoft Word file, I can generate it as a PDF file that may be more broadly usable.
Title: Re: How does the Remote Control work?
Post by: prl on July 27, 2023, 10:57:46 AM
Aren't the key codes seen by the upper levels of the firmware just the key code values seen in the Linux input_event structure, like the KEY_* values here, for example:
https://android.googlesource.com/kernel/common/+/96985edde9df/include/uapi/linux/input-event-codes.h

A quick search didn't come up with any actual Linux source repositories, but the definitive ones should be in the OS include files for LibreELEC.
Title: Re: How does the Remote Control work?
Post by: TimC on July 27, 2023, 03:13:45 PM
Its all smoke and mirrors to me, which is why I ended up connecting a Keyboard and noting what happened.

I was looking for things that the IceBox would recognise that I could program into my Flirc that would make my old Skippa remote achieve similar functionality to most of the Skippa buttons. The idea being that it would make it more like a normal PVR remote and hence easy for my wife to adjust to.

The only thing I could not find was something that would get the IceBox to exit whatever Menu or function and return to Live TV with a single press of the key. The Tab key was the closest thing I could find, but it isn't consistent.
Title: Re: How does the Remote Control work?
Post by: TimC on September 06, 2023, 12:50:45 AM
I have now been using the Flirc for several weeks now and have to say I am verry happy with the outcome.

There were a few issues with sticky keys, i.e. pressing '2' on the remote resulting in the Flirc sending '22' to the Icebox. This was fixed with rescans of the offending remote keys.

One thing to be aware of with the Flirc company is that while their product is excellent, their support sucks.  They only seem to have two guys trying to support the product worldwide. I suspect it may actually be a company of two people.

Someone asked for a copy of my Flirc config file.  It will only be useful to someone who wants to use a Skippa Remote, but if you have one and want to switch to InfraRed control, here it is.
Skippa Final_my_flirc_config.fcfg