开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

experimental dratsrepeater.service Ubuntu

 
Edited

Hi:
Sharing this as it seems to be working for me. Use at you own risk, I am not a developer or programmer.?

Have been able to use instructions below? with 0.4.1 Ubuntu 22.04 (Raspberry PI 4).? The (dratsrepeater.service) code is as follows and is the same I was using with HamPI 2.01?? Which I setup some years ago.? The D-Rats version there was 0.3.9 beta 3.

Where I found the code for dratsrepetaer.service at that time, Frankly I do not remember. Probably from a post of D-Rats developers, Hampi developer, or D-Rats users.? Anyway the code still works with exception of SysVStartPriority=99 --which was removed from systemd. I received a message stating it was removed and was ignored. So I removed from dratsrepeater.service

Remember dratsrepeater.service (or the name you choose) have to be copied into /etc/systemd/system

User, path, python version depends on your settings, obviously.

[Unit]
Description=D-Rats Repeater Proxy
After=syslog.target network.target

[Service]
Type=simple
#Edit the next line to name the user you want the d-rats repeater to run as. The user must exits.
User=dratsrepeater
ExecStart=/usr/bin/python3.11 /home/dratsrepeater/D-Rats/d-rats_repeater.py -C
TimeoutSec=0
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

# systemctl start dratsrepeater
# systemctl status dratsrepeater
# systemctl enable dratsrepeater? {will allow the service to start automatically -- beware!!}??

Well, observations and concerns regarding security are very important.? Not sure which other instruction should be included or changed in dratsrepeater.service.? Hope this will start a constructive discussion that could produce a robust final file.?

73'

Edfel
KP4AJ


Re: How to _manually_ set config path for d-rats_repeater.py use?

 

Hi:
Well this experimental 'hack' seems to do the trick for my specific need.? Will try to learn python and about git and try to find a more generalized solution for others.? For the hack > Edit the file d-rats_repeater.py

xxx/d-rats is the directory you will be placing the repeater.config file. You edit d-rats_repeater.py around? line 1230.??

# CUSTOM PATH Case No Gtk at server
? ? #def_config_dir = platform.config_dir()
? ? import os.path
? ? cpath="/xxx"
? ? def_config_dir = os.path.join(cpath,'d-rats')

Seems to be working. For example I set id to ZZZZZ /xxx/d-rats/repeater.config and it was shown at the repeater log.? Deleted the repeater log and now set id (repeater.config) to KP4AJ and started d-rats_repeater again. repeater.log shows id as KP4AJ.

Please note you need a repeater.config from a working installation. My case I use from a Ubuntu 22.04 laptop.? Please note I am newbie, almost zero knowledge of python, experimenting with a PI 4. So use at your own risk. Still have to look for John point regarding how should run d-rats_repeater.py from non-privileged user.? ?

Also will try to set same directory for the repeater.log which is still at .d-rats-ev.??

73'

Edfel
KP4AJ


Re: How to _manually_ set config path for d-rats_repeater.py use?

 

Hi John:
Thank you for the reply, help, and for your patience.?

73'

Edfel
KP4AJ


Re: How to _manually_ set config path for d-rats_repeater.py use?

 

On 7/31/2023 6:47 PM, Edfel Rivera wrote:
[Edited Message Follows]
Hi:
I have a D-Rats 0.4.1 installation running with Ubuntu 22.04 laptop (Gtk ok).? My goal is to be able to make D-Rats repeater work in a Ubuntu Server (no Gtk).
I had a longer reply written and the Windows 8.1 computer crashed and it was all lost, so now just a summary:

If you are making changes or going into new feature, you need to be using the github work flow in the wiki, or you will be using out of date code and that makes it harder to eventually merge it back in.



Before reporting issues, please check to see if they are known issues, they may be fixed since the release was made.



The daemon issue is known and has been fixed, but since it is just log noise did not merit a new release being made.

The version issue you encountered is known and as you can see was fixed in master. A new release was not made since it only shows up if you use a github tarball instead of one of the two currently documented install methods in the WIKI.

You have not been looking at the proper options for the d-rats repeater code. The "-C OR --console" option as should be displayed with the --help option and is visible in the source says to run with out a GUI.

The d-rats repeater service should definitely not be run as root, it should be run with a dedicated non-privileged account. Setting all that stuff for an end user should be done by a debian / rpm or equivalent package.

73,
-John


Re: FIX setDaemon() is deprecated

 

