shane-mason / FieldStation42
- воскресенье, 11 мая 2025 г. в 00:00:02
Broadcast TV simulator
Cable and broadcast TV simulator intended to provide an authentic experience of watching OTA television with the following goals:
This is a fairly new project and in active development - installation requires some background in the following:
For a complete, step-by-step guide to setting up and administering FieldStation42 software, check out the FieldStation42 Guide
confs/examples
into confs/
python3 station_42.py
on the command line
--rebuild_catalog
option if content has changedfield_player.py
on the command linefs42/hot_start.sh
on the command lineThe quickstart above is only designed to provide an overview of the required steps - use the FieldStation42 Guide for more detailed description of the steps.
FieldStation42 has multiple components that work together to recreate that old-school TV nostalgia.
Use this to create catalogs and generate schedules. Catalogs are used to store metadata about the stations content, so they need to be rebuilt each time the content changes. Since it is inspecting files on disk, this can take some time depending on the number of videos in your content library. The liquid-scheduler uses the catalogs and the stations configuration to build schedules, so catalogs should be built first. Running station_42.py
with no arguments will start a UI that runs in the terminal. You can use this to manage catalogs and schedules, or you can perform all operations using command line arguments with no UI. To see the list of all options, run station_42.py --help
.
This is the main TV interface. On startup, it will read the schedule and open the correct video file and skip to the correct position based on the current time. It will re-perform this step each time the channel is changed. If you tune back to a previous channel, it will pick up the current time and start playing as though it had been playing the whole time.
The player monitors the plain text file runtime/channel.socket
for commands to change the channel and will change to the next station configured in main_config
in confs/fieldStation42_conf.py
if any content is found there - or you can use the following command to cause the player to change to channel 3:
echo {\"command\": \"direct\", \"channel\": 3} > runtime/channel.socket
You can also open runtime/channel.socket
in a text editor and enter the following json snippet (change 3 to whatever number you want to change to)
{"command": "direct", "channel": 3}
The following command will cause the player to tune up or down respectively
{"command": "up", "channel": -1}
{"command": "down", "channel": -1}
The player writes its status and current channel to runtime/play_status.socket
- this can be monitored by an external program if needed. See this page for more information on intgrating with channel.socket
and play_status.socket
.
This is provided as an example component to show how to connect an external device or program to invoke a channel changes and pass status information. This script listens for incoming commands on the pi's UART connection and then writes channel change commands to runtime/channel.socket
This file is for use on a running system that has been configured and testing, because it swallows output so you'll never know what's going wrong. This file is intended to be used to start the player running on system boot up.
The Raspberry Pi has an HDMI output, but if you want to connect it to a vintage TV, you will need to convert that to an input signal your TV can understand. If your TV has composite or RF, you can use an HTMI->Composit or HDMI->RF adapter. These units are available online or at an electronics retailer.
Since the player can recieve external commands and publishes its status as described above, its easy to connect external devices of all kinds. See this wiki page for more information on intgrating with channel.socket
and play_status.socket
. For a detailed guide on setting up a bluetooth remote control, see this page in the discussion boards.
This is only required if you are building the channel change detector component (not required).
aerial_listener.py
to code.py
on the device so that it starts at boot.The fritzing diagram shows how to connect the components together to enable channel changes.