Page 1 of 1
Accessing MythTV UPnP Server? Password needed?
Posted: Sat Nov 30, 2019 6:29 am
by KennyB
Hey everyone, I'm sorry for the convoluted question, but my eyes are really tired from reading, and I think I'm reading out of date information...
I've got my MythTV backend all setup, videos added, etc. and so forth, and I'm trying to access the UPnP server with VLC. When I go to play one of my files however, it asks for HTTP authentication. I tried the password I had set for Mythweb but that didn't work, and tried the password and account I have set for the database, and that didn't work either. Is there some other setting for the user and password I'm not aware of? I found a page that said VLC isn't a compatible UPnP client so I'm wondering if that's the real issue at play.
Using MythTV v30. and VLC 3.0.8
Also this might be out side the purview of this specific troubleshooting issue, but am I going about the wrong strategy for viewing my files with a Roku or Firestick? I was just figuring on downloading a DLNA client for those to access it via the UPnP, but wondering if there's better options I should try.
Edit:
I just tried this with a different DLNA client and am still having problems so I don't think it's specific to VLC. The exact message I get while trying to use VLC is "Please enter a valid login name and a password for realm MythTV". I've completely removed MythWeb and all associated .htaccess files so I have no idea how this is being triggered.
Re: Accessing MythTV UPnP Server? Password needed?
Posted: Sat Nov 30, 2019 2:49 pm
by bill6502
Try: mythtv. If that doesn't work, please paste the backend log when the failure happens.
You could also do: mythbackend --setverbose http:debug and attempt logging in again
for more info in the log. [use http:alert to restore normal logging]
Re: Accessing MythTV UPnP Server? Password needed?
Posted: Sat Nov 30, 2019 7:08 pm
by KennyB
I tried 'mythtv' for both user and password but that didn't work.
I wasn't able to launch mythbackend with the option you specified. I launched it with
/usr/bin/mythbackend
And when I tried to press 'ok' on the authentication window, I saw this warning
W Basic authentication is only allowed for HTTP 1.0
I'm not sure why it's not working with the verbosity option you gave me. I get this error...
2019-11-30 10:49:42.630080 E MythSocket(13b9740:-1): Failed to connect to (127.0.0.1:6543) Connection refused
2019-11-30 10:49:42.630472 E Connection to master server timed out.
Either the server is down or the master server settings
in mythtv-settings does not contain the proper IP address
2019-11-30 10:49:42.630495 E Unable to connect to backend, verbose mask unchanged
But that's strange since I can start it okay without that option set. I verified in mythtv-setup that my Primary Address is 192.168.1.2 and the option to Listen On All Available addresses is set. There's also nothing different between /etc/mythtv/config.xml and ~/.mythtv/config.xml except this...
kenny@AMD:~$ diff /etc/mythtv/config.xml ./.mythtv/config.xml
15a16,21
> <UPnP>
> <UDN>
> <MediaRenderer>560b2405-c6a2-4129-b701-bd65df9cd4ba</MediaRenderer>
> </UDN>
> </UPnP>
> <LocalHostName></LocalHostName>
17d22
<
Re: Accessing MythTV UPnP Server? Password needed?
Posted: Sat Nov 30, 2019 7:13 pm
by bill6502
Sorry: User: admin, password: mythtv
Re: Accessing MythTV UPnP Server? Password needed?
Posted: Sat Nov 30, 2019 7:14 pm
by bill6502
And, the mythbackend --setverbose trick is sent to a backend that is already running.
It changes the debug level without restarting it.
What does this return:
Code: Select all
curl --digest --user admin:mythtv localhost:6544/Myth/GetSetting?Key=HTTP/Protected/Urls\&HostName=_GLOBAL_
Re: Accessing MythTV UPnP Server? Password needed?
Posted: Sat Nov 30, 2019 8:16 pm
by KennyB
bill6502 wrote: ↑Sat Nov 30, 2019 7:14 pm
And, the mythbackend --setverbose trick is sent to a backend that is already running.
It changes the debug level without restarting it.
What does this return:
Code: Select all
curl --digest --user admin:mythtv localhost:6544/Myth/GetSetting?Key=HTTP/Protected/Urls\&HostName=_GLOBAL_
The curl command returns a 401 Unauthorized
Code: Select all
<!DOCTYPE html><HTML><HEAD><TITLE>Error 401</TITLE><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"></HEAD><BODY><H1>401 Unauthorized.</H1></BODY></HTML>
Here's the debug log info
https://pastebin.com/2vuJa1pZ
Re: Accessing MythTV UPnP Server? Password needed?
Posted: Sat Nov 30, 2019 8:38 pm
by bill6502
Your client is doing basic authentication as you spotted earlier. I've only used
digest authentication (as in the curl above.) Which works for me. On the other
hand, I don't use UPnP, just the Services API (which shares some things with
UPnP.)
You can also change the logging with --serverbose http:debug,upnp:debug
Just looking for more clues as I don't know the answer to this issue.
Try the curl command without the -digest and -user admin:mythtv switches. Or, if
that still fails and you can do SQL, SELECT * FROM settings WHERE value='HTTP/Protected/Urls';
I'd expect it to be missing/empty or 'Unprotected'.
By the by, .htaccess isn't involved in this. Nor does it have anything to do with the
DB user/password. Just FYI.
Re: Accessing MythTV UPnP Server? Password needed?
Posted: Sat Nov 30, 2019 11:06 pm
by KennyB
Hmm okay, still getting a 401 Unauthorized without the '--digest' for curl. Here's another pastebin with the upnp on debug as well
https://pastebin.com/gShDHYHf
I couldn't get that SQL query to work and I'm not super familiar SQL syntax so I used phpMyAdmin to search for it. In the 'data' field I find
Code: Select all
/Capture;/Channel;/Content;/Dvr;/Guide;/Music;/Myth;/Video
And in the 'hostname' field null.
I'm wondering if maybe when i was setting up mythweb authentication I might have accidentally messed something up. I was following the method for getting it to work with digest before i realized that it was for ubuntu 9.10. It ultimately ended up not working for me, and I just protected the mythweb directory with an .htaccess file eventually. But now I'm wondering if in attempting to set it up with htdigest that I screwed something up. It's been quite a while since I had set that though so I'm not really sure what all i did. is there a .htdigest file I might be able to reset a password for?
Edit:
Okay well, I did a bit of an insecure work-around... I changed the line that said "/Capture;/Channel;" etc. to just "/Capture". Now it's playing over the UPnP just fine. Since I don't have the server exposed outside of my LAN this doesn't seem like such a bad workaround? I'm guessing that line is telling it which parts to require HTTP authentication for.
Re: Accessing MythTV UPnP Server? Password needed?
Posted: Sun Dec 01, 2019 12:02 am
by bill6502
Very interesting. You/your cat walking on the keyboard/something else has used the the
Services API endpoint: Myth/ManageUrlProtection with parameters: Services=All AdminPassword=mythtv.
Makes me wonder if the: Myth/ManageDigestUser endpoint was used at some time to
change the default password for user admin. With parameters like:
Action=ChangePassword UserName=admin Password=mythtv NewPassword=somethingElse
Problem is that in order to change it back, you need the admin password (by design.)
If you want to use your SQL tool again, look at: SELECT * FROM users; and maybe it will
trigger something. Or you could have used the Add Action to create a new user and you
could use that.