Moderator Control Panel ]

Openelec for MatrixTBS

Re: Openelec for MatrixTBS

Postby PeterB » Tue Oct 21, 2014 10:48 pm

vpeter Wrote:PeterB, I install matrixtv on a eMMC. It boots fine.


Yes, this worked on my second attempt. Not sure what went wrong first time! :oops:
PeterB
 
Posts: 52
Joined: Thu Apr 10, 2014 11:17 am

Re: Openelec for MatrixTBS

Postby PeterB » Tue Oct 21, 2014 11:29 pm

PeterB Wrote:I now have OpenELEC booting from emmc (internal flash), with no SD card installed - all achieved on a base Matrix v1.3 running MatrixTV, using only SD card and network connection, from a Linux host without use of any serial console or programming cable.

I have already documented the first two stages - installing the OE 'universal' boot and then creating a bootable OE SD card.

I will document the final step in a little while.


Before I document this, I want to overcome one slight oddity.

When I'm booted from emmc, something odd is happening with advancedsettings.xml and specification of an sql server:

With this:
Code: Select All Code
<?xml version="1.0" encoding="UTF-8"?>
<!-- Pete's modified version -->
<advancedsettings>
  <videodatabase>
    <type>mysql</type>
    <host>10.2.0.100</host>
    <port>3306</port>
    <user>xbmc</user>
    <pass>xbmc</pass>
  </videodatabase>
</advancedsettings>

in my advancedsettings.xml, my Movies source doesn't appear on the Home screen.

If I reduce the file to this:
Code: Select All Code
<?xml version="1.0" encoding="UTF-8"?>
<!-- Pete's modified version -->
<advancedsettings>
</advancedsettings>

it all works okay, using the internal database (but not fully populated - I wonder whether this might be relevant?).

I would conclude that this is a problem with my sql server/database, except that it all works perfectly when booted from SD card (same files in /System, same files in /Storage).

I have spent several hours on this, getting very confused. I don't know where to look for clues as to what is going wrong. The most confusing is that sometimes the emmc-booted system works - usually on the first reboot after making an amendment to advancedsettings.xml and/or sources.xml.

The symptoms are the same on two v1.3 boxes, so unlikely to be a hardware fault.

Is there anything I should know about using emmc for /storage, as opposed to using SD card for /storage?
PeterB
 
Posts: 52
Joined: Thu Apr 10, 2014 11:17 am

Re: Openelec for MatrixTBS

Postby vpeter » Tue Oct 21, 2014 11:35 pm

PeterB Wrote:something odd is happening with advancedsettings.xml and specification of an sql server:

With this:
Code: Select All Code
<?xml version="1.0" encoding="UTF-8"?>
<!-- Pete's modified version -->
<advancedsettings>
......

in my advancedsettings.xml, my Movies source doesn't appear on the Home screen.
Remove the first line
Code: Select All Code
<?xml version="1.0" encoding="UTF-8"?>
and then it should be ok. You can see if the file is used in xbmc log file /storage/.xbmc/temp/xbmc.log.


Today I got one SD card reader in my hand and I will try to prepare OpenELEC SD card image which would allow to just copy files on SD card. Without partitioning, formating, ... Will let you know how/if I succeed.
You can help me buy new work notebook with paypal donation, after 8 years it's time to upgrade.
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FLVT7ACMYAPS6
vpeter
 
Posts: 427
Joined: Sun Jul 27, 2014 2:12 am
Location: Slovenia

Re: Openelec for MatrixTBS

Postby PeterB » Wed Oct 22, 2014 1:17 am

Thanks for the reply!
vpeter Wrote:
PeterB Wrote:something odd is happening with advancedsettings.xml and specification of an sql server:

With this:
Code: Select All Code
<?xml version="1.0" encoding="UTF-8"?>
<!-- Pete's modified version -->
<advancedsettings>
......

in my advancedsettings.xml, my Movies source doesn't appear on the Home screen.
Remove the first line
Code: Select All Code
<?xml version="1.0" encoding="UTF-8"?>
and then it should be ok. You can see if the file is used in xbmc log file /storage/.xbmc/temp/xbmc.log.


I removed that line (which has been present ever since I started running OE), but it made no difference.

