Fast clock for model railways running on Python Twisted
- HTML 38.3%
- JavaScript 27.5%
- Python 19.5%
- CSS 13.9%
- Shell 0.8%
| .crossbar | ||
| web | ||
| .gitignore | ||
| cb_publish.py | ||
| freizeit.service | ||
| freizeit.sh | ||
| install_python.txt | ||
| README | ||
| requirements.txt | ||
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"