On 7/31/2023 10:19 AM, Edfel Rivera wrote:
Hi:
Received this message:
/usr/bin/python3.10 /home/dratsrepeater/D-Rats/d-rats_repeater.py -C
/home/dratsrepeater/D-Rats/d-rats_repeater.py:426: DeprecationWarning: setDaemon() is deprecated, set the daemon attribute instead
self.repeat_thread.setDaemon(True)
If you had looked at the ticket queue link that I posted earlier:



And put setDaemon in the filter, it would show that it is both a known issue and it is fixed in the master branch.

A new release was not made as this is a minor console log noise bug.

73,
-John


How to _manually_ set config path for d-rats_repeater.py use?

 
Edited

Hi:
I have a D-Rats 0.4.1 installation running with Ubuntu 22.04 laptop (Gtk ok).? My goal is to be able to make D-Rats repeater work in a Ubuntu Server (no Gtk).

I set a testbed with a PI 4 and fresh install of Ubuntu Server 22.04.? Libraries installed without problem.? I can start d-rats_repeater via sudo /usr/bin/python3.11 /home/dratsrepeater/D-Rats/d-rats_repeater.py -C

So far repeater.log file is created at .d-rats-ev and even maps directory.? As expected when trying the -c CONFIG invocation I get the Gtk coul'nt initialize error.? I tried manually creating the CONFIG dir and cp the repeater.config from the Ubuntu 22.04 Laptop as work around.? Not working

Browsing through files I know d-rats_repeater.py settings can be set a lines 473-484. So call id I can set at that file (not my preference but..)

THE QUESTION is:? Anyway to set the CONFIG directory manually?? I mean bypassing the -c CONFIG (which will not work on systems without Gtk).?

The config.py file? ?have this code gives me hope what I need (hard-set path to repeater.config) could be possible:
?logger.info("sys.path=%s", sys.path)
? ? # mm: fn = "/home/dan/.d-rats/d-rats.config"
? ? filename = "d-rats.config"

Well, hope someone could point to the right direction. Again d-rats_repeater.py get started without errors in Ubuntu 22.04 with no Gtk.? Still very possible some functionality will trigger errors but want to go step by step.?

Thanks in advance!

Edfel
KP4AJ



FIX setDaemon() is deprecated

 

Hi:
Received this message:
/usr/bin/python3.10 /home/dratsrepeater/D-Rats/d-rats_repeater.py -C
/home/dratsrepeater/D-Rats/d-rats_repeater.py:426: DeprecationWarning: setDaemon() is deprecated, set the daemon attribute instead
? self.repeat_thread.setDaemon(True)

Looking at Google got a clue. I replaced as shows below.

Line 426 d-rats_repeater.py?
self.repeat_thread.Daemon=True

Here deprecation warning now gone. Please verify.

73'

Edfel
KP4AJ


Re: Repeater side operation -- GTK 3 - which files require it?

 

On 7/31/2023 8:09 AM, Edfel Rivera wrote:
[Edited Message Follows]
Hi Again:
Looking at d-rats_repeater.py file it have 90 lines that makes
reference to GTK... so wonder if it is possible what I want to do.
Almost anything is possible if you want to take the effort.

It is not hard to learn Python 3. Learning modern python programming conventions also not that hard.

Read through the WIKI and start learning / contributing.



Running repeater without the GTK 3 requirement and which
functionality will be affected.
Possible Future tickets for

1. Separate D-rats modules directories to based on "common", "client", "repeater", "Maps", and "forms.

That will take a bit of work to work out and take a bit of time. I have found duplicate code, apparently unused code, and code that appears to be in the wrong module. (May have already put a similar ticket in, just not remembering right now)

2. D-Rats repeater changed to use HTML / REST for monitoring and configuration.

3. D-Rats repeater service setup for system-d and non-systemd, needs to be able to handle multiple repeaters on a system.

Right now we are very short on programming and testing resources, and there are a number of probably higher priority tickets that I would like to get fixed to before getting to any of those potential tickets.

73,
-John


Re: Repeater side operation -- GTK 3 - which files require it?

 
Edited

Hi Again:
Looking at d-rats_repeater.py file it have 90 lines that makes reference to GTK...? so wonder if it is possible what I want to do.? Running repeater without the GTK 3 requirement and which functionality will be affected.?

Most production Ubuntu servers not include to keep system lean.? If I can make d-rats repeater work without GTK requirement will be my first choice even if it require more work.? I am old school, think could manage without the windows.? Can monitor files from command line with editor or tail commands

