[Solved] Firestick 4K Mythtv frontend spurious backend settings.

For discussion of topics specific to MythTV on Android devices
Post Reply
PhilB
Senior
Posts: 403
Joined: Sun May 11, 2014 6:23 pm
Great Britain

[Solved] Firestick 4K Mythtv frontend spurious backend settings.

Post by PhilB »

I have an oddity with backend settings with the Firestick 4K Mythtv frontend.

I have been switching backends and now the firestick is confused. The history to the three (logical) backends on my local network is as follows:

1. Backend A: My live system which is running Ubuntu 14.04/Myth 0.27 on an AMD system. IP address 192.168.2.99. Still our live system.
2. Backend B: I put new disks in to the same AMD system just to try out Ubuntu 20.04 and Myth31. Same IP address. Loaded, configured and ran frontend on the Firestick successfully but I subsequently abandoned backend B and put the old disks back in to revert to backend A.
3. Backend C: Set up a xbuntu 20.04 / Myth31 backend on a NUC. IP address 192.168.2.109. Changed configuration on the firestick to suit it – success. Ran the firestick with backend C a few times over 3 or 4 days – all successful.
4. This evening, Firestick failed to connect to backend C. The configuration had reverted to backend B. Changing it back to backend C and saving it failed repeatedly – it kept reverting to B and failing. The difference is that my live system - backend A - was switched on and running but connection to it failed. The IP address was right for backend A but firestick is probably unsupported by Myth 0.27 and database credentials were wrong anyway.
5. With backend A turned off and no further changes on the Firestick it connects successfully to backend C.

It has remembered two sets of credentials, B and C, with B being used preferentially if 192.168.2.99 is up and running. How do I remove the spurious credentials for backend B?

Phil
Last edited by PhilB on Wed Aug 18, 2021 5:01 pm, edited 1 time in total.
User avatar
pgbennett
Developer
Posts: 503
Joined: Mon Apr 27, 2015 5:41 pm
United States of America

Re: Firestick 4K Mythtv frontend spurious backend settings.

Post by pgbennett »

When working with multiple backends the best thing to prevent confusion is to set a different pin on each backend. By default they all have 0000 as pin and the frontend tries to connect to the first backend it finds. I suggest you set some pins on your backends. The frontend may prompt for the pin during frontend startup, and you can select the correct backend and enter its pin. The pin is stored on the frontend (in config.xml) so you won't have to enter it every time you start. Note the pin can be anything, it does not have to be numeric.

If this fails, you can edit the config.xml on the frontend to fix the settings there, or delete it and you will be prompted for your backend and its pin upon startup of the frontend.
PhilB
Senior
Posts: 403
Joined: Sun May 11, 2014 6:23 pm
Great Britain

Re: Firestick 4K Mythtv frontend spurious backend settings.

Post by PhilB »

Thanks for the reply but would you clarify for me please?

If I change backend/database details within a Linux frontend setup then a fresh set is written to conf.xml with any old ones removed.
Are you saying that it is possible to have two sets of credentials in config.xml by hand crafting it and that the pin method can be used to switch between them?

Turning now to mythfrontend on the Firestick I presume that there is also a config.xml file and that frontend setup has a little bug – it is adding new details and not removing the old ones (appending not writing?). I’m exploring how to change config.xml manually.
Phil
User avatar
pgbennett
Developer
Posts: 503
Joined: Mon Apr 27, 2015 5:41 pm
United States of America

Re: Firestick 4K Mythtv frontend spurious backend settings.

Post by pgbennett »

No that is not true.

mythfrontend works the same on Linux and Android. There is only one set of values in config.xml. They can be created two ways - using UPNP where the frontend searches for available backends, or using the manual entry of database info either through the frontend or by updating config,xml.

The PIN is used with UPNP. mythfrontend obtains the database credentials from the backend using the PIN. The default PIN is 0000, and it can get them without any interaction with the user. If the backend has a different pin than 0000, the frontend prompts the user for the PIN the first time. Once the PIN has been successfully used by the frontend, it is stored in the config.xml and the user is no longer prompted for the PIN.

To change config.xml manually on Android

peter@office:~$ adb connect fire-office-eth
connected to fire-office-eth:5555
peter@office:~$ adb shell
mantis:/ $ run-as org.mythtv.mythfrontend
mantis:/data/data/org.mythtv.mythfrontend $ cd files
mantis:/data/data/org.mythtv.mythfrontend/files $ cat config.xml

This displays the config.xml on screen. Select it , copy it, and paste into an editor
Edit it in the editor.
copy the result to the clipboard
in adb then run cat > config.xml
Paste the data
Ctrl-D
PhilB
Senior
Posts: 403
Joined: Sun May 11, 2014 6:23 pm
Great Britain

Re: Firestick 4K Mythtv frontend spurious backend settings.

Post by PhilB »

Thanks for your patient explanations!
Setting pin in the 'old' backend has indeed fixed the problem.
Phil
Post Reply