-
Notifications
You must be signed in to change notification settings - Fork 11
SW_AutoStart
When your piTelex is finally configured to your needs and everything is working fine, you might want to start pitelex.service automagically at boot time.
(recommended; tested on buster, bullseye and bookworm):
This method installs pitelex as a system service that can be managed with systemctl
like any other system service like e.g. cups or samba. Furthermore it provides the possibility to hook up to a running piTelex session using byobu
for debugging purposes or just to use piTelex' console screen
. The installation part is somewhat more complex than with the other methods (see below), but the usability is more convenient with systemd
. Here we go:
-
Make sure byobu and screen are installed:
$ sudo apt install screen byobu
-
Look for a subdirectory
systemd
in the piTelex tree. Change to this directory and check the contents of the service filepitelex.service
. Ths is a text file which contains some definitions for the service. For a standard Raspberry Pi OS installation, the defaults should be OK. If necessary use a text editor of your choice to editpitelex.service
to ONLY configure in section[Service]
the defintions:User=pi Group=pi WorkingDirectory=/home/pi/piTelex/
-
Install the service file:
$ sudo cp pitelex.service /lib/systemd/system/
-
Enable the piTelex service to be started on boot:
$ sudo systemctl enable pitelex.service
-
Start piTelex service now (or reboot the system to start the service at boot time):
$ sudo systemctl daemon-reload && sudo systemctl start pitelex.service
-
Test if the service is running:
-
$ systemctl status pitelex.service
should list piTelex as active (running). -
$ byobu-screen -list
should show the piTelex session as detached.Note:
The suspicious can furthermore check if piTelex is running as follows:$ ps x | grep telex
should give you something like
400 ? Ss 16:01 SCREEN -T screen -c /usr/share/byobu/profiles/byoburc -d -m -S piTelex /home/pi/piTelex/telex.py 401 pts/0 Ssl+ 3658:15 /usr/bin/python3 /home/pi/piTelex/telex.py
-
If everything is fine, piTelex is now running transparently in the background.
You can now start, restart and stop piTelex using systemd service commands:
$ sudo systemctl [start|stop|restart|status] pitelex.service
To connect to your running piTelex service, call byobu from the commandline:
$ byobu-screen
This will connect you to the screen
of piTelex just as if you had started it from commandline.
You can detach from the session using F6
. This returns you to the shell, but piTelex will continue to run.
Tip
Inside byobu, piTelex can also be terminated using CTRL-C
, CTRL-C
or <ESC>
exit<Enter>
. The byobu session will also quit. systemd will restart everything after 10 s.
-
rc.local:
- Edit
telex.json
: disable modulescreen
to avoid I/O problems
-
Edit
/etc/rc.local
as superuser with e.g.sudo nano /etc/rc.local
-
Before
exit 0
at end insert the linecd /home/pi/piTelex && sudo -u pi ./telex.py 2>&1 &
-
reboot the system:
sudo shutdown -r now
-
Check if piTelex is running:
ps ax | grep telex
should give you something like24189 pts/1 S 0:00 sudo -u pi ./telex.py 24190 pts/1 Sl 0:10 /usr/bin/python3 ./telex.py
- Edit
-
crontab:
- Edit
telex.json
: disable modulescreen
to avoid I/O problems - Edit the system crontab file as superuser with
sudo crontab -e
- At the bottom add the line
@reboot (cd /home/pi/piTelex && sudo -u pi ./telex.py 2>&1 &)
Note: Depending on your crontab version, the exact syntax may vary; see the corresponding man page
- Reboot the system:
sudo shutdown -r now
- Check if piTelex is running: (see above)
- Edit
Important
Values for paths and usernames are correct for standard installations under RaspBerry Pi OS and user pi and must be adapted for non-standard installations.
Consider using release packages for software installation: https://github.com/fablab-wue/piTelex/releases
-
Local use
-
i-Telex
-
Advanced Topics
-
Tools & Gadgets
-
TW39 (current loop)
-
ED1000 (FSK modulation)
-
V.10 (TeKaDe FS200, FS220)
-
SEU-M-board based
- with Austrian AGT (Ö-AGT, current loop)
- as replacement for SEU-B card inside LO2000, LO2001, LO3000