Posts by ajiratech

    I'm working on an Add-on to drive a custom GUI on a LibreELEC system on Linux. The add-on works fine and is able to drive the GUI as needed.

    At the linux level - LE has udev rules that detect when an SD card is inserted and it works fine, KODI interface generates a notification on bottom right corner as device is added or removed.

    I want my Python add-on to react to the SD card addition or removal event and make changes to the GUI. Users on Kodi forum suggested I use PyUdev module. But as LE does not come with PIP, I cannot install that module.

    Please advice on how to detect/react to SD Card insertion/removal in a Python add-on.

    Thanks in advance.

    they're reset in the middle, without a reboot.

    I'm quite certain that none of the LE processes are modifying them.

    My custom scripts have been something I've worked on in my spare time over the last 1-2 years and I"m afraid that there may be some old scripts that are messing with these DB files. But I can't seem to find any other scripts that could be doing that. Thus the need for a program like auditctl .

    Hi ,

    I have a couple of files that my application manages but some other process seems to be modifying and resetting those files.

    I think auditctl would be a good utility to have on this system. Can someone please advice on how to go about installing auditctl or similar program to find out which process modified the files ?

    It is impossible to catch the process in the act, so 'lsof' does not work for my needs.

    Thanks in advance.

    Hi ,

    I'm using LE 8.x on an odroid board. Everything works great - I have a USB drive connected that gets auto mounted and becomes available over the network via Samba.

    I've updated the samba.conf file under the .conf folder. And the configuration seems to be working as my other shared folders are visible on the network.

    How do I keep the USB auto mount configuration of Libreelec intact but disable sharing of that and any other USB drives disabled. i.e. I don't want the drive to be visible on the network.

    Thanks in advance.

    Thanks chewitt . Once your response ruled out issue with LE. I was able to resolve it.

    SecureCRT has a setting under Terminal->Emulation : "Synchronize view to size" which was selected. The gotcha was that It picks up the settings from first tab of SecureCRT. Since I was trying different settings on non first tab, they didn't do anything.

    Quitting SecureCRT and starting again resolved the issue for me.

    HI ,

    I'm running LibreElec on Odroid C2. For SSH sessions, I increased the font size of text on SecureCRT for better visibility and now the longer commands run out of screen space because the terminal column size is 130 but secureCRT can only show around 110 characters.

    I tried the command 'stty cols 110' but the command fails with message '-sh: stty: not found'

    Please advice on how to install stty or any alternative method I can use to change # of columns.


    It looks like it worked with lower value of 20m and then I did a umount and tried it again with 50m and that worked too. (the only thing different is I emptied the destination folder a few minutes ago)

    No idea why it didn't work the first time. But now it seems to have survived a reboot as well.

    Thanks for confirming that the script was correct and suggesting to try lower value.

    Yes, top reports over 1GB free memory:

    top - 13:02:46 up 47 min, 1 user, load average: 2.51, 2.44, 2.35

    Tasks: 125 total, 2 running, 123 sleeping, 0 stopped, 0 zombie

    %Cpu(s): 2.2 us, 1.6 sy, 0.5 ni, 95.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st

    KiB Mem : 1856264 total, 1067008 free, 218696 used, 570560 buff/cache

    KiB Swap: 0 total, 0 free, 0 used. 1439412 avail Mem

    Hi ,

    I'm running LibreElec on Odroid hardware and want to create a 50MB Ramdisk. I have other mount scripts for Samba mounts that work. But this one for RAMDISK fails - Here is a copy of the script I've tried. Please advice on how to resolve this:

    The mount script is named per LE requirements - script is named 'storage-.tmp-RAMDISK.mount' and located under /storage/.config/system.d

    Here is what I did and the error I get:

    systemctl enable storage-.tmp-RAMDISK.mount

    systemctl start storage-.tmp-RAMDISK.mount

    systemctl status storage-.tmp-RAMDISK.mount. results in:

    storage-.tmp-RAMDISK.mount - RAMDISK mount script

    Loaded: loaded (/storage/.config/system.d/storage-.tmp-RAMDISK.mount; enabled; vendor preset: disabled)

    Active: failed (Result: exit-code) since Tue 2018-11-27 12:25:48 EST; 24s ago

    Where: /storage/.tmp/RAMDISK

    What: tmpfs

    CPU: 4ms

    Nov 27 12:25:48 librelec systemd[1]: Mounting RAMDISK mount script...

    Nov 27 12:25:48 librelec systemd[1]: storage-.tmp-RAMDISK.mount: Mount process exited, code=exited status=255

    Nov 27 12:25:48 librelec systemd[1]: Failed to mount RAMDISK mount script.

    Nov 27 12:25:48 librelec systemd[1]: storage-.tmp-RAMDISK.mount: Unit entered failed state.

    output of dmesg and journalctl as requested: (The device was rebooted just a few minutes ago to unmount sda1 and run fsck on it)

    1. libreElec:~ # dmesg|paste
    3. libreElec:~ # journalctl|paste

    I had tested the power capability of PSU but running script that would max out CPU and still read and write on both hard drives continuously for a couple of hours.

    The PSU became hot but I don't think it missed any read/write operation. This was a while ago and I didn't write down all my observations so I'm not a 100% sure. I'll prolly do it again before I add second HDD.

    As for what is happening these days - one HDD. almost no activity on CPU. I try to play video on Kodi and hit play, but it hangs with message "working". Journalctl had the errors I posted in first message.

    fsck came back clean:

    1. fsck from util-linux 2.29
    2. e2fsck 1.43.4 (31-Jan-2017)
    3. /dev/sda1: clean, 10816/244187136 files, 218674802/976745728 blocks

    I noticed that the USB micro cable was 5% not inserted. I pushed it in the HDD and after that I was able to access the directories on HDD. So that may have been the problem. I'll know for sure if this doesn't happen again in the next 3-4 days.

    One more question - is there a way for me to install SMART on LE installation ?

    I had one USB HDD connected to this LE device permanently and I might add another one soon. I'll make sure it has enough power for device under full load and for the two HDDs.

    I'd like to put some sort of monitoring in place to keep an eye on the HDDs and any errors that may come up for the HDDs from time to time.

    Please advice on what the right approach to accomplish this would be. Thanks in advance.

    Thanks Iridium

    I'll try fsck and clean out any errors. I do occasionally power cycle the LE device which could have caused errors on HDD. I'll report back on how this goes.

    Other thoughts:

    The power supply I'm using has more than enough power for sure, its a 5V 3A adapter. The odroid came with 5V 2A.

    Any idea if there are any logs generated on LE if the Hard drive was not getting enough power ?

    do I not need to worry about auto sleep of HDD on LE ? I do want to turn off auto sleep of HDD's in any case.
    Thanks !

    My LE 8.2 running on odroid c2 keeps hanging every now and then. I believe the root cause is the USB hard drive going into sleep and then not waking up in a timely manner and failing. A reboot usually fixes the issue. But off late this has started happening almost daily.

    When I SSH and try to access a folder on the hard drive via 'ls' command or any other way, that SSH session hangs too. Even Ctrl+C does not help. I have to disconnect session and reconnect. My SSH session works as long as I stay away from accessing anything on the HDD.

    Here is the log entries from "journalctl -r" that makes me believe the problem is due to Hard drive:

    Oct 12 11:50:58 libreElec kernel: EXT4-fs warning (device sda1): __ext4_read_dirblock:901: error reading directory block (ino 9

    306186, block 0)

    Oct 12 11:50:58 libreElec kernel: end_request: I/O error, dev sda, sector 297863464

    Oct 12 11:50:58 libreElec kernel: cdb[0]=0x88: 88 00 00 00 00 00 11 c1 09 28 00 00 00 08 00 00

    Oct 12 11:50:58 libreElec kernel: sd 0:0:0:0: [sda] CDB:

    Oct 12 11:50:58 libreElec kernel: ASC=0x44 <<vendor>> ASCQ=0x81

    Oct 12 11:50:58 libreElec kernel: sd 0:0:0:0: [sda]

    Oct 12 11:50:58 libreElec kernel: Sense Key : 0x4 [current]

    Oct 12 11:50:58 libreElec kernel: sd 0:0:0:0: [sda]

    Oct 12 11:50:58 libreElec kernel: Result: hostbyte=0x00 driverbyte=0x08

    Oct 12 11:50:58 libreElec kernel: sd 0:0:0:0: [sda]

    Oct 12 11:50:58 libreElec kernel: sd 0:0:0:0: [sda] Unhandled sense code

    Oct 12 11:50:58 libreElec kernel: sd 0:0:0:0: timing out command, waited 180s

    Two questions:
    - How do I disable USB auto-suspend for hard drives and make it persist after reboots.

    - Is there any way to recover from the errors suggested in logs without reboot ? such as restarting a service or remounting hard drive ?

    Ideally, I would want the hard drives to spin down only at night. But that is assuming that it will come back up day after day without these errors.

    Please advice. Thanks in advance.