No announcement yet.

FSD server improvements & fixes collection

This is a sticky topic.
  • Filter
  • Time
  • Show
Clear All
new posts

  • FSD server improvements & fixes collection

    The "3 hours metar lag" improvement
    When FSD was first designed www lines were slow and NOAA needed time to receive METAR data from all the stations in the world. So they (SATCO programmers) decided to download a "world weather picture" file that was 3 hours old; to be sure that everything was in.
    Now lines speed is changed, and the great part of the observed weather data goes into the METAR file in a few minutes.

    The changes below, to FSD for windows code, allow to download the most recent weather (metars) file:

    Module: mm.cpp
    Old line 323: sprintf(data,"RETR %02dZ.TXT\n",(tp->tm_hour+21)%24);
    Modify to: sprintf(data,"RETR %02dZ.TXT\n", tp->tm_hour);
    The above is for the commonly used PASSIVE ftp download

    In case your server doesn't work using PASSIVE mode:
    Old line 256: ftpemail, metardir, port, (tp->tm_hour+21)%24);
    Modify to: ftpemail, metardir, port, tp->tm_hour);
    In both cases, two lines later (325 or 258) you can improve your FSD logfile by writing which file has been downloaded!
    Old:   dolog(L_INFO,"METAR: Starting download of METAR data");
    New: dolog(L_INFO,"METAR: Starting download of %02dZ METAR data", tp->tm_hour);
    The above makes FSD server to download weather data 10 minutes after data have been first released (i.e. the 15Z.txt file at 15:10Z)
    It could happen that the file your server downloaded has too many missing data stations and your pilots and controllers don't find the metars they need.
    Also, if the downloaded file is less then 100 KBytes it is dropped by FSD sever because there are too many missing stations for sure (a complete file will contain more then 1500 KBytes)
    You can decide to wait a little bit more than 10 minutes before downloading a hourly file. In this case modify line 110
    Old: if ((p->tm_min==10&&elapsed>60)||(elapsed>3600)||prevdownload==0)
    New: if ((p->tm_min==NN&&elapsed>60)||(elapsed>3600)||prevdownload==0)
    where NN (was 10) are the minutes after the exact hour to start downloading.

    Recompile your FSD executable and test.

    The Unix module should't be too different!

    cheers and Happy Easter
    Last edited by GianP; 03-30-2013, 05:00 PM.