I have compared the logfiles for both instances - one booted from emmc and one booted from sd card. For the life of me, I cannot see any significant difference between the two logs, until the emmc version gets down to:
Code: Select All Code
08:00:11 T:1985503776   ERROR: Unable to open database: MyVideos78 [2003](Can't connect to MySQL server on '10.2.0.100' (101))
08:00:11 T:1985503776   ERROR: Unable to open database: MyVideos77 [2003](Can't connect to MySQL server on '10.2.0.100' (101))
08:00:11 T:1985503776   ERROR: Unable to open database: MyVideos76 [2003](Can't connect to MySQL server on '10.2.0.100' (101))
08:00:11 T:1985503776   ERROR: Unable to open database: MyVideos75 [2003](Can't connect to MySQL server on '10.2.0.100' (101))
08:00:11 T:1985503776   ERROR: Unable to open database: MyVideos74 [2003](Can't connect to MySQL server on '10.2.0.100' (101))
08:00:11 T:1985503776   ERROR: Unable to open database: MyVideos73 [2003](Can't connect to MySQL server on '10.2.0.100' (101))
08:00:11 T:1985503776   ERROR: Unable to open database: MyVideos72 [2003](Can't connect to MySQL server on '10.2.0.100' (101))
08:00:11 T:1985503776   ERROR: Unable to open database: MyVideos71 [2003](Can't connect to MySQL server on '10.2.0.100' (101))
08:00:11 T:1985503776   ERROR: Unable to open database: MyVideos70 [2003](Can't connect to MySQL server on '10.2.0.100' (101))
08:00:11 T:1985503776   ERROR: Unable to open database: MyVideos69 [2003](Can't connect to MySQL server on '10.2.0.100' (101))
08:00:11 T:1985503776   ERROR: Unable to open database: MyVideos68 [2003](Can't connect to MySQL server on '10.2.0.100' (101))
08:00:11 T:1985503776   ERROR: Unable to open database: MyVideos67 [2003](Can't connect to MySQL server on '10.2.0.100' (101))
08:00:11 T:1985503776   ERROR: Unable to open database: MyVideos66 [2003](Can't connect to MySQL server on '10.2.0.100' (101))
08:00:11 T:1985503776   ERROR: Unable to open database: MyVideos65 [2003](Can't connect to MySQL server on '10.2.0.100' (101))
08:00:11 T:1985503776   ERROR: Unable to open database: MyVideos64 [2003](Can't connect to MySQL server on '10.2.0.100' (101))
08:00:11 T:1985503776   ERROR: Unable to open database: MyVideos63 [2003](Can't connect to MySQL server on '10.2.0.100' (101))
08:00:11 T:1985503776   ERROR: Unable to open database: MyVideos62 [2003](Can't connect to MySQL server on '10.2.0.100' (101))
08:00:11 T:1985503776   ERROR: Unable to open database: MyVideos61 [2003](Can't connect to MySQL server on '10.2.0.100' (101))
08:00:11 T:1985503776   ERROR: Unable to open database: MyVideos60 [2003](Can't connect to MySQL server on '10.2.0.100' (101))
08:00:11 T:1985503776   ERROR: Unable to open database: MyVideos78 [2003](Can't connect to MySQL server on '10.2.0.100' (101))
08:00:11 T:1985503776   ERROR: Unable to create new database


At the same point, the sd card version simply reports:
Code: Select All Code
00:28:10 T:1985413664  NOTICE: Running database version MyVideos78


I think that I must be missing something obvious ... but what???? :?

One thought crosses my mind, but it may be totally irrelevant - everytime I switch between booting from emmc and booting from sd card, I have to clear out the old entry from my ssh known_hosts file. Could access to the sql database server be sensitive to ssh keys? If it was, though, how does that work for multiple clients?


Today I got one SD card reader in my hand and I will try to prepare OpenELEC SD card image which would allow to just copy files on SD card. Without partitioning, formating, ... Will let you know how/if I succeed.


Okay, sounds good.
PeterB
 
Posts: 52
Joined: Thu Apr 10, 2014 11:17 am

Re: Openelec for MatrixTBS

Postby vpeter » Wed Oct 22, 2014 3:13 am

Creating SD card the easy way using SD card image

For this we need program Win32 Disk Imager which is a tool for writing images to USB sticks or SD/CF cards
http://sourceforge.net/projects/win32di ... s/Archive/

Then we need blank SD card disk image
OpenELEC-iMX6.arm.img.gz: https://drive.bitcasa.com/send/W7RdopSd ... CtQXQ3f-vr

To make usable SD card we need
- unpack file OpenELEC-iMX6.arm.img.gz
- write image file OpenELEC-iMX6.arm.img to SD card with program Win32 Disk Imager
- after writing is finished eject and attach SD card back
- replace files KERNEL, SYSTEM, imx6q-tbs2910.dtb, u-boot.imx, uEnv.txt copied from .tar archive OpenELEC-iMX6.arm-devel-*.tar
file u-boot-matrix.imx must be renamed to u-boot.imx
file uEnv-matrix.txt must be renamed to uEnv.txt
- eject SD card and put it in Matrix
- boot Matrix and enjoy

Could be that I miss something ...


PeterB, problem with known_hosts is a little strange. Only on first run the keys are created and then not any more.
Not sure about mysql problems. Seems xbmc can't connect to mysql server? Try to select "Wait for network" somewhere under OpenELEC settings.
Last edited by vpeter on Sat Dec 20, 2014 3:11 am, edited 2 times in total.
You can help me buy new work notebook with paypal donation, after 8 years it's time to upgrade.
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FLVT7ACMYAPS6
vpeter
 
Posts: 427
Joined: Sun Jul 27, 2014 2:12 am
Location: Slovenia

Re: Openelec for MatrixTBS

Postby PeterB » Wed Oct 22, 2014 8:51 am

vpeter Wrote:PeterB, problem with known_hosts is a little strange. Only on first run the keys are created and then not any more.


It appears that the image on SD card has different keys to the image on emmc. This means that everytime I swap between emmc and sd boot I have to clear the old entry from known_hosts before I can ssh in. Where are the keys held in OE/XBMC?

Not sure about mysql problems. Seems xbmc can't connect to mysql server? Try to select "Wait for network" somewhere under OpenELEC settings.


Yes, clearly OpenELEC/XBMC is failing to connect to the sql server. However, I am unsure whether this is due to network failure, sql client failure or rejection by the server. I cannot see anything obvious in the server logs.

I already had the "Wait for network" enabled, with the default maximum wait of 10 seconds. I extended this to 100 seconds, but there is no change in behaviour. It is clear that the network comes up relatively quickly - the correct time is already fetched from my ntp server when the Home page is displayed. If I knew how to force the same key to be used for both emmc and sd card boot, that would eliminate one possible problem. Apart from timing difference and key difference, I cannot think what should change between the two boot scenarios.

I keep staring at the two XBMC logs, but still cannot find any clue to the difference in behaviour.
PeterB
 
Posts: 52
Joined: Thu Apr 10, 2014 11:17 am

Re: Openelec for MatrixTBS

Postby PeterB » Wed Oct 22, 2014 12:38 pm

PeterB Wrote:Where are the keys held in OE/XBMC?


Okay, I think I've found them - in /storage/.cache/ssh. I've copied the contents of this folder from SD to emmc and now I don't have to hack my known_hosts file when I change between SD boot and emmc boot.

However, this has done nothing to resolve the sql server access problem.

Have you been able to access a sql server when running OE from emmc?

Is there any further logging available relating to database access?

I'm really, really, baffled as to why the same software and same configuration should behave differently depending on which device it's booted from. The fact that several db open attempts are all failed within one second suggests that it's not a network timeout situation, so either the network interface is not working, or the server is rejecting the attempts.

I even tried deleting the configuration and starting from scratch/new installation. This also failed to access the sql server.
PeterB
 
Posts: 52
Joined: Thu Apr 10, 2014 11:17 am

Re: Openelec for MatrixTBS

Postby vpeter » Wed Oct 22, 2014 2:29 pm

PeterB Wrote:I'm really, really, baffled as to why the same software and same configuration should behave differently depending on which device it's booted from.
I don't think this has any role. There must be something else.
And I don't use sql server. So little clueless here.

You can try to restart xbmc after you have network. Like when you can see addons from openelec repository. You restart xbmc by command
Code: Select All Code
systemctl restart xbmc
If network is the issue then now it should connect.
Maybe you should also check some logs on sql server. And try to enable debug option in xbmc. Then you will have much more info in xbmc.log.
You can help me buy new work notebook with paypal donation, after 8 years it's time to upgrade.
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FLVT7ACMYAPS6
vpeter
 
Posts: 427
Joined: Sun Jul 27, 2014 2:12 am
Location: Slovenia

Re: Openelec for MatrixTBS

Postby PeterB » Wed Oct 22, 2014 6:29 pm

vpeter Wrote:You can try to restart xbmc after you have network. Like when you can see addons from openelec repository. You restart xbmc by command
Code: Select All Code
systemctl restart xbmc
If network is the issue then now it should connect.


Ooo ... OE uses systemd :) I hadn't poked around enought to investigate/discover!

Okay - really great news - restarting xbmc brings the system up fully functional! :)

What can we conclude from this?
1) The system starts up more quickly from emmc than it does from sd card (or the network starts up more slowly).
2) The wait for network option must be invoked after the database is opened

I'm sure that I won't be the only person to encounter a problem with this, so what can be done about the problem?
1) Re-arrange the code so that the wait for network is performed before any potential network activity
2) Add a delay somewhere - not good ... I hate arbitrary delays because they introduce a race hazard and eventually there will be a situation for which the delay is not long enough.
3) Add 'After=network-online.target/service' to xbmc.service ... but this would upset people who use OE as a stand-alone system
4) Could 'Before=xbmc.service' work if added to network-online.service/target?
5) any other suggestions?

Is there any way that I can resolve the problem temporarily without having to rebuild?
[/quote]
PeterB
 
Posts: 52
Joined: Thu Apr 10, 2014 11:17 am

Re: Openelec for MatrixTBS

Postby vpeter » Wed Oct 22, 2014 7:14 pm

Quick fix to test which should help
Code: Select All Code
echo "sleep 10" >/storage/.config/autostart.sh


Is your sql server always on or does it go to suspend?
You can help me buy new work notebook with paypal donation, after 8 years it's time to upgrade.
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FLVT7ACMYAPS6
vpeter
 
Posts: 427
Joined: Sun Jul 27, 2014 2:12 am
Location: Slovenia

PreviousNext

Return to Announcements

Who is online

Users browsing this forum: No registered users and 17 guests