Guide to install a MySQL DB server on the AFTV. This setup has been working great to share my Kodi DB between several devices. It may also work for other Android devices, but I haven't tested them. Based on the description found in http://www.thaivisa.com/forum/topic/8093...etv-boxes/
Disclaimer: I have no association with KSWEB. I only purchased their package to make the installation easier.
My setup was done using a rooted AFTV (2nd gen) running v5.2.1.0 (Build 550145120), and Jarvis (SPMC 16.4.2).
Prerequisites:
Disclaimer: I have no association with KSWEB. I only purchased their package to make the installation easier.
My setup was done using a rooted AFTV (2nd gen) running v5.2.1.0 (Build 550145120), and Jarvis (SPMC 16.4.2).
Prerequisites:
- Ensure the AFTV has a fixed IP. You'll need to the IP address, device id (Settings->System->About).
- You'll also need a mouse and a keyboard, ideally connected to the AFTV via a USB hub
- Export your Kodi library if you want to import this in MySQL later on (using the Settings menu in Kodi), see also http://kodi.wiki/view/Import-export_library. Export to multiple files, no need to export the artwork.
- Root access is not required
- Download the apk of the KSWEB server suite for sideloading from http://kslabs.ru/ I used v3.62
- Buy a KSWEB serial key (US$2.99). You'll get an email with the key linked to a Play store account. Then send your device id to them and ask them to link your key to the device.
- Sideload the KSWEB apk using adblink
- Start KSWEB and enter the license key in the GUI (you'll need to attach a mouse / keyboard to navigate / enter this)
- Select Auto Start in the Settings menu to automatically start KSWEB after a reboot. Check that the mysqld is running using an adb shell and commands 'ps | grep mysql', or 'netstat -an | grep 3306'. You should see a process that LISTENs on port 3306
- Replace the my.ini MySQL config file in /data/data/ru.kslabs.ksweb/components/mysql/conf with the attached file:
my.zip (Size: 810 bytes / Downloads: 0)
I did this using an adb shell ('cat > my.ini' <PASTE> ^D), but you can easily upload the file using adblink. Restart MySQL
- Make sure the lighttpd and PHP services are up and running. Install PHPMyAdmin from the KSWEB Tools menu.
- Open PHPMyAdmin on your favorite device in your favorite browser using the IP of your AFTV and the port shown in the Status page of KSWEB (e.g. http://192.168.1.200:8002). Login: root/<none>. You should change this password using PHPMyAdmin
- Once in PHPMyAdmin -> Users tab, Add user.. Choose username (kodi) pass (kodi) and leave it it for 'any host' access. Do not check to create a database, this will be done by Kodi later. In the same dialogue, make sure user kodi is granted access rights to Create databases
- In Kodi, go to Settings->Services->MySQL and enter the AFTV IP, username (kodi) and password (kodi). Then select Enable to use MySQL.
- If your sources contain SMB shares, ensure these are linked via IP and not WINS name (e.g. smb://192.168.1.100/myshare/movies). If they are not, correct this. Then rescan your sources. Kodi will import previously exported data.
- Repeat the last two steps to link other Kodi installations to the MySQL database. No need to rescan sources, unless they use different sources.
- Optional: If Kodi starts up automatically upon boot (this probably requires root), you can have it wait for the MySQL DB server to be ready. (see also http://kodi.wiki/view/Wake_on_lan)
- Enable wake-on-lan under Settings → System → Power saving → Try to wake remote servers on access
- Replace the content of the wakeonlan.xml file that is stored in the userdata folder of Kodi with the below content. Make sure to replace YOUR IP and YOUR MAC with the correct values:
<onaccesswakeup>
<netinittimeout>20</netinittimeout>
<netsettletime>500</netsettletime>
<wakeup>
<host>YOUR IP</host>
<mac>YOUR MAC</mac>
<pingport>3306</pingport>
<pingmode>1</pingmode>
<timeout>300</timeout>
<waitonline>40</waitonline>
<waitonline2>40</waitonline2>
<waitservices>5</waitservices>
</wakeup>
</onaccesswakeup>
- Enable wake-on-lan under Settings → System → Power saving → Try to wake remote servers on access
- Optional: You may want to change the lighttpd password (defaults to admin/admin). This is listening on a port as per Status page of KSWEB, likely port 8001.
- Optional: Once all is working to your satisfaction, you can disable lighttpd and PHP in the KSWEB console and also select to start KSWEB minimized (see Settings).