Power/Kodi booted led...

Post Reply
garym999
Posts: 6
Joined: Sun Mar 18, 2018 7:53 pm
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Power/Kodi booted led...

Unread post by garym999 » Tue Mar 20, 2018 6:20 am

Hi all, I have just got around to putting my LibreElec c2 in to an Ali housing.

What I would like is effectively a power light on the front panel. I can’t just duplicate the red led as that in on all time. The blue seems disabled in the latest version of LE but a flashing led would be annoying anyway. I assume I could use the GPIO for this but I’m not that up with coding

TIA

garym999
Posts: 6
Joined: Sun Mar 18, 2018 7:53 pm
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: Power/Kodi booted led...

Unread post by garym999 » Thu Mar 22, 2018 3:54 am

This is my main media client which I finally got around to casing. The housing in one of those afairs from eBay and I have removed the stock heatsink and added a block to transfer the heat to the housing which allows it to be overclocked reliably. Also has a 2A PSU integrated and fed via the power in PCB pads for maxium current availability.

So this is why I'd like to get a sudo Power LED to the front panel so that I know the status of Kodi.
Attachments
IMG_3561.JPG
IMG_3561.JPG (401.42 KiB) Viewed 1360 times
IMG_3562.JPG
IMG_3562.JPG (447.32 KiB) Viewed 1360 times
IMG_3563.JPG
IMG_3563.JPG (456.75 KiB) Viewed 1360 times

garym999
Posts: 6
Joined: Sun Mar 18, 2018 7:53 pm
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: Power/Kodi booted led...

Unread post by garym999 » Thu Mar 22, 2018 5:21 am

Suss'd it and it was actually easier than I thought.

- First I connected a 3.5mm hi effeciency White LED in series with a 18K resistor. The reason for such a high value was to limit the brightness in a darkend room. It is just a status LED not a torch.
- I then connected between 0V & GPIO pin 249 (Pins 7 & 9) of the J2 Header.
- In Libreelec there are two scripts available one for startup and another for shutdown. Using this reference I edited the files.

Code: Select all

nano /storage/.config/autostart.sh
and added the following lines

Code: Select all

echo 249 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio249/direction
echo 1 > /sys/class/gpio/gpio249/value

Code: Select all

nano /storage/.config/shutdown.sh
and added the following lines

Code: Select all

echo 0 > /sys/class/gpio/gpio249/value
This probably is not the best way to do it but it works.

On the bench I have a small test setup and the box is connected direct to the TV supporting HDMI CEC. The LED comes on with bootup but not when the TV turns OFF as Kodi is still running. I know this cos when you turn the telly on again Kodi is on the same page. Tis no biggy as the main setup is via a AVR and harmony remote which powers everything down itself.

User avatar
odroid
Site Admin
Posts: 31072
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 29 times
Been thanked: 146 times
Contact:

Re: Power/Kodi booted led...

Unread post by odroid » Thu Mar 22, 2018 9:27 am

Very nice and practical project!
Can you tell me where you bought the aluminum case?


BTW, there are three difference CEC modes cec0, cecf and cec7 via "hdmitx" kernel parameter.
Refer this thread.
viewtopic.php?f=136&t=25639
Please check the following WiKi pages to polish your great project.
https://wiki.odroid.com/odroid-c2/appli ... key_wakeup
https://wiki.odroid.com/odroid-c2/appli ... ir_wake_up

But above links are useful only when the LibreELEC kernel has the same settings as our Ubuntu Kernel.

garym999
Posts: 6
Joined: Sun Mar 18, 2018 7:53 pm
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: Power/Kodi booted led...

Unread post by garym999 » Thu Mar 22, 2018 5:23 pm

Thanks. The case is from Douk Audio, they do quick a few different sizes and for the money the quality is great. Quite a good selection too.

