[Solved] Android Client not connecting

For discussion of topics specific to MythTV on Android devices
Post Reply
klugja
Junior
Posts: 22
Joined: Sun Dec 04, 2016 7:35 pm
United States of America

[Solved] Android Client not connecting

Post by klugja »

I have never tried this before, so this is not about any regression.

I have an Nvidia Shield. I installed adb successfully and installed:
  • mythfrontend-20240310-arm64-v34.0-16-g95fb10412c.apk
I have MythTV 34.0r40 on Arch Linux, and the frontend from Arch works fine.

I verified that the database name, user and password all match. I set the pin to 0000.

The frontend says:
  • Unable to Connect to Database
When I print the log using adb I see:

Code: Select all

02-03 21:52:47.665 20830 20866 I mfe     : mythcontext.cpp:895:TestDBconnection  Start up testing connections. DB 192.168.1.7, BE , attempt 9, status dbStarted, Delay: 2000
02-03 21:52:47.665 20830 20866 E mfe     : mythdbcon.cpp:247:OpenDatabase  [DBManager9] Unable to connect to database!
02-03 21:52:47.665 20830 20866 E mfe     : mythdbcon.cpp:248:OpenDatabase  Driver error was [1/1130]:
02-03 21:52:47.665 20830 20866 E mfe     : QMYSQL: Unable to connect
02-03 21:52:47.665 20830 20866 E mfe     : Database error was:
02-03 21:52:47.665 20830 20866 E mfe     : Host '192.168.1.178' is not allowed to connect to this MariaDB server
The web interface (port 6544) responds remotely. Is there something I need to get the backend to work remotely?

tcpdump on the MythTV backend system shows activity from my shield:

Code: Select all

22:09:23.124089 IP tvscribe.mysql > 192.168.1.178.42542: Flags [S.], seq 2192057907, ack 281107849, win 65160, options [mss 1460,sackOK,TS val 2786406961 ecr 1509046,nop,wscale 7], length 0
22:09:23.124423 IP 192.168.1.178.42542 > tvscribe.mysql: Flags [.], ack 1, win 685, options [nop,nop,TS val 1509047 ecr 2786406961], length 0
22:09:23.124720 IP tvscribe.mysql > 192.168.1.178.42542: Flags [P.], seq 1:77, ack 1, win 510, options [nop,nop,TS val 2786406962 ecr 1509047], length 76
22:09:23.124771 IP tvscribe.mysql > 192.168.1.178.42542: Flags [F.], seq 77, ack 1, win 510, options [nop,nop,TS val 2786406962 ecr 1509047], length 0
22:09:23.125011 IP 192.168.1.178.42542 > tvscribe.mysql: Flags [.], ack 77, win 685, options [nop,nop,TS val 1509047 ecr 2786406962], length 0
22:09:23.126759 IP 192.168.1.178.42542 > tvscribe.mysql: Flags [F.], seq 1, ack 78, win 685, options [nop,nop,TS val 1509047 ecr 2786406962], length 0
22:09:23.126797 IP tvscribe.mysql > 192.168.1.178.42542: Flags [.], ack 2, win 510, options [nop,nop,TS val 2786406964 ecr 1509047], length 0
Last edited by klugja on Tue Feb 04, 2025 5:04 am, edited 1 time in total.
klugja
Junior
Posts: 22
Joined: Sun Dec 04, 2016 7:35 pm
United States of America

Re: Android Client not connecting

Post by klugja »

I saw:
Modifying access to the MySQL database for multiple systems
In the doc.

So I tried this and it did not work (but maybe was needed?):

Code: Select all

mysql -u root mythconverg
mysql> create user "mythtv"@"192.168.1.%" identified by "mythtv";
mysql> grant all on mythconverg.* to mythtv@"192.168.1.%";
mysql> flush privileges;
Then I looked at mythtv setup, and the primary IP address was 127.0.0.1. I changed it to the Ethernet address and then it connected!
User avatar
pgbennett
Developer
Posts: 565
Joined: Mon Apr 27, 2015 5:41 pm
United States of America

Re: [Solved] Android Client not connecting

Post by pgbennett »

Did you set bind-address in the backend mariadb?

Out-of-the-box, MySQL only allows connections from the localhost identified by the IP Address of 127.0.0.1. We need to remove that restriction, so find the line that says
bind-address = 127.0.0.1
and comment it out.
With MariaDB it needs to be set as
bind-address = ::
or
bind-address = 0.0.0.0

in /etc/mysql/mariadb.conf.d/50-server.cnf for mariadb, /etc/mysql/mysql.conf.d/mysqld.cnf for mysql
klugja
Junior
Posts: 22
Joined: Sun Dec 04, 2016 7:35 pm
United States of America

Re: [Solved] Android Client not connecting

Post by klugja »

Apparently the bind address for mariadb in Arch is already set to 0.0.0.0.

This is what I see mariadb listening according to lsof:
  • mariadbd 1066 mysql 27u IPv4 14038 0t0 TCP *:mysql (LISTEN)
  • mariadbd 1066 mysql 28u IPv6 14039 0t0 TCP *:mysql (LISTEN)
On my system this configuration appears to be:
  • /etc/my.cnf.d/server.cnf
This line is commented out:
  • #bind-address=0.0.0.0
I suspect that is the default.

I have arch Linux and mariadb 11.6.2

The only change to mariadb I made was what is documented here for access only within a subnet:
https://www.mythtv.org/wiki/Database_Setup
Post Reply