VM LiveView Lite for rFactor & rFactor2

Discussion in 'Plugins' started by Frank Geyer, Feb 20, 2012.

  1. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    40
    Frank, I love the work you have done here! I love the track map and the marquee. I also like that you have support for multi class racing. This is something many timing systems forget about. I developed a very similar system for a league I race with. It consists of a plugin that outputs data to an XML file which is updated every 1000ms which is then served up via Apache. I then wrote a timing page that is also served up via Apache (same server as the XML output) which has java script that loads the XML file every 1.5secs and renders the page. So the timing comes directly from the XML and is all client side rather then server side with data loaded from the database. I then have another server running a windows service that reads the XML data every 2secs and then logs it to a MSSQL DB and then every 5mins it generates a static HTML with all the hotlaps.

    I am having one problem that maybe you can offer some hints on. My plugin seams to be having problems with file locking. The webserver seams to put a file lock on the XML file and then my plugin can no longer update the XML file. If I stop Apache the plugin starts writing the XML again. Then I start Apache back up and it stops updating again. What is strange is the server can run for a week before it runs into this locking problem. Once it runs into this locking problem, the only way to fix it is to restart the dedicated server.

    Have you run into any locking problems with your plugin? I need to look at your suggested Apache Conf file to see if there is anything in there that I could apply to our server to help with locking.
     
  2. Frank Geyer

    Frank Geyer Registered

    Joined:
    Oct 5, 2010
    Messages:
    222
    Likes Received:
    3
    Hi Panda,

    driver swaps was one of the main objectives and thorough testing was done with this live timing suited for long distance racing. So just give it a try. If you find some misalignments, just let me know. But currently I am out of time for further development.

    Cheers
    Frank
     
  3. Frank Geyer

    Frank Geyer Registered

    Joined:
    Oct 5, 2010
    Messages:
    222
    Likes Received:
    3
    Hi Noel,

    thank you for the flowers :) !!!

    So far I never had a file lock on the XML file generated by the rFactor plugin in either way (http or ftp or direct file access). In general I stick to the basic apache and php configurations for a productive environment without doing anything wild in there. I am using the x86 apache build from http://www.apachelounge.com/ and the thread safe VC9 build for php. I also just let the plugin do its work without any time cycle implementation (what is it - 2 times per second as described by the ISI guys within a note of the source code ...).

    It is hard to tell from the distance what might be the occasional file lock problem in your app :( ... maybe it is hidden in the client side java scripting accessing the XML file? Did you try a server side approach of accessing the XML for that purpose?

    Cheers
    Frank

    PS: I can sent you my apache and php config files via PM if you like ...
     
  4. Pandamasque

    Pandamasque Registered

    Joined:
    Oct 5, 2010
    Messages:
    160
    Likes Received:
    2
    Thanks! I will.
     
  5. Luc Devin

    Luc Devin Registered

    Joined:
    Jan 16, 2012
    Messages:
    1,133
    Likes Received:
    23
    Hi Frank
    II do not Understand why I have a blank page as my tables are filled.
    I have no error in the source document.
    You have an idea if I'm listening to you.
    Thank you.
     
  6. Frank Geyer

    Frank Geyer Registered

    Joined:
    Oct 5, 2010
    Messages:
    222
    Likes Received:
    3
    Hi Lucky,

    do you got a link?

    Did you modify the config paramater "$siteURL = "http://dns-name-or-ip-address/vmliveview";" to meet your site?

    Is something written into the log files ("..\vmliveview\logs\.." and/or "..\rFactor Session Loader\Logs\..") !?!?

    Cheers
    Frank
     
  7. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    40
    The plugin I wrote handles driver swaps. It stores the the drivers history along with the lapnumbers that the drivers swapped.

    Here is a snapshot at the finish of a test race that was run this weekend. No one did driver swaps for this short one hour test race though.

    Here is the raw XML (Swaps are stored in <driverHist>):
    http://live.vlms-erl.com:27115/data/results/20120506-finish.xml

    And here is what it would look like when formatted (all client side javascript). To see the driver swaps you just hover your mouse over one of the driver names:
    http://live.vlms-erl.com:27115/?server=results/20120506-finish

    Here is a video archive from the test race (Starts at about 00:05:00):
    http://www.twitch.tv/vlmserl/b/317354110
    Our real race will be this coming Saturday at 11AM (EST) and will last 6 hours.

    You can watch the timing for the real race with this link:
    http://live.vlms-erl.com:27115/

    And a live video feed here (this feed is live anytime someone connects to the server, even practice sessions):
    http://flt.vlms-erl.com/livestream.htm
     
    Last edited by a moderator: May 7, 2012
  8. Luc Devin

    Luc Devin Registered

    Joined:
    Jan 16, 2012
    Messages:
    1,133
    Likes Received:
    23
    Last edited by a moderator: May 8, 2012
  9. Frank Geyer

    Frank Geyer Registered

    Joined:
    Oct 5, 2010
    Messages:
    222
    Likes Received:
    3
    Hi Lucky,

    can you please remove the trailing forward slash "/" within the $siteURL config entry at the end of the value and try again:
    Code:
    <link rel='stylesheet' type='text/css' href='http://www.sim-multi-racing-car.com/[COLOR="#FF0000"]vmliveview2[B]//[/B]styles.css[/COLOR]'>
    If this doesn't do the trick the log files might be helpful. Please also check the apache log files for errors - thanx !!!

    Cheers
    Frank
     
  10. Luc Devin

    Luc Devin Registered

    Joined:
    Jan 16, 2012
    Messages:
    1,133
    Likes Received:
    23
    hi Frank
    You think it can come from this bar?
    Upon my return from work I check this


    Thank
     
  11. Frank Geyer

    Frank Geyer Registered

    Joined:
    Oct 5, 2010
    Messages:
    222
    Likes Received:
    3
    Hi Lucky,

    it might be caused by the general double forward slash "//" in each URL due to a trailing forward slash in the config value of "$siteURL" ... !?!?

    Cheers
    Frank
     
  12. Luc Devin

    Luc Devin Registered

    Joined:
    Jan 16, 2012
    Messages:
    1,133
    Likes Received:
    23
    Hi Frank
    Back home I will change it

    Cheers
    Thank
     
  13. Luc Devin

    Luc Devin Registered

    Joined:
    Jan 16, 2012
    Messages:
    1,133
    Likes Received:
    23
    I have a suggestion on the data display.
    Sessions in the table it would be nice if the mod will then retrieve this mod is to display only the current one and not all mods hotlap table.
    This is the only fault I find your work is remarkable.
    "If I remember right the log tells me that the charset is not valid"
    Cheers
    Thank Frank
     
    Last edited by a moderator: May 8, 2012
  14. xoa

    xoa Registered

    Joined:
    Mar 11, 2011
    Messages:
    44
    Likes Received:
    0
    Frank when we can expect the new version? :)
     
  15. Luc Devin

    Luc Devin Registered

    Joined:
    Jan 16, 2012
    Messages:
    1,133
    Likes Received:
    23
    Hi Frank
    Logs php_error->
    Logs request ->
    Always displays the same error as the "slash" is no longer in $ URL

    Cheers
    Frank
     
    Last edited by a moderator: May 8, 2012
  16. Frank Geyer

    Frank Geyer Registered

    Joined:
    Oct 5, 2010
    Messages:
    222
    Likes Received:
    3
    Hi xoa,

    unfortunately I am currently out of time for further development. The only thing I can offer is the current developer version as it is WITHOUT any official support.

    Please see 1st post for a download link.

    Hope you understand this ... !?!?

    Cheers
    Frank
     
  17. Frank Geyer

    Frank Geyer Registered

    Joined:
    Oct 5, 2010
    Messages:
    222
    Likes Received:
    3
    Hi Lucky,

    I really don't know what is causing the malfunction on your site.

    How is your infrastructure setup? All on one server? Split between rFactor DS and Live-Timing APM? What kind of APM incl. version numbers are you using on your site?

    Please send me all your logs (php-logs, rFactorSL-logs and if possible the apache and mysql logs) including the configuration files in.config.php and rFactorSL.exe.xml compressed in a .zip file for further troubleshooting ...

    Cheers
    Frank
     
  18. xoa

    xoa Registered

    Joined:
    Mar 11, 2011
    Messages:
    44
    Likes Received:
    0
    Ok, thanks Frank. Yes, I can understand this :)
     
  19. Luc Devin

    Luc Devin Registered

    Joined:
    Jan 16, 2012
    Messages:
    1,133
    Likes Received:
    23
    Hi Frank
    The newspaper does not give you anything more than what is written above is exactly that on all lines.
    I just saw that the table is not completed Request and at any time.
    So I think the problem is here.
    Why does she not filled?
    Apache/2.2.6 (Win32) PHP/5.2.5
    Mysql 5.0.45
    PHP 5.2.5


    Thank you for your help Frank
     
    Last edited by a moderator: May 10, 2012
  20. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    40
    Frank, this locking problem I am having is driving me mad. I was originally using a small lightweight opensource webserver for windows called Mongoose which was causing tons of locking problems. Then I switched to Apache which has almost completely solved the locking problems. I also changed the way I am writing the file which also helped.

    When I started the project I was just using the Example plugin from ISI. I just changed there fprintf's to write XML. That caused problems because the clients would randomly pull the XML before it was fully written so the XML would be broken. So then I changed the logic to write to a temp file and then when it was done it would copy the temp file to the main file. This was working well but still causing locks. So then I switched to _fsopen(fileName, "w",_SH_DENYRW);. Now Apache is denied access to the file until I am done with it. But I am still getting a lock from time to time and the only way to get it to unlock is to shut down Apache. But as soon as I start it back up it locks up again. The locking problem is very rare now. I went from locking a few times a day to one lock every few weeks. The only way to fully solve the lock is to restart rF Dedi. So if it locks 2 hours into a 12 hour race it kind of sucks.

    I am a very weak C++ programmer so I am sort of at a loss. Do you have any recommendations? I am amazed you don't have locking problems with your setup. I poll my XML file over HTTP from a remote location every 2secs for logging hotlaps. The live timing page is client side and pulls the XML file every 1.5secs. So if you have 50 people all pulling the XML every 1.5secs you are bound to hit a lock. I must be doing something wrong somewhere.
     

Share This Page