Skip to content

Main Server Configuration

Shane C Mason edited this page May 29, 2025 · 15 revisions

FieldStation42 exposes a set of configuration value that effect the entire system. This file does not exist by default, instead the system uses a set of defaults that can be overridden by values placed a file named confs/main_config.json

The following shows the default configuration.

{
    "channel_socket" : "runtime/channel.socket",
    "status_socket": "runtime/play_status.socket",
    "day_parts": {
        "morning"  : {"start_hour": 6, "end_hour": 10},
        "daytime"  : {"start_hour": 10, "end_hour": 18},
        "prime"    : {"start_hour": 18, "end_hour": 23},
        "late"     : {"start_hour": 23, "end_hour" : 2},
        "overnight": {"start_hour": 2, "end_hour": 6}
    },
    "date_time_format" : "%Y-%m-%dT%H:%M:%S",
    "time_format" : "%H:%M"
}

You can override one or all of these. For example, the following would only change the default location of the communication text files and leave the rest alone:

{
    "channel_socket" : "/tmp/channel.socket",
    "status_socket": "/tmp/play_status.socket",
}

The following would change time_format to a 12 hour clock:

{
   "time_format" : "%I:%M %p"
}

Day parts are used in scheduling to restrict some content to specific time of day with temporal hints. Neither the names nor the values are fixed. You can add or remove names and change times, but you should make sure to not have overlap between the day-parts or you will get undefined behavior. The following example adds two new parts earlymorning and fringe.

    "day_parts": {
        "earlymorning"  : {"start_hour": 4, "end_hour":  7},
        "morning"  : {"start_hour": 7, "end_hour": 10},
        "daytime"  : {"start_hour": 10, "end_hour": 17},
        "fringe"   : {"start_hour": 17, "end_hour": 20},
        "prime"    : {"start_hour": 20, "end_hour": 23},
        "late"     : {"start_hour": 23, "end_hour" : 2},
        "overnight": {"start_hour": 2, "end_hour": 6}
    },

Clone this wiki locally