That's great news! Glad I could help.
I had forgot I changed my default name from libreelec, and changed the PW. I try to stay clear of defaults just in case somebody were to make it past my firewall. Did you at anytime change the minimum SMB in LibreElec back to SMB v1? Just wondering because you said you didn't have to change the default username/pw.
To tighten up your security now that you got it working I would check that v2 is the minimum. Then if the connection fails go ahead and update your default name/pw in LE like you mentioned. Then try again.
Otherwise, if you are already have the minimum set to v2 perhaps LE or Kodi has a backdoor that you discovered "kodi/kodi" (I would hope this is not the case).
I like being able to backup and restore LE under the System menu.
However, it would be a great addition if there was an option to schedule backups to a shared folder.
Their should be an option to tell it how many copies to keep (before it overwrites the oldest one)
How frequent to perform the backups (daily, weekly, monthly, custom).
Finally what time should LE run the task as to not interrupt a user.
Currently I am using a Kodi addon for these features, but it doesn't grab everything that LE backup does. I also belief the less Addons the better to keep things running smoothly.
The main purpose of LibreELEC is to be a media center client, not a server...
.....For hosting a tvheadend server a complete graphical OS is totally over sized.
I have to disagree to a certain extend. Yes that is the main purpose, but I run TVHeadEnd42 addon on top of LE/Kodi and it runs fine all on RPi2.
Hosting TVH on a server a HEAVY GUI like Mint Cinamon would be too much. But LE is just right. I bet Raspbian would work good as well.
IDK much about MAC OS but have you tried creating a user account other than one called "Guest" Try making one called "kodi" and giving it a password. (Required for SMB 2/3 iirc).
Later you can figure out how to hide the user from a login screen if you need to do that.
What operating system are you running? I'm thinking you are having sound driver issues on the laptop.
When you plug in the HDMI cable and sound still comes from the laptop:
Right Click the Speaker in the Bottom Right-hand corner
Left Click "Playback Devices"
Look to see if there is a second option for HDMI now that it is plugged in and click on that.
So I tried something new and it works but sounds like a temp fix.
The way my network is setup, I have my router plugged in to a SoHo Netgear 24port switch. My RPi2 was plugged into a port on the switch and all connectivity worked fine (except for above said problem with cifs).
I took the RPi ethernet cable and put it right into the back of my Router on an extra port and it works great all of the sudden.
I find this rather puzzling. The switches are layer 2 so it shouldn't be looking for an IP address, rather it would go by MAC address.
I know the MAC address table has the RPi's MAC in it, because it works fine once kodi is running.
I wonder if Connman isn't waiting long enough for the test to complete, or if latency is high it might fail.
So this sounds like an issue with Connman, not the timing of the execution as I thought before.
So I disabled any extra services I added (tvHeadEnd Specifically) and the same issue occurs.
Reading the JournalCTL -b shows that right before the cifs mount fails I get the following error:
Tried multiple ethernet cables and have same problem.
The above error only occurs when using a static IP address that is Wired. If I use wired DHCP the cifs mounts no problem, If I use STATIC or DHCP the cifs mounts no problem.
This is starting to looking like something that might need to be patched milhouse
I will continue trying to debug this afternoon as time persists.
And if you set "wait for network" in Settings/LibreELEC/Network?
At the end of my first post I stated that I set that as high as 30 seconds and still no joy.
Here is systemctl list-dependancies storage-recordings.mount
To me those look good, but I'm not a Linux Guru
No go on the sleep, I set it up to 15 seconds and it does the same thing.
I Get Error: Unknown lvalue 'ExecStartPre' in section 'Mount'
BTW: Hardware is a RPi2, LibreELEC 8.2.4
OK, I give up and need a hand. I followed the instructions in the wiki here to setup the sample cifs mount script.
Created a file in system.d call storage-recordings.mountCode
I can do: systemctl enable storage-recordings.mount
and I get the proper symlinks for the directory.
I can then do: systemctl start storage-recording.mount
and it works fine.
Upon reboot, if I am using wired ethernet I get this error: (If I use Wireless it's fine)Code
- ● storage-recordings.mount - cifs mount script
- Loaded: loaded (/storage/.config/system.d/storage-recordings.mount; enabled;
- vendor preset: disabled)
- Active: failed (Result: exit-code) since Thu 2018-03-08 03:31:12 EST; 1 month
- s 1 days ago
- Where: /storage/recordings
- What: //192.168.2.98/Share/Plex/DVR
- Process: 530 ExecMount=/usr/bin/mount //192.168.2.98/Share/Plex/DVR /storage/r
- ecordings -t cifs -o username=XXXXX,password=XXXXXX,rw,vers=2.1 (code=exited,
- Mar 08 03:31:07 tvHeadEnd systemd: Mounting cifs mount script...
- Mar 08 03:31:12 tvHeadEnd systemd: storage-recordings.mount: Mount process exited, code=exited status=255
- Mar 08 03:31:12 tvHeadEnd systemd: Failed to mount cifs mount script.
- Mar 08 03:31:12 tvHeadEnd systemd: storage-recordings.mount: Unit entered failed state.
I can type in the Process: 530 command manually and it works:
Reboot and it's gone again. It seems as if the LAN connection isn't truely up yet even those the script says "after network-online.service" This is verified by using WLAN connection with no issues.
I tried to go into LibreElec settings ->Network->Advanced Network Settings ->Wait for network before starting kodi == ON, and Max Wait Time set up to 30secs.
This made no difference.
Anybody know how I can fix this?
You know more than you are giving yourself credit for Most people can't come up with their own GUI for Kodi let alone piece together stuff from several authors to make it work.
Now that you have the core of functionality that you believe is what makes this plugin great, people can grab the code and make suggestions or fork it and give it a makeover. This is what makes open source GREAT!
Sometimes great ideas come from several minds and not just one. When I took more advanced programming classes it was done with a peer looking over the coders shoulder. The peer would look for syntax errors and try to make suggestions on the fly why doing it a different way would be better. This in turn helps the coder strengthen critical thinking skills, and introduces students to positive criticism (which always shows up with peer reviews of code, or when other people just tinker with someone's code in general).
So with all that said, I don't enjoy coding, but I'm capable if I get some use out of my time I put in. I medically retired last year and from time to time I need something to tinker with to keep my mind sharp, so I'm more than glad to see what we can do about the RAM issue.
I started to debug to find out where the memory is getting heavily used up.
The first thing I noticed is when the line
If the lineup is large say for Digital Cable, then the hash list will be so big that it will consume all or most of the memory.
the get_schedule_hash_list function inside of schedulesDirect.py returns this as a list. Furthermore, that function calls the API and the API ireturns _post as the list.
- A major problem here is that the MD5's used for EPG differential are all being dynamically stored into RAM. The more lineups, channels in a lineup, and days requested, the more MD5's get pulled and as a direct result the more RAM get's used. (Less days or filtering list does work here to make it smaller, but not enough)
- Another problem I saw was that the MD5's are getting downloaded even when day's are set to ZERO.
- Next if you had enough RAM it then tries to stream out to the xmltv.xml file and this is resource intensive as well. So it might use up the RAM and crash here because the variable "schedule_hash_list" has not released the resources it used until the .py file closes.
Possible solution: Create a temp working directory. When pulling MD5's from the JSON server, write them to a file instead (would require a little work in the api.py file). Then when comparing the hash just use file open and compare MD5's that way. When job is done, remove all files from the temp working directory.
I will continue to read through the code and if time persists will see if I can come up with a solution.
I too ran out of memory when I tried to download 14 days of EPG.
I plan to troubleshoot more tonight.
spydah , how did you increase the available memory for LibreElec?
Other than this issue, it does seem to be working OK.
But kind of useless when TVH runs the grabber and I watch all the Free Mem disappear with debug mode on.
I think I will see if 7 days will work OK for my application and then I will troubleshoot on another Pi3.
I have this addon and works well for me.
LibreElec 8.0.1, RPi2.arm, installed on a RPi3.
Only add-on is TVHeadend 4.2
When configuring the addon for the location of the xmltv.xml file, if you choose "Web" and then put in a URL that contains multiple PHP parameters with a "&" the URL gets parsed into the settings.xml file incorrectly.
The settings.xml file then will have:
Turn on debugging with URL and then look at the debug.txt file in .kodi/userdata/addon_data/service.module.TVHeadEnd42/
Now force a run of the grabber from TVH
This results in a "error:Spawn: <ip address:port>
I then edited the settings.xml file with the proper URL on the line starting with:
I removed the "AMP;" and it fixes the first issue, but a second problem occurs:
Now the wget request starts and data transmits, but it abruptly stops towards the end and the dbug.txt file for TVH4.2 shows:Code
- 2017-03-29 10:56:37.495 spawn: - 100% |*******************************| 4211k 0:00:00 ETA2017-03-29 10:56:37.705 xmltv: /storage/.kodi/addons/service.tvheadend42/bin/tv_grab_file: htsmsg_xml_deserialize error Unexpected end of file during parsing of label reference2017-03-29 10:56:37.705 xmltv: /storage/.kodi/addons/service.tvheadend42/bin/tv_grab_file: grab returned no data
This second problem is related to the wget request found in the grab file: /storage/.kodi/addons/service.tvheadend42/bin/tv_grab_file
I believe the problem is that the file is streamed and not static. The current code tries to stream the file with -stdout and it can't handle the fact the the incoming file is also streamed. This seems to cause a buffering issue. I ran into a similar issue before and it was resolved with:
So I believe a solution would be to modify the tv_grab_file with a similar wget statement to save the file statically and overwrite any old one. Then the file can get streamed into TVH.
Unfortunately this is where my current Python knowledge ends. Sorry so long, but I dug into this a lot and wanted to document as much as possible to make it easier to fix.
A temp solution is for users to create a cron job with the wget example I suggested. Then use the "FILE" option instead of "WEB" option when configuring the add-on.
Not sure if I should report it here if this Dev team made the addon...Or if it should go to TVH if they made the Addon.
I just did a clean install of LE, with TVH 4.2 trying to get the Unicode error to pop up again to capture a log...Unfortunately it ran perfectly fine this time (even with same lineups).
Seems like an intermediate problem, but I plan to add the Import lines into there anyways just in case.
Other than that I got it working good and I was impressed as I watched the Pi-3's resources while messing around with the backend software. Only time I ever saw it use a lot was during the actual grab. One CPU core went up to about 100%, and then it was switch cores and another went to 100%, but the over all CPU usage never budged 25% at one given time. I watched the RAM during the grab and out of 735mb available it went up to 194 used but then dropped back down to 184mb used after the grab was over. I'm only doing about 30 channels between the 4 lineups, but I grabbed 14 days.
Seems fairly stable so far. Nice job!
I tried entering the code below at the beginning of the schedulesdirect.py file to ensure it was using utf-8, but that didn't help. I just don't know enough about python to troublshoot it.
I like the SD4 interface, I will eventually have a few suggestions for improvement, but right now I'm still debugging.
I can confirm that I ran into the unicode errors as well. Although my log looked a little different, it did state "unicode error" in there somewhere.
I then went ahead and made the above changes, and proceeded to edit the channels from lineup and the problem went away.
I then wanted to undo the changes and capture all the error logs, but I can't duplicate now. I uninstalled the app, removed the userdata->add_ons->script.module.sd4 directory, reinstalled the app without the above code changes and it works fine??? Not sure why, but I suggest looking into adding those lines to import section as it did help.