Posts by serendrewpity

    Ok, I reduced the autostart.sh script to bare minimum. This is the debug script. I left the CIFS storage mount files in /storage/.config/system.d/. Since the storage mounts are attempted prior to the execution of autostart.sh, this enabled me to more easily see if LibreELEC was establishing a connection or the autostart.sh script was establishing the connection. If LibreELEC failed to make a connection the storage mounts would fail with pretty obnoxious error message during boot up. No error during boot meant LibreELEC made the connection.

    That was my naming convention. Success or Failure zip files mean LibreELEC succeeded or failed.

    However, in combination with the script below, I could not get LibreELEC to fail to establish a connection using the Nightly Build from 10.08.2024. Every. Single. Time. I tried multiple times. At least 20x reboots. Not one single failed connection. Either the script made the connection or LibreELEC did. This basically means the script never fails to establish a connection because a) there is no check for an existing connection so it can exit. b) there is no retry logic in the script (aside from the retries built into iwd and connmand).

    I've attached the logs for your review. There is an 'invalid-key' in it though; so, it is indeed a workaround not a fix.

    Now, I just need to append a quick test for a valid IP Address and the line of code below and I am golden. My mounts will be established as well.

    for m in $(find /storage/.config/system.d/ -iname storage-*.mount -exec basename "{}" \;); do systemctl start $m; done

    Here's the abridged, debug version of the script:


    The stanza for 'journalctl' in the script is pretty slick. It captures every single command from 'iwd' or 'connmand' from the start of boot.

    Point taken, but I admitted playing with words here. I said fixed, not a solution. I don't have to repeatedly reboot to reconnect and map drives. I also don't see Invalid-Key when it doesn't connect. I will see Operation Failed or Input/output errors but not Invalid-Key. I've been using LE since version 9 (You've aged gracefully btw). I've always seen Invalid-Key. I just usually tolerate and work around it. Again, I admit, that is indeed what I am doing here. Working around it. But something in what I did has suppressed that specific error.

    However, since this all started on Friday, my router is 87 i.n.c.h.e.s away from the RPI5. Signal strength is 90+. Saturday night, while using 12.01, I successfully connected and set up LE during First Run. I even successfully connecting, a few times after that. At some point after that and a significant amount of tinkering, I could not get it to connect for anything. Not after a reboot, not after a reconnect, not after deleting the connection in LE addon and recreating it. Not from the terminal window. I didn't fix that. I only got it working again, by reformatting the SDCard and re-imaging LE. That's when found ``Nightly 12 - 10-05-2024` . With this build, on Sunday night, I rebooted 25x and it connected on first attempt (including mounting storages). All testing was done with only First Run 'vanilla' being configured. No addons added. No configuration changes. Not even changing the Country / Region / Rev settings in LE. I'm open to being the router and signal strength, I just don't see how, having experienced that. Because the only thing that changed before and after those (success and failure) sessions was my script and the version of LE I was running. So, I need someone to explain that to me.

    I'm not a developer. I can script. I am a Lead Engineer. I will try whatever you want.


    Wow, you're censoring 'inch(es)'? Wonder what a-hol3 made a necessity.

    Ok, Ok, I'm playing with words here. I said fixed, not a solution.

    More specifically, I have identified the sequence of commands to run so that you will never see Invalid-Key again.

    Still there are a few things going on here and first and foremost, I believe the problem with Invalid-Key I am having relates to my 10-year-old NightHawk R7000 router running FreshTomato Firmware 2024.1 K26ARM USB AIO-64K with Linux kernel 2.6.36.4brcmarm and Broadcom Wireless Driver 6.37.14.126 (r561982). My settings ('Advanced'-->'Wireles') can be seen here.



    Additionally, the Invalid-Key issue was particularly heinous because I have a half-dozen storage-*.mounts in /storage/.config/system.d/. They attempt to start/mount prior to autostart.sh. Of course they are bound to network-online.service. So, I made sure that they were defined with BindsTo=network-online.target. Still on LE 11.0x I would sporadically get the Invalid-Key. I would more often need to restart LE and as a result not have my storage mounts mounted and then need to reboot again and again, until I could connect. I have addons, backgrounds, favorites, iconds, backups, and more mounted this way so when this happened, Kodi looked pretty gnarly. Barely useable and required a reboot and flip a coin if it connected this time.

    The problem persisted on LE 12.01 although admittedly significantly less. I played around with connmanctl, and in time noticed the errors that made me look at my router. Again, its FreshTomato and honestly I can't find anyone who knows what all that crap on 'Advance' --> 'Wireless' page of the FreshTomato UI means. So, I went to ChatGPT. The settings above are what it suggested for compatibility with a RPi5.

    Still, No love! Invalid-Key persisted.

    After more digging I realized my autostart.sh script really needed updating. I was explicitly enabling each of my storage mounts with 'systemctl enable' one at a time and figured it was easier to do something like, 'for m in $(find /storage/.config/system.d/ -iname storage-*.mount -exec basename "{}" \;); do systemctl enable $m; done'. It was then that I realized I could start them the same way. I had previously just been forcing a reboot.

    All this is what started me down the rabbit hole of connmanctl and iwctl. I'll spare you all the gory details, but below is the result of tinkering every night since Friday. In the process I discovered the Nightly build from 10.05.2024. Armed with it and the script below, I am connecting every time I reboot. I have NOT been able to get it to fail.

    Let me be clear, I get errors from my storage mounts about 50% of the time and I may still not be able to "automatically" connect during a reboot from time to time due to external factors like distance and noise or interference from other electronic devices with various other Wi-Fi tech. Or needing to reboot my router or something. But after every reboot I am connected each time.

    Also, manual disconnects and reconnects from within the LibreELE AddOn seems to be working. But I am not pushing my luck there because during all of the trial and error, there were times when the LE Addon wouldn't open for some odd reason.

    While I still believe the issue lies with my router's age and custom rom, I have been second-guessing myself about that because of the drastic swing in behavior of the script from LE 12.01 to LE Nightly's 10.05.24 & LE 10.8.24. My router isn't changing. Why is the behavior changing? Something relating to configuration or versioning in LE? Maybe.


    Anyway, this works for me, I hope it works for you. Here you are...



    NOTE: /storage/.config/connman_main.conf .. It doesn't work. I reference it and found that it worked to save my WiFi connection as a favorite and it would show up in a scan from the LibreELEC Addon and even I saw evidence in the script logs that iwctl couldn't find the SSID but connected anyway. So I suspect it was because of this file. Don't know but suspect it plays some role.



    [reserved]

    It's because you're testing for 'success' on the return code of 'nohup' rather than 'connmanctl'. Plus, you should be testing if there is a valid 'ipv4' address acquired like this.


    This will try to obtain the IP address every 3 seconds for a max of five times.

    Shell session
    timeout=$(($(date +%s) + 15))
    until [ -n "$(ip -4 route get 8.8.8.8 2>/dev/null | awk {'print $7'} | tr -d '\n')" ] || [ $(date +%s) -gt $timeout ]; do sleep 3; done
    ip=$(ip -4 route get 8.8.8.8 | awk {'print $7'} | tr -d '\n' 2>/dev/null)
    [[ ${#ip} -gt 0 ]] && echo "Connected!"

    I don't think its hardware either. I was brought to this thread only because I upgraded my TV to a 4K edition (50" AU8000 series). The previous TV was 12 years old and the color was horrible, but had 2 RPis connected to it running RPi3B+/LE9-something and the RPi4B/LE10.01. CEC and Remote worked flawlessly.

    **On LE10 (I didn't try LE9), When switching to the new TV, I noticed the problem that everyone else here has experienced and fixed it by moving HDMI to the first port (closest to power). However in the time since my last post, I noticed that certain buttons don't do what they previously did. For Example, the 'Back' button on the home screen opens the Weather App/Window in Kodi. When I am trying to view a list of episodes and hit "Back", it tries to remove the entry that is highlighted from the library and asks for confirmation. [<---- Developoers please look here]

    I've used Keymap Editor and confirmed that there are no other mappings for that button on ANY screen but especially on the Home Screens and Item Listing screens. I even went a further step and used Keymap Editor's built-in option to remove a mapping for those windows even though nothing was showing for them. I also tried overwriting them with new functions. None of that worked.

    I don't think this is related to cause, but I do think its related to symptom. A relation that could help track down the cause. There is something going on with the interpretation of the signals LE10 is receiving from various hardware. May be the Kernel but I am not ready to focus there exclusively yet.

    I don't know how DRM 4K differs from 4k. A Rpi4B+ plays [rather poorly] 4K content while running LibreELEC 9.2.3

    A nVidia Shield capable of running LibreELEC 9.2.3 [currently theoretical] would most definitely play 4K content and probably outperform the same on Android.

    The Other Thing is you can watch Netflix, Prime Video, Disney+ and Other Services in 4k due to Android and Not rooted.

    If you don't need this okay but die some Users this is one of the Things to buy a shield TV pro (Not the Tube).

    Regards

    Nicolas

    1) You misunderstand me. I don't dislike nVidia Sheild. I don't even dislike Google/Android. Google has pushed remarkable innovation and progress technically. My problem is with the indiscriminate collection of data and selling of it to the highest bidder. nVidia Sheild doesn't do this. Google/Android does.
    2) The thing I like about LibreELEC is that it's very customizable. I have a Raspberry Pi velcro'd to the back of every television. I have created an image for the SDCard running LibreELEC 9.2.3. At boot, it automatically mounts, Addons, Favorites, Screenshots and Backup to network shares. These are CIFS mounts at the OS level. Completely transparent to Kodi. I also have setup each RPi with a static DHCP mapping from my router and then with an AutoStart script on my LibreELEC the hostname of the RPi is updated to reflect the IP Adresss that is assigned to it. What does this allow me to do? This means I can move the RPi anywhere in the house and it will have the same IP address and hostname. It means I can take a backup of one and restore it to another. The hostnames and IP Addresses are preserved. It means I can remove a damaged or bad SDCard from an existing RPi and replace it with a First Boot OOBE SDCard recently loaded with the base LibreELEC image and restore from a backup of one of the other RPis and be up and running with all my customizations in the time it takes for the restore. It means those backups will be in a central location to one another. It means I can download addons manually, to a central location, and install them to any or all the RPis and I don't need to keep the Repos in Kodi if I don't want to... (multiple repos with different versions of addons but tagged with the same version number could be an issue). Keeping just a few or no repos has performance benefits also. There are so many other things that I can do as well but here's my point. You can't do this easily with Android. You need to root in some cases. You definitely can't auto mount CIFS shares without an update to Androids kernal. You can do an SMB mount but not a CIFS mount at the OS.

    These are not limitations of Nvidia Shield. I want an nVidia Shield. I don't want Android.

    Do you remember that Face-Morphing App? The one released a couple years back? It went viral ... people loved how it took a picture of you and morphed it, showing you what you would look like in 40 years. Then it was discovered it was made by a Russian company. Suddenly, Russia, with a database fully of the picture and other identifiable information of hundreds of millions of users [mostly american] became a serious national threat.

    No accountability.

    I don't think they assign value to any individual's data at least not compared to another individuals. I think they treat all data the same. They want it all. Its not a competition between one person's data over another.

    The point is that I don't want to be tracked by google or anyone. I don't want them to have my phone number. I don't want them to have my email. Once you start getting robocalled and can't get it to stop you'll understand. I don't want them to know my ISP. I don't want them to know my location. I don't want them to know what I am watching. They collect this type of information on everyone. So they can sell targeted marketing based on all those different metrics. Targeted advertising isn't all that bad, but whats really bad is that google has no accountability. If your information is used to do something horrible [I'll let you fill in the blank], there is no recourse to hold Google accountable. There's also no undoing the damage.

    There is inevitably a certain digital foot print we all will have in order to live in a digital world, but I shouldn't be careless with it. I should realize that my information has value and that I shouldn't give that value away freely.

    Kodi on the Nvidia Shield's Android runs fine for me.

    No idea why you would want LibreELEC on it instead. :)

    Because google/android want to scrape all your meta data. Google wants your phone number or an email account for almost everything

    I keep wanting to buy one until I consider this issue. If there's a way to load LibreELEC on it instead, I'll wait for that. Most especially because i want to backup my skin and its configurations including autostart scripts and mount points that map smb shares. No ability to do that with Android without rooting.

    @Nicholas, Very good idea and this has tripped me up in the past. But because of that, I did already have SMB v1.0/CIFS File Sharing support installed on my windows and did make sure the LibreELEC/Kodi clients had min smb ver=none and max smb ver = 3

    HiassofT, That did it. samba.conf v4 (do not remove) was missing from the samba.conf file. Guess, I'll add another check for this in my autostart scripts.

    Thank you both for your help.

    Very much appreciated.

    I owe an apology. At least a partial one. The router warranted more scrutiny.

    My phone disconnected and couldn't reconnect again last night. I found it odd that it always seemed to happen at night. It screamed 'scheduled job' to me. So I looked at the logs on my router and it was full of DNSMasq crashes. It kept populating the logs until I rebooted the router. It was complaining about running out of memory.

    The RPi3B+/LE8/Kodi17 was still connected though. The RPi4/LE9 would always drop its connection when this happened. This suggests it still has issues if earlier version don't drop connection in the same situation.

    Anyway, the issue with my router involved an Ad-Blocker function built into TomatoROM [custom ROM like DD-WRT] I've disabled it but feel good that this was a case that the block lists slowly grew to a point where it became too big for DNSMasq to handle.

    I already have two Pi-Hole DNS servers on my LAN and the router's ad-blocker was just a fall-back to catch any rogue clients that attempted to bypass my DNS servers. I'll be leaving it disabled and/or using static lists.

    I've found myself experiencing this very same issue.

    The proposed solution only provided temporary relief.


    I recently got a new phone and noticed it was connecting at a slower speed than the phone it was replacing.

    I tweaked some settings on my router and corrected the issue.

    That's when I started noticing drops from my Raspberry Pis

    I have several Raspberry Pis. [3B, 3B+ and 4B] although I don't think I am using 3Bs.

    I was observing disconnects on 3B+ and 4Bs running LibreELEC 9+ Kodi 18+

    Naturally, I initially suspected my Netgear Nighthawk R7000 router

    Its, at minimum, 8 years old.

    I'm running VPN server [an Amazon EC2 instance connecting to my home network]

    I'm also running two instances of VPN Client [separating streaming content from other traffic]

    Its also overclocked to 1200Mhz from 1Ghz.

    I was sure it was End of Life

    I was looking at getting a R9000 from Netgear

    However, their forums had users reporting the exact same symptoms w/ that router that I was seeing

    It wasn't related to Kodi or LibreELEC but that still made me suspicious

    So I dug some more and tweaked more settings, knowing that tweaking settings is what started all this

    The input/output error on connections kept occurring

    My new phone would drop its connection and not reconnect either

    When I encountered the error the RPi and Phone would not reconnect without rebooting the router.

    Then it would work again until the next failure

    Then I came across this thread and changing the channel seemed to work

    BUT... I couldn't get the RPi4 to connect to the 5Ghz network only the slower 2.4G network

    It was late, I wanted to watch a bit of tv and go to sleep

    I wanted to leave this issue until tomorrow [yesterday]

    So I slapped an older 3B+ on my TV which still had LibreELEC 8+ and Kodi 17.7 on it.

    I was remembering wrong, though

    It had been so long that I was expecting it to only connect to the 2.4 wifi

    At this point, I was fine with that

    To my surprise, it started and could see all networks/SSIDs [I have virtual SSIDs (1 on 2.4Gh and 1 on 5Ghz)]

    It was connecting immediately to the 5Ghz network and the signal was in the 90s

    Previously the 4B was seeing signals in the 60s.

    It's been 2 days and my connection is still strong.

    In that time, I've had one of my TVs streaming CNN

    It only stopped streaming once in that time and I restarted the stream.

    The connection with my network was still strong.

    But even with solid connections I can't remember having a stream play continuously for over a day

    Obviously the source was a quality source but also the connection [and more importantly my router] was no longer the weak point

    The issue appears to be LibreELEC 9+ [or perhaps connman]

    After a quick search on google, this was the first link google presented. Hope I'm not punished too harshly for the mild necropost. [Scroll to bottom for solution]

    So the resolution for me, was much simpler and was sourced by my inherent laziness. It didn't require me getting out of bed to connect to a wired connection to run commands from SSH or changing my WiFi password to something less than 10 chars even though I was completely willing to do both. [See aforementioned laziness]

    All I needed was the TV's remote.

    So confirm that the issue described in this thread matches your issue. I rebooted multiple times. Tried to connect to each of the 3 WiFi networks I set up on my router. I couldn't even get to the password prompt for the networks. All efforts generated the 'network error / invalid arguments' prompt almost immediately.

    So, I decided I was going to try to disable the LibreElec add-on. Of course, that can't be done since LibreElec is hard-wired to 'enabled' with no option to disable. But the thinking was sound. Instead, I disabled both the wired AND wireless network interfaces. There is no visual feedback to confirm your settings were saved but as best as I could tell they were, so I immediately exited LibreElec add-on and rebooted Kodi. I also have shortcuts setup in my Kodi build for 'Shutdown' and 'Reboot'. I mention this because I think its important to not lose the changes to the settings you've just made. Simply removing power from your Kodi device by power-cycling your TV, if your TV is your Kodi device's power source, should probably be avoided. When Kodi was back up, I re-enabled the wireless network interface, I attempted to connect to my wireless network and was prompted for a password. Once I got the password sorted, I was connected. Even after a reboot. I suspect the Wifi password that LibreElec stores for wifi networks, somehow got corrupted. But there doesn't appear to be a mechanism for LibreElec to communicate this to you and offer you a chance to change/re-enter the correct password. Anyhow, I hope this is helpful.

    Solution: Disable Wired & Wireless network interfaces in LibreElec addon. Reboot kodi device [not just restart Kodi]. Once Kodi is back up, re-enable wireless Interface in LibreElec. Connect to disired Wifi Network. Enter 'correct' password for given network. Profit.

    I am currently running LibreElec 7.0.3 and Kodi 16.x on Raspberry Pi 3. I have 3 units. I just recently purchased three Edimax AC1200 MU-MIMO USB2.0 WiFi Adapters.

    My inquiry at base is to know if support currently exist for (or if plans to support are in the works for) the Edimax AC1200 MU-MIMO USB2.0 WiFi Adapter (chipset: RTL8812BU)

    As best as I can tell from my reading and poking around the chipset RTL8812AU is supported from LibreElec 7.95.06 onward. Of course this includes Kodi Krypton which may break my builds and add-ons.

    I've found a couple of links below that suggest a manual way of introducing support for a new WiFi dongle. Is it possible to use some similar method to provide support for this adapter on LibreElec 7.0.3? Or any version for that matter?

    I will continue to search and research for a solution but perhaps someone with knowledge can let me know if my efforts may bare fruit or if I should go ahead and return to retailer for a refund and exchange for a more compatible [and slower] Wifi adapter which is my current plan.

    How to add WIFI dongle (Netgear WNA1000M)?
    Edimax EW-7811UTC wifi dongle support RPi3?

    To approach from a completely different angle,... Are there any 802.11AC WiFi adapters out there that support AC1200 and are already compatible with LibreElec 7.0.3?

    Thanks in advance for any advice or help.