Fast clock for model railways running on Python Twisted
  • HTML 38.3%
  • JavaScript 27.5%
  • Python 19.5%
  • CSS 13.9%
  • Shell 0.8%
Find a file
2022-11-29 23:51:35 +00:00
.crossbar Correct formatting. 2022-11-29 21:50:32 +00:00
web Add settings to home screen. Improve text display. 2022-11-29 23:51:35 +00:00
.gitignore Ignore the venv directory. 2022-11-29 21:48:00 +00:00
cb_publish.py Copyright statements. 2021-03-19 23:05:00 +00:00
freizeit.service Add multi-user target to freizeit.service unit. This enables it to start on boot. 2021-03-08 23:28:11 +00:00
freizeit.sh Use Crossbar from Python package. 2022-11-29 21:51:04 +00:00
install_python.txt Merge remote-tracking branch 'freizeit_202211/master' 2022-11-29 23:26:27 +00:00
README Merge remote-tracking branch 'freizeit_202211/master' 2022-11-29 23:26:27 +00:00
requirements.txt Update instructions for Python 3.7 2022-11-29 21:49:12 +00:00

FREiZeit is a non-real-time network clock and display using HTTP and WebSockets.

Copyright Ben Weiner 2019--

This document gives outline info on the components.

It also includes instructions on how to install FREiZeit as a Systemd service on Debian variants, eg Raspbian and Ubuntu. Tested on Raspberry Pi OS.

Last modification 2021-07-18


Dependencies
============

sudo apt-get install python3.7
sudo apt-get install python3.7-venv
python3.7 -m venv /usr/share/freizeit/venv
source /usr/share/freizeit/venv/bin/activate

python3.7 -m pip install -r /usr/share/freizeit/requirements.txt
(See install_python.txt for earlier notes)

Dependencies
============

Developed under Ubuntu, version 18.04
Python 3 (3.7 recommended)
Python Virtual Environment
Crossbar

See install_python.txt for more details.



Crossbar config
===============

By convention in .crossbar/config

For access from other hosts, open server firewall on the appropriate port.



WAMP components
===============

Static web service
https://crossbar.io/docs/Static-Web-Service/

Pubsub server

JS



Starting manually
=================

cd . (this directory)
crossbar start
python cb_publish.py

There is also a script, freizeit.sh, used by the Systemd service (below). This should also run in the foreground.



Installing as Systemd service
=============================


1. Symlink the freizeit directory:

cd /usr/share
sudo ln -s <path-to-freizeit-directory> freizeit


2.  Symlink the Systemd service unit:

cd /etc/systemd/system
sudo ln -s /usr/share/freizeit/freizeit.service 


3. Install the systemd service unit:

sudo systemctl enable freizeit.service


4. Start the systemd service:

sudo systemctl start freizeit


5. Stop the systemd service:

sudo systemctl stop freizeit


The interface should now be accessible from the URL http://<server-ip>:8080

If a web server is already running on port 8080 then you will need to stop it or change the port that FREiZeit binds to. See below.



Port
====

The port is set to 8080. This is un unprivileged port, ideal for experimentation and development. If you run the systemd service you can change this to 80, which is a protected port only accessible to processes owned by root.

Change the value:
* in .crossbar/config.json, in the web transport:

    "type": "web",
    "endpoint": {
        "type": "tcp",
        "port": 8080
    },

* in cb_publish.py:
    port = "8080"