Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify terminal.py to log to a text file. #160

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Papagei1
Copy link

@Papagei1 Papagei1 commented Jul 9, 2022

Modify terminal.py to log details of each transmission to a text file. The file name and location are unfortunately hard-coded - op25-scanner.log in the same directory that terminal.py is in. Closes issue #159 .

INCLUDES the changes in the previous pull request, #158 , that address issue #157 .

Papagei1 added 5 commits July 8, 2022 23:19
Allow one more column in main trunking config file, to be used for the name of the TSV file containing the RID map.
Allow one more column in main trunking config file, to be used for the name of the TSV file containing the RID map.
Handle a new TSV file for RID mapping.

The name of the new TSV file appears as the last column in the main trunking config file. trunking.py will read this new TSV file and store it in `srcid_map`.

trunking.py now sends a new `src_tag` message. When a new transmission is received with an RID, trunking.py will attempt to look it up in srcid_map. If there is an entry for it, the src_tag message will have the string that was in the second column of the TSV file. If there is not an entry for it, the src_tag message will have the RID digits, only, as a string.

The new TSV file for RID mapping has two columns. The first column is the RID, and the second column is a text description of that RID. There should be one row per RID. It should look something like this:

1234\tMetropolis Fire Engine 3
4567\tMetropolis Public Works Plow 1
101112\tGotham Ambulance Dispatch

The new TSV file does not support ranges - you can't say something like `1000-1300\tMetropolis Fire`.

With the above example, if a transmission is received from RID 1234, the `src_tag` message would be `Metropolis Fire Engine 3`. If a transmission came in from RID 131415, the `src_tag` message would be `131415`.
Don't send the get_terminal_config message on startup. I am not sure why this is needed, but I have observed that if that message is sent, OP25 crashes shortly after starting.

I *think* it might be some kind of race condition, because trunking.py now has to parse the new TSV file with the RID mapping. In my configuration, the new TSV file has 2500+ RID mappings in it; the extra time needed to parse that file may be causing a problem.
Modify terminal.py to log details of each transmission to a text file. The file name and location are unfortunately hard-coded - op25-scanner.log in the same directory that terminal.py is in.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant