Posts by -=guybrush=-

    it allows to fully control the RPi with IR remote control, not onlz power on/off, since the IR signal is forwarded to the GPIO pins of the RPi.

    My mistake. I was confident those hats come with just a two buttons remote to turn it on and off like others (the second button being actually useless). Probably they have a learning function to let the user adopt a remote with more keys like the ones you've formerly talked of at the beginning of this thread. I should have checked better and just the bigger header could have led me in the right direction...

    As I was already saying, those hats (all the ones you've drawn to our attention) are an effective solution and I thank you for all of your advices, always very clear and very well detailed. It remains I'm very happy with my setup, just in need of a bit of tidying up work (much more than a bit! ;) ). Have a nice day!:)

    this is in total similar to this board, which costs 15€ (plus delivery). But it seems to be available only in some parts of the EU.


    this one is the same board from BerryBase, but availabkle in full EU and Switzerland/Norway.

    I was aware of those hats but including postage we're going around €25. For less than an half, I have the 3 in 1 remote and the power supply too and I completely control every function of the RPi (not just turning it on and off).

    To all of the above I add the personal satisfaction of having thought and built something which perfectly suits my needs by myself. It's clear that, as already explained, what you can see above isn't the finished product for me but I plan to do exactly what Da Flex was suggesting. Just my idea, not necessarily the right one and it remains that those hats are absolutely interesting stuff and an effective solution for everyone who doesn't like to spend the time I've spent (not that much anyway) and just have something which works OOTB so definitely a useful advice from you as always! Have a nice day! 😊

    Hello to everyone! :) As promised more than a month ago, I'm here with a brief update on the results. The hat has been a complete disappointment unfortunately. It seems to be a very old stock (the production date printed on the PCB is back to 2016 and the board is scattered with oxidation signs almost everywhere, especially on the connectors) and it doesn't work: it just emits a clicking noise, nothing else. I've been unfortunate but it could easily happen given that it seems these hats are no longer being produced.

    The IR relay has been a success instead. I've paired it with two separate 5V PSUs (a 2A one and another with just 400mA output, the former controlled by the relay feeds power to the RPi Zero, the latter is always powered and feeds the relay) and bought a 3 in 1 learning remote too (by which I control the RPi, the TV and the soundbar connected to it). With just one remote I control everything I need including turning the RPi on and off without the need for plugging and unplugging anymore. Here is the current arrangement:



    The cost for all the needed parts has been ridicolous ($2.31 for the 2A PSU, $0.93 for the 400mA PSU, $2.99 for the relay, $2.84 for the remote, $1.94 for TEN IR receivers so I've nine of them still left. $11.01 overall if we don't consider the cables and the connectors that I already had and just the need for some soldering work, easy even for me and I'm not that good with soldering!) and it becomes even more ridicolous if we consider that there isn't any need for a MicroUSB cable and an USB PSU anymore, not to mention the convenience given by the 3 in 1 remote.

    Given their very cheap price, I wasn't confident about that (in spite of the fact the seller has a very good feedback) but the PSUs are reliable, well made and they remain cool, always a good sign. No problems at all till now and I've both a WiFi card and a DVB-T2 tuner connected to my RPi.

    It's clear it's just a quick and dirty approach, just to get a proof of concept. Now I plan to put everything inside a neat enclosure and find a way to get rid of the second IR receiver using just the one already present on the relay board. By now, in spite of the fact I've already soldered the connectors even on the IR receiver on the relay PCB, I've chosen to use a second one to use a single ground otherwise I had been forced to connect the RPi to two grounds coming from different circuits and I don't like that approach, apart from the fact that the approach had required one more cable, one more connector on the GPIO and another bit of soldering work.

    What I'm looking forward more than anything else is finding a way to put everything on the same base with more effective, safe and solid connections. I've thought about a breadboard but this isn't exactly what I'm looking for... I don't even know if anything like what I'm thinking about does actually exist... I'm thinking about something like a multilayer PCB but that's too overkill and too space consuming to put everything inside an enclosure so I'm looking for something simpler (if it does exist and it doesn't, at least to my knowledge).

    A nice day to everyone! :)

    I fear the title definitively doesn't describe accurately what I'm thinking of... No replies at all isn't a good sign. I try to change the title from "Libreelec power events from dmesg or anywhere else" to "Power on event: is a restart after a power loss detectable?". I don't know what else to think.

    Another very likely reason for the silence is that I'm asking for something which is just impossible as already guessed by me so, should this be the case, I apologize and I leave up to one of the moderators the choice of completely removing the thread.

    In the end, though it doesn't leave me satisfied, I'm fortunate to own a RPi: adding one of those hats between its power supply and the RPi itself prevents an unwanted power on to happen but this happens only because they're independent and separate circuitry not handled by LE but a microcontroller, exactly as I was saying before. This only eliminates an unwanted behaviour, no traces of what has actually happened.

    If you care about that only, even the old and established good practice of using a multi outlet with a switch or maybe a relay controlled by an IR remote put between the power outlet and the LE box power supply are good solutions (the latter making sense only for devices like a RPi or others without a remote OOTB, the former being instead universal).

    I mark the thread as solved though a real solution doesn't exist apart from one which is certainly feasible: an automatic power off given that there are no signs of user inputs for a certain period of time and no contents currently playing (or, for example, users connected to a tvheadend server), just taking care of background tasks eventually running (easily known by the owner who has scheduled them to run).

    First of all, hello! :) I've come across your thread because I'm using one of those very cheap remotes:



    to control my RPi Zero. It has indeed a very few keys (only 17) and I've barely managed to add just back and mute apart from the navigation keys, the enter one and finally the numeric ones which are relevant to me as I use LE as a TV among other things.

    I was then wondering about a SHIFT function like it happens on some remotes to almost double the available keys but I don't know if LIRC handles such a scenario (I don't think so nor I've found anything about it) then I've found your thread.

    Honestly speaking, looking at the toml I haven't understood well what you've done. Let's consider CHANNELUP: according to your comments, you've mapped it to both KEY_PAGEUP and KEY_PAGEDOWN by the long press workaround but at the beginning of the line I see two different keycodes which means we're talking about two different keys, not the same one. I don't know...

    Another doubt has arisen inside me: your toml file uses the old syntax

    Code
    keycode = "action"

    while now LE uses the syntax

    Code
    keycode "action"

    and, even more, no longer accepts the let's say 'header'

    Code
    [[protocols]]
    name = "myoldremote"
    protocol = "nec"
    variant = "necx"
    [protocols.scancodes]

    indeed, if you include it, it throws an error and doesn't use the so defined toml file. The one I've defined is indeed quite different than yours, not only because it doesn't handle longpresses and obviously is perfectly working (I'm under LE 9.2.6) like yours does too for sure. Probably, we're under different LE versions or, given that in the preface you say you've gone over eventlircd, maybe doing this reverts back to the old syntax, I don't know.

    Have a nice day! :)

    you can use a IR receiver on GPIO pins of the RPi. This is a supported configuration.

    you can see such a setup here.

    Already done since the beginning as written in my first post but this setup is incapable of switching the RPi on because, as explained by chewitt , GPIO isn't active while the RPi isn't powered. That's the reason why all of those other solutions we've talked about afterwards have been developed and are being sold at not that cheap prices (when compared to the price of what they're supposed to control).

    I don't want to start an endless debate about what's better and what worse (it depends upon way too much aspects, the first certainly being the needed usage scenarios) but my one cent opinion is that at least in this regard OPis are better engineered. With my OPi PC (and I'm sure with many other models of the line) I can do what I wanted to reproduce on my RPi zero with no additional hardware apart, obviously, an RC6 remote (or, as I've done, a much cheaper universal one programmed to resemble it by which, as an added extra, I can control the TV too like I couldn't have done with a real RC6 remote being mine a 4 in 1 remote).

    To be honest, my feeling is that all of this wasn't an engineering fault but a precise choice to keep production costs to the bone and let a very profitable accessory market flourish.

    Thanks for all of your advices: I'm sure they would be useful for many coming across this thread. :)

    the first one will work for Power ON/OFF. Since it is for the RPi3, there will be a limitation to 2.5A (at least I think so). The RPi will be powered than over the HAT (similar to my solution no longer available) instead of its own USB connector.

    Full documentation of this board will show, how to use it with each kind of RPi.


    An additional FLIRC would be needed for full control of LE.

    I knew that but thanks for confirming it and for having added that very useful link. For what concerns Flirc, I knew it almost since its birth and it is a great piece of HW but it is also quite expensive and, given the price of an RPi zero, I'd prefer to scratch my head and see if I can find alternatives (if any and if possible, even less elegant and with less functionalities offered, even creating them from scratch like I've, unsuccessfully, tried to do with that relay) rather than ending up with spending for accessories more than for the RPi itself but I'd like to underline this is only my approach, not necessarily the right one. Have a nice day! :)

    It's fine then. Here are the links to the products I was speaking of previously (being links to currently active listings, I don't know how long they would remain valid while the photos added above would remain valid anyway):


    Alternative OOTB solution


    One channel IR relay 5V


    The second one could be found from various sellers with slightly different board layouts (when the PCB colour varies, usually even the layout changes) but under the same descriptive title. Indeed, the link isn't the one to the listing for the relay I've bought which has almost no description. Reading the description for the listing linked here makes me think I was completely misleaded by the title (while the specs printed on the relay packaging could have led me in the right direction) and this IR relay isn't suitable to achieve what I'm looking for. Now it seems quite clear that the 5V and GND comb is to fed power to the IR receiver while control happens on 250V AC appliances for example, even on 28V DC ones but certainly not 5V DC ones like the RPi. My fault.

    it would be more useful, to get links to the products (as I did). Then is possible to know more of these solutions and how they fit.

    I agree with you but I've done it purposedly, not by mistake. If I had placed some links to the products, they hadn't been links to the manufacturer's site but to an online platform where they're currently being sold so no datasheets or other useful informations but only advertising and this is usually against the rules on a forum. BTW I've described them and making a search by image with Google Lens for example is just enough to find them if someone is interested.

    In the meantime, I've already bought them both to make some testing on the field! ;) Have a nice day! :)

    RPi has no native IR capability so needs an additional device with independent power and IR receiver that can control the main power to the board, either by being inline to the normal power connector or through driving power input pins on the 40-pin connector. It is not possible to use a GPIO receiver because the GPIO pins on the 40-pin connector need power before they can receive anything.

    Exactly as I expected unfortunately. Thanks for your follow-up anyway, precious as always! :)


    wtuppa


    Great advices, thanks! As it often happens on a forum, my request hasn't been completely useless, fortunately. ;) I don't know if it is permitted to add links to online listings but I don't think so. BTW, I've also found this alternative:



    but at this point why not someting like this one?




    It is a one channel 5V IR relay and, if I'm not mistaken, just connecting the USB cable power lines to the relay and two DuPont jump wires from the pins in the photo to the corresponding GPIO comb ones should work at a fraction of the cost (around $4)... It's clear that I'm aware it is a complely different approach, a much dirtier one with much less functionalities offered but...if your aim is just turning it on and off, it could make sense though it involves using a third remote (the first one being the one controlling the TV unless you successfully setup CEC at its full capabilities which sometimes isn't an easily obtainable result) unlike what happens with the solutions suggested by wtuppa which are certainly more elegant. An alternative to the third remote (needed also for the other OOTB solution I've found) could be one of those learning remotes which can be bought quite cheaply too and could control the RPi, the TV and turning on and off the RPi, all in one: not that bad I believe but it's just my point of view.

    I'm also wondering if I could use the IR receiver from the relay even to control the RPi, just connecting its signal and GND legs directly to the GPIO comb given that power to it is fed by the relay board. It would tidy things up a bit removing the need for a second IR receiver.

    Thanks to the both of you! I mark the thread as solved.

    Hello to everyone! :) I know by experience that what I've described in the title is achievable on an OPi PC (and also other Allwinner based devices) using an RC6 remote but could I succeed in getting the same result even on my RPi? I've bought a very cheap solution made up of a remote, an IR receiver and DuPont jump wires by which I've connected the receiver to GPIO. After a bit of digging around (I've got a great help reading on the forum here too, as it often if not always happens), I've been able to get it working quite issues free but I still miss maybe the best part of my project! ;)

    The protocol used by the remote isn't RC6 but Nec but it's clear that if you tell me that it can be done just replacing the remote with another... Hey, I'm fine with it! If it can be achieved even leaving everything as it is, even better but I don't know...

    Thanks in advance for your advices and have a nice day! :)

    Hello to everyone! :) I don't know if the title I've chosen is descriptive enough but it is the best I could think of. I have an RPi Zero with LE 9.2.6 on it. Hooking it to one of the USB ports available on the TV is just enough to fed power to it and I'm satisfied by the approach but here comes the reason for the existence of this thread.

    Every day, at six a.m. o'clock the TV enters a low power state (the panel stays off but it's evident that something is happening because both the RPi and the soundbar hooked to optical turn on) I believe to update the channel list or search for software updates. I'm almost certain this can be prevented disabling the relevant option under the TV settings but I prefer solving problems than getting round them.

    The soundbar after a while turns off by itself but obviously not the RPi (and the television too with it, courtesy of HDMI CEC which is what I want to happen).

    It's clear that this isn't what I want to happen so my question is if there is a way to understand that the RPi has been turned on by that power event (which is the same than plugging in an external USB power supply) and not by remote and, under that condition, turn it off (and the TV with it, still thanks to HDMI CEC).

    It would be great even in case of a power loss when connected to a USB power supply as usual, not only under my peculiar scenario but my idea is that it is just impossible. The first place to look for a clue is certainly dmesg but the problem is that it starts logging events after the system has started the boot process so that's impossible to find something there nor, I believe, anywhere else. Maybe with some added and completely independent circuitry but that's really overkill.

    Thanks in advance for your advices and have a nice day! :)


    EDIT:


    This isn't certainly appliable to an RPi given that, as discussed elsewhere, it can't be turned on by remote so its one and only way of turning on is plugging in (or obtaining the same by third party hats and/or some kind of workarounds, not the scope here). It remains interesting if it is possible to detect a power loss and eventually turn it off. In case of a power loss from turned on, I think it's almost certainly possible because there is certainly sign of an unclean shutdown somewhere but when already turned off before that happening (like under my peculiar scenario) I think it's just impossible.

    I can confirm the issues with CEC were linked with the TV while LE stable 9.2.6 on the RPi Zero handles it just fine. I've just tried it on a recent Philips model with no issues at all, even after issuing a standby command by cec-client. I'll mark the thread as solved. Thanks to ghtester and Da Flex for their precious support!

    Hello again. I'm certainly still missing something. The IR remote is a great deal and I had already thought about that in sinergy with CEC (which unfortunately seems not completely working though I still need to go more into detail carrying on other test) and I'd really like to avoid the relay if possible BUT as previously explained I wanted to automate the on-off-on thing by a startup script. This can be done with CEC (if working completely) and with a relay connected to GPIO but not with an IR remote controlling the RPi (and not the TV), not according to me at least but I could well be mistaken.

    Indeed, given that the Digikey project you've sent to me involves using the RPi both as an IR receiver and sender (while I was thinking about the simpler solution of using it as a receiver only), I can think of making a script to send the IR code to turn on/off the tv to get what I'm looking for but this would force me to put the RPI with all its cables in front of the TV and this is quite a mess while I was planning to fix it to the VESA holes on the back. I may solder both the sender and the receiver connected to the RPi on cables long enough to put them both inside the TV case then just let the cables out of it to connect them to the RPi on the back. A neat approach! Shouldn't I succeed in getting my result by CEC, that would be the path I'll follow!

    Given that by my brief research (still need to deepen it enough), by now it seems to me IR is just a serial interface, I could even think of taking a look at the TV IR receiver and, if possible, disconnect it from the TV itself and route it directly to the RPi then connect the RPi sender line directly to the TV motherboard. Too overkill, I know! ;) I don't think I would do it because I'm almost sure I would end up with a fried RPi or TV motherboard (or even them both if I would be good enough!) but it would be great!

    OT again. I apologize, again. I would only report back the progress with troubleshooting CEC and nothing else but I have to say it has been quite instructive and useful to tidy up my approach. It often (if not always) happens when you're not left alone with your ideas and skills. ;)

    ghtester


    Maybe I'm missing something from your first post on the thread but unless I get CEC to work completely so for turning both on (like currently it doesn't) and off the tv, my last resort is the relay because I need to be able to turn the TV on and off through the RPi which can be then controlled by an IR remote so that I'm completely free from CEC gaining at the same time the extra of needing only one remote, the one controlling the RPi. The remote alone shouldn't solve my issue, should it? I don't think so.

    Thanks for your advices, maybe OT but very instructive and useful to have a valid alternative to CEC. Have a nice day! :)

    Da Flex


    Thanks for all your precious advices. I'll check and report back ASAP. We're talking about a quite cheap TV set (though with a good full HD panel, the reason why I'd like to avoid recycling it) so I'm not confident they've put great effort on the firmware side (especially CEC which often fails even on some models from renowned brands) but on the other hand I've understood your point about the RPi Zero.


    ghtester


    I know my detailed escription is of no use for you or anyone else and I apologize (considering it is quite an off topic too) but I didn't know how else to explain what I'm trying to achieve. I couldn't just say "I want to turn the TV on then off then on again.": if I had done it, you had replied "Are you mad or what?" or something similar and you had been right.

    Thanks for the Digikey page: interesting but I'm more interested in the relay thing. Don't worry anyway: I'll try to find out by myself. For what concerns the need for a repair, I obviously agree with you but there are other considerations to be carried out. I wouldn't go into detail otherwise I would make another useless off topic.

    Thanks! :)