Thanks.

Edfel?


Repeater side operation -- GTK 3 - which files require it?

 

Hi:
My understanding is that GTK 3 provides for objects which seems related with D-Rats windows.? When configuring repeater a window named D-Rats Repeater proxy is invoked.? I think a work - around for that (in Ubuntu Server without GTK 3) could be to create and copy the repeater file manually from another pc adjusting for file permissions and ownership as required.??

Now, which D-Rats _repeater required files_ have references or use GTK 3?? Idea is to edit the reference so drats repeater could work in Ubuntu Server environment without GTK 3.??

Thanks in advance.

73'

Edfel
KP4AJ


Re: Repeater config command line Ubuntu

 

Also noted that running:

sudo /usr/bin/python3.10 /home/dratsrepeater/D-Rats/d-rats_repeater.py -c CONFIG

a second time will result in

.d-rats-ev/CONFIG/CONFIG

Not a priority but maybe having some code to detect if CONFIG already exists to prevent the creation of multiple CONFIG directories and repeater.config files.?

73'

Edfel
KP4AJ


Repeater config command line Ubuntu

 

Hi:
Just sharing if can be useful to others.??

from command line:?
sudo /usr/bin/python3.10 /home/dratsrepeater/D-Rats/d-rats_repeater.py -c CONFIG

Now I have at the .d-rats-ev directory a sub directory CONFIG with repeater.config file!? and now call Id shows my callsign.?

BTW I did'nt added device as it seems to be working.??

73'

Edfel
KP4AJ


Repeater Log Ubuntu

 
Edited

Hi:
Just sharing to access repeater log:

cd ~
cd .d-rats-ev

the file is repeater.log

07/31/2023 06:52:33:INFO:RepeaterConsole:add_outgoing_path: Repeater id is W1AW
07/31/2023 06:54:03:INFO:Repeater:accept_new: Accepted new client X.X.X.X:63645
07/31/2023 06:54:06:INFO:Repeater:__repeat: Adding new station KP4AJ-M to port [NET ]
07/31/2023 06:54:06:INFO:Repeater:__repeat: Repeating frame to CQCQCQ on all ports
07/31/2023 06:54:56:INFO:Repeater:__repeat: Repeating frame to CQCQCQ on all ports
07/31/2023 06:59:03:INFO:Repeater:__repeat: Repeating frame to CQCQCQ on all ports
07/31/2023 06:59:03:INFO:Transporter:worker: [NET? closed] Unable to reconnect!
07/31/2023 06:59:05:INFO:Repeater:accept_new: Accepted new client X.X.X.X:51015
07/31/2023 06:59:06:INFO:Repeater:__repeat: Station KP4AJ-M moved to port [NET ]
07/31/2023 06:59:06:INFO:Repeater:__repeat: Repeating frame to CQCQCQ on all ports
07/31/2023 06:59:06:INFO:Repeater:__repeat: Found a stale path, removing...
07/31/2023 07:06:29:INFO:Repeater:__repeat: Repeating frame to CQCQCQ on all ports
07/31/2023 07:12:28:INFO:Repeater:__repeat: Repeating frame to CQCQCQ on all ports

I presume repeater id W1AW is default have to dig now into configuration.? Will probably change log path to same D-Rats directory.? But definitely progress, big!!

73''

Edfel
KP4AJ


Re: repeater only setup Ubuntu

 

John:? Thank you very much!!? I downloaded the version.py from repository.? Now error gone and better d_rats repeater online.? HAve to test more but I have connected from client at another laptop and netstats shows port 9000 open and listening by python.??

Will check the command line options for configuration.? Have to identify where the conf files are being placed.? Regarding running as Linux service will try to find out within my limited knowledge.? For that will open another thread specific.

Again very appreciated your help!!

73'

Edfel
KP4AJ


Re: repeater only setup Ubuntu

 

On 7/30/2023 7:51 PM, Edfel Rivera wrote:
Thanks John! Could you check the traceback error I posted when trying
direct from python. I think I am missing some library. Thanks!!
About the version, that is something that I think was recently fixed in the file d_rats/version.py at the tip of the current master.



We do not have it in a current release. There is at least one or two Pull Requests in progress that need to be completed before the next release package will be created.

On of the issues is that as a developer, I am usually running out of a clone of the repository, and not from the release package, and most of the fixes have been in the client side, so I missed that in some cases the code to calculate the version was failing.

73,
-John


Re: repeater only setup Ubuntu

 

Thanks John! Could you check the traceback error I posted when trying direct from python. I think? I am missing some library. Thanks!!


On Sun, Jul 30, 2023, 7:12 PM John E. Malmberg <wb8tyw@...> wrote:
On 7/30/2023 5:55 PM, Edfel Rivera wrote:
<snipped from previous e-mails>

> 1- Anyway to have specific instruction for a repeater only install
> that can be managed via command line even not need for a GUI?

The repeater configuration file can be manually edited instead of using
the GUI.? There is a command line option to not launch the GUI.? It
should be listed with --help.

> sudo systemctl start d-rats_repeater.service
> Failed to start d-rats_repeater.service: Unit d-rats_repeater.service
> has a bad unit file setting.

The files for configuring a repeater as a Linux service have not been
updated, not really documented, and probably do not work for system-d
based Linux distributions.? The systemctl command means a system-d based
Linux.

I have not tried setting up the repeater as a service so I have not
debugged.

I was leaving that for later work or for some motivated Linux user to
work out the details.

> 2- The msys2 requirement is only for Windows?
> Also, when trying the mys2_packages.sh file I get
> line 5 pacman command not found.

The msys2 is an Linux emulation layer that runs on Microsoft Windows, it
is not used on any other platform.

My development is done on Anti-X Linux, which is a Debian based as many
Raspberry Pi Distributions and is Ubuntu.

The package names for Debian distributions are usually the same, but may
some differences.

Currently I only list the package names for Anti-X Linux.

> As follow-up have been able to fix the broken dependencies and
> installed licairo2-dev and those other files. Fix was this:
> sudo apt install libbrotli1=1.0.9-2build6

Broken dependencies are not part of the D-Rats project, that is
something local to your system.

> Unable yo locate package pylint3
> Unable to locate package python3_venv
> Not sure How critical are those. I am not interested in running
> D-Rats from virtual environment at the moment.

A python virtual environment is only needed for installing python
packages that are not available as packages from the distribution.

Anti-X linux, and Ubuntu 22.04 are known to supply all the packages
needed for running D-Rats, including all the optional python modules.

Msys2 supplies all the packages needed for running D-Rats, but at the
last check, did not supply all the optional modules that D-Rats can use
if they are installed.

Some of the python packages needed for creating a python distribution
tarball require modules that can only be installed with PIP from Pypi.
Modules installed from Pypi need to be installed in a Virtual
Environment or equivalent for isolation.

73,
-John








Re: repeater only setup Ubuntu

 

On 7/30/2023 5:55 PM, Edfel Rivera wrote:
<snipped from previous e-mails>

1- Anyway to have specific instruction for a repeater only install
that can be managed via command line even not need for a GUI?
The repeater configuration file can be manually edited instead of using the GUI. There is a command line option to not launch the GUI. It should be listed with --help.

sudo systemctl start d-rats_repeater.service
Failed to start d-rats_repeater.service: Unit d-rats_repeater.service
has a bad unit file setting.
The files for configuring a repeater as a Linux service have not been updated, not really documented, and probably do not work for system-d based Linux distributions. The systemctl command means a system-d based Linux.

I have not tried setting up the repeater as a service so I have not debugged.

I was leaving that for later work or for some motivated Linux user to work out the details.

2- The msys2 requirement is only for Windows?
Also, when trying the mys2_packages.sh file I get
line 5 pacman command not found.
The msys2 is an Linux emulation layer that runs on Microsoft Windows, it is not used on any other platform.

My development is done on Anti-X Linux, which is a Debian based as many Raspberry Pi Distributions and is Ubuntu.

The package names for Debian distributions are usually the same, but may some differences.

Currently I only list the package names for Anti-X Linux.

As follow-up have been able to fix the broken dependencies and
installed licairo2-dev and those other files. Fix was this:
sudo apt install libbrotli1=1.0.9-2build6
Broken dependencies are not part of the D-Rats project, that is something local to your system.

Unable yo locate package pylint3
Unable to locate package python3_venv
Not sure How critical are those. I am not interested in running
D-Rats from virtual environment at the moment.
A python virtual environment is only needed for installing python packages that are not available as packages from the distribution.

Anti-X linux, and Ubuntu 22.04 are known to supply all the packages needed for running D-Rats, including all the optional python modules.

Msys2 supplies all the packages needed for running D-Rats, but at the last check, did not supply all the optional modules that D-Rats can use if they are installed.

Some of the python packages needed for creating a python distribution tarball require modules that can only be installed with PIP from Pypi.
Modules installed from Pypi need to be installed in a Virtual Environment or equivalent for isolation.

73,
-John


Re: repeater only setup Ubuntu

 

Well when trying to start I get this:
sudo systemctl start d-rats_repeater.service
Failed to start d-rats_repeater.service: Unit d-rats_repeater.service has a bad unit file setting.
See system logs and 'systemctl status d-rats_repeater.service' for details.
user@host:/home/dratsrepeater/D-Rats$ sudo systemctl status d-rats_repeater.service
○ d-rats_repeater.service
? ? ?Loaded: bad-setting (Reason: Unit d-rats_repeater.service has a bad unit file setting.)
? ? ?Active: inactive (dead)
?
jul 30 18:39:32 host systemd[1]: /etc/systemd/system/d-rats_repeater.service:74: Assignment outside of section. Ignoring.
jul 30 18:39:32 host systemd[1]: /etc/systemd/system/d-rats_repeater.service:75: Assignment outside of section. Ignoring.
jul 30 18:39:32 host systemd[1]: /etc/systemd/system/d-rats_repeater.service:76: Assignment outside of section. Ignoring.
jul 30 18:39:32 host systemd[1]: /etc/systemd/system/d-rats_repeater.service:77: Assignment outside of section. Ignoring.
jul 30 18:39:32 host systemd[1]: /etc/systemd/system/d-rats_repeater.service:78: Assignment outside of section. Ignoring.
jul 30 18:39:32 host systemd[1]: /etc/systemd/system/d-rats_repeater.service:79: Assignment outside of section. Ignoring.
jul 30 18:39:32 host systemd[1]: /etc/systemd/system/d-rats_repeater.service:82: Assignment outside of section. Ignoring.
jul 30 18:39:32 host systemd[1]: /etc/systemd/system/d-rats_repeater.service:83: Assignment outside of section. Ignoring.
jul 30 18:39:32 host systemd[1]: /etc/systemd/system/d-rats_repeater.service:84: Assignment outside of section. Ignoring.
jul 30 18:39:32 host systemd[1]: /etc/systemd/system/d-rats_repeater.service:85: Assignment outside of section. Ignoring.
user@host:/home/dratsrepeater/D-Rats$?
I created user dratsrepeater with ownership of /home/dratsrepeater/D-Rats? Have tried running daemon (editing d-rats_repeater.service at /etc/systemd/system) from that directory or from /usr/local/bin/ same result?

Have question the d-rats_repeater.service file have user set as root and group set as root. should I set drats_repeter.py to run from /usr/local/bin/ ???

What could be the cause of the error:? bad unit file setting?

Thanks in advance! I think I might have several problems but adjusting one by one maybe I could get it to start.

73'

Edfel



Re: repeater only setup Ubuntu

 

Hi Again:
I am getting this one when tryin the apt-get and libraries listed at git:

Unable yo locate package pylint3
Unable to locate package python3_venv

Not sure How critical are those. I am not interested in running D-Rats from virtual environment at the moment.

Thanks.

Edfel
KP4AJ


Re: repeater only setup Ubuntu

 

Hi:
As follow-up have been able to fix the broken dependencies and installed licairo2-dev and those other files. Fix was this:
sudo apt install libbrotli1=1.0.9-2build6

Also, when trying the mys2_packages.sh file I get line 5 pacman command not found.? But pacman is installed. But when I try to run this:

usr/bin/python3 /home/dratsrepeater/D-Rats/d-rats_repeater.py -C

I get:
Traceback (most recent call last):
? File "/home/dratsrepeater/D-Rats/d-rats_repeater.py", line 46, in <module>
? ? from d_rats.version import __version__
? File "/home/dratsrepeater/D-Rats/d_rats/version.py", line 401, in <module>
? ? DRATS_VERSION_NUM = GLOBAL_VERSION.short_version
? File "/home/dratsrepeater/D-Rats/d_rats/version.py", line 111, in short_version
? ? self._get_short_version()
? File "/home/dratsrepeater/D-Rats/d_rats/version.py", line 101, in _get_short_version
? ? (cls._version['major'], cls._version['minor'],
KeyError: 'major'

Any pointer will be highly appreciated.? However, I still think a compact drats_repeater version could be very usefull.? I have no problem running D-rats from Windows. My major interest is to be able to run d-rats repeater within Ubuntu 22.04 server.??

Appreciated all the hard-work getting D-Rats working again with Python3.

73'

Edfel
KP4AJ