DrGeoff / cec_simplest

The simplest example program to show CEC in action
The Unlicense
20 stars 5 forks source link

sits there with a flashing cursor no output from TV remote #3

Closed Electrik-rich546456 closed 4 years ago

Electrik-rich546456 commented 4 years ago

Hi, I see you closed the last issue... But it still does nothing when I press keys on the TV remote. If it suppose to display info on the CLI as keys are pressed then why is it not showing up (up, down, left, right, red, green ....)

what line can i get it to print something to show its working and to work out why my TV is not playing nice?

DrGeoff commented 4 years ago

Line 41 is where screen printed output should currently occur

DrGeoff commented 4 years ago

Not all HDMI cables are created equally. You need one that advertises it has an audio return channel.

Electrik-rich546456 commented 4 years ago

There is nothing wrong with my hardware as far as I know. It works with cec client so why not with your one...? 🙂

On Sat, 23 May 2020, 10:32 am DrGeoff, notifications@github.com wrote:

Not all HDMI cables are created equally. You need one that advertises it has an audio return channel.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/DrGeoff/cec_simplest/issues/3#issuecomment-633014680, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN3GUW2WUB4TLBIOF6VCGDLRS6J4RANCNFSM4NILOHSA .

Electrik-rich546456 commented 4 years ago

Ok this is really strange.... It has started working unexpectedly. it seems the program takes a minute or two to settle down and connect to USB I guess. I'm now receiving messages from my TV remote. the strange thing is if i press any button once it shows up twice so for eg i press the red (old teletext button) once and i see on_keypress: 114 twice. Whats that all about ? Should it not read key down key up?

DrGeoff commented 4 years ago

I'm glad it is working for you. I think the double output is exactly as you said, Keydown and keyup, but it's been a while since I looked at the CEC API.

On Sat, 30 May 2020, 8:56 pm Electrik-rich546456, notifications@github.com wrote:

Ok this is really strange.... It has started working unexpectedly. it seems the program takes a minute or two to settle down and connect to USB I guess. I'm now receiving messages from my TV remote. the strange thing is if i press any button once it shows up twice so for eg i press the red (old teletext button) once and i see on_keypress: 114 twice. Whats that all about ? Should it not read key down key up?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/DrGeoff/cec_simplest/issues/3#issuecomment-636314290, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEV4I2FXEDEEEXPX7MAZDDRUDQ7HANCNFSM4NILOHSA .

Electrik-rich546456 commented 4 years ago

well I've owned this device for a long long time and would really like to be able to use it for my idea but I think I've been climbing mount stupid rather that the CEC mountain lol. Do you know what sort of area i should be learning to be able to do what i want in C ??

Electrik-rich546456 commented 4 years ago

oh yeah is there a way to make it only print only one not twice as it doesn't do it with all keys ????? arrrgggg I'm either bagging head on a Python wall and now a C wall. :-(

on_keypress: 114 
on_keypress: 114 
on_keypress: 115 
on_keypress: 115 
on_keypress: 116 
on_keypress: 116 
on_keypress: 113 
on_keypress: 113 
on_keypress: 1 up
on_keypress: 4 right
on_keypress: 2 down
on_keypress: 3 left
on_keypress: 0 select
on_keypress: 0 select
on_keypress: 114 
on_keypress: 114 
on_keypress: 115 
on_keypress: 115 
on_keypress: 116 
on_keypress: 116 
on_keypress: 113 
on_keypress: 0 select
on_keypress: 0 select
on_keypress: 1 up
on_keypress: 2 down
on_keypress: 4 right
on_keypress: 3 left
DrGeoff commented 4 years ago
static unsigned long counter = 0;
// There seems to be a "down" keypress and and "up" keypress
// Make life simple by just swallowing the "up"
if( counter++ % 2 ){ return; }

There's a snippet that I sometimes use to swallow the second event. It would be better to ensure that the consecutive messages are the same but the above is simple.

If you want to write a program in C++ then it will take you about 100 hours to get a basic handle on the language. C++ is more feature full than C and if you are familiar with another language like Java or Python then C++ will be easier to learn. But the greater scope of the C++ language will mean it will take longer than C to get your head around. The internet is full of resources on how to learn any language you want to. But the advantage a book has is that somebody has curated it.

Best wishes, Geoff

On Sat, 30 May 2020 at 21:19, Electrik-rich546456 notifications@github.com wrote:

oh yeah is there a way to make it only print only one not twice as it doesn't do it with all keys ????? arrrgggg I'm either bagging head on a Python wall and now a C wall. :-(

on_keypress: 114 on_keypress: 114 on_keypress: 115 on_keypress: 115 on_keypress: 116 on_keypress: 116 on_keypress: 113 on_keypress: 113 on_keypress: 1 up on_keypress: 4 right on_keypress: 2 down on_keypress: 3 left on_keypress: 0 select on_keypress: 0 select on_keypress: 114 on_keypress: 114 on_keypress: 115 on_keypress: 115 on_keypress: 116 on_keypress: 116 on_keypress: 113 on_keypress: 0 select on_keypress: 0 select on_keypress: 1 up on_keypress: 2 down on_keypress: 4 right on_keypress: 3 left

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/DrGeoff/cec_simplest/issues/3#issuecomment-636316658, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEV4I7YQWMEN4S6OX3CRTTRUDTSPANCNFSM4NILOHSA .