I did read up on the power switch via GPIO but did not implement it because I'm using the remote for that. The switch you see on the chassis is a genuine power switch cutting the mains power. However I have been wondering if I can use the loss of mains power to issue a shutdown command. I'm not sure how long it takes for that to happen in the OS vs the PSU reserves though. Another aspect of this implementation is requiring a 2sec press to power up which does not have WAF

Of course we do have the deadicated power switch port on J4 but I dont know if that interacts with the OS without some more research. Currently the control comes via the harmony remote (IR for ON/OFF) and Bluetooth for the rest.

My general experience with CEC is that it is a nice idea but because of the different manufacture implementations behaivour is not consistant. So generally I do not use it and with the Harmony its not required anyway. It was just an observation with the test bench TV which had it turned on. It actually worked very well. I did check the settings on the TV and it is set to power off devices over HDMI or AnyNet as Samsung like to call it.

With the processor heatsinking through the chassis I have overclocked the processor to 1.752GHz and the done graphics tweak. I have not spent time pushing it higher but it has been reliable at these settings. Was going to consider do the RAM but as yet have not.

User avatar
odroid
Site Admin
Posts: 31072
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 29 times
Been thanked: 146 times
Contact:

Re: Power/Kodi booted led...

Unread post by odroid » Thu Mar 22, 2018 5:55 pm

Thank you for the link. I'm going to buy one for my personal project.

Appreciate your detail explanation about the power control options as well as overclock and cooling concerns.

Filbo
Posts: 1
Joined: Sat Feb 09, 2019 9:30 am
languages_spoken: english
ODROIDs: XU4, soon a C2
Has thanked: 0
Been thanked: 0
Contact:

Re: Power/Kodi booted led...

Unread post by Filbo » Sat Feb 09, 2019 10:04 am

I love what you have done. Nice, neat work.
I have two questions plus a tip (for others who may build this media box).
Q1 I use a jbod with a modded wdmp and would like to know if the C2 can access a bunch of disks thru a
USB port? I can't build this as I won't go RAID and I have a (sort of) expensive jbod case already.

Q2 Could the many visible screws have been used underside of the box so that the box has clean lines?
I will find out myself but ask that here for others to read.

Tip: If building this box; please consider using an external 2.5A power supply. They are cheap enough and
remove the risk of electrocution or big sparks. I see no reason to integrate 120v/240v into this metal box
and cannot see earthing to the box. I can see the earth has been taken over to the veroboard but it may
stop there - bit tricky. Best to use an external adapter (imo as an electrician). I can see its a nice job of insulating
the live parts and that's fine for hobbyists familiar with this kind of build, done it myself but only where it is
necessary for the build.
Also parts are reduced by excluding, the female power socket, cable terminator, cable crimps, heatshrink &
drilling/filing the big socket hole and less soldering plus as I said, its way safer.
Thanks for reading,
Filbo

garym999
Posts: 6
Joined: Sun Mar 18, 2018 7:53 pm
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: Power/Kodi booted led...

Unread post by garym999 » Mon Feb 25, 2019 3:26 am

Q1 not sure but dont see why not

Q2 The screws are because the C2 board is heatsinked by the case, as heat rises I chose to mount the board on the lid. The box never gets hot in use and I have been able to overclock the processor, graphics and RAM.

I opted for an internal PSU because I wanted an good quality stable and low noise supply (hence the various filters) and I wanted a genuine power switch. The case also came pre-cut for the mains IEC socket & switch. The PSU is earthed to the chasis via the mounting studs.

garym999
Posts: 6
Joined: Sun Mar 18, 2018 7:53 pm
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: Power/Kodi booted led...

Unread post by garym999 » Mon Feb 25, 2019 10:32 pm

Since Libreelec 9 the GPIO support seems to be missing. Does anyone know how to reinstate it?

Post Reply

Return to “CoreELEC/LibreELEC - Kodi Project for C1/C2”

Who is online

Users browsing this forum: No registered users and 1 guest