A NAC being reported as 4 digits

Status
Not open for further replies.

cornpop

Newbie
Joined
Oct 22, 2012
Messages
2
Starting op25 without trunking I get the following.

====== NAC 0x61 ====== 0 ======
rf: syid 6c rfid 6 stid 1 frequency 770.531250 uplink 800.531250
net: syid 6c wacn bee00 frequency 770.531250
secondary control channel(s): 771.231250
stats: tsbks 87 crc 0

voice frequency 773.381250 tgid(s) None 290 0.2s ago count 6

tbl-id: 0 frequency: 851.006250 step 0.006250 offset -45.000000
tbl-id: 1 frequency: 762.006250 step 0.006250 offset 30.000000
tbl-id: 2 frequency: 851.012500 step 0.012500 offset -45.000000
tbl-id: 3 frequency: 762.006250 step 0.012500 offset 30.000000

As you can see the NAC is 4 digits, while all others I see in examples are 5. When I attempt to use 0x61 for NAC in my trunk file it crases out with "KeyError: 'nac'".

Has anyone seen a 4 digit nac?
 
D

DaveNF2G

Guest
0x61 appears to be an alias for the NAC itself. You need to figure out which NAC is 0x61.
 

mikewazowski

Forums Manager/Global DB Admin
Staff member
Joined
Jun 26, 2001
Messages
10,995
Location
Central Ontario
Put the NAC in as 061 or the decimal equivalent if that's what OP25 takes.

The 0x denotes a hex number. I'm guessing OP25 has stripped off the leading 0 so you end up with 61.

Are you trying to listen to this system: http://www.radioreference.com/apps/db/?sid=7949?

The database shows 0x061 as the NAC.

0x061 converts to 97 decimal.
 
Last edited:

Jay911

.
Joined
Feb 15, 2002
Messages
9,183
Location
Bragg Creek, Alberta
$ and 0x are common prefixes for hexadecimal (e.g. $293, 0x293). 'h' is a common suffix as well (i.e. 753Fh).

In terms of NACs, site IDs, WACN/SID/system ID, etc., they should be stripped/ignored.
 

cornpop

Newbie
Joined
Oct 22, 2012
Messages
2
Thanks for the suggestions. Yes it is Clayton County. I tried 0x061 and 0x610.

I'm going to chalk it up to a bug in op25. I can decode the primary control channel fine. I can even get op25 to start with the example trunk.tsv. But whenever I use my edited trunk.tsv with my local info it crashes with te following. I think I'll take a drive today to a different P25 area and see what NAC is returned.


ubuntu@ubuntu:~/Downloads/op25/op25/gr-op25_repeater/apps$ ./scope.py --args 'rtl' -g 65 -f 770.53125M -N 'LNA:49' -V -v 600 -S 1000000 -q 39 -T trunk2.tsv

linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.009.004-0-g2b5a88bb

gr-osmosdr v0.1.4-72-g164a09fc (0.1.5git) gnuradio 3.7.10.1
built-in source types: file fcd rtl rtl_tcp uhd hackrf bladerf rfspace airspy redpitaya
Using device #0 Realtek RTL2838UHIDIR SN: 00000001
Found Rafael Micro R820T tuner
[R82XX] PLL not locked!
gain: name: LNA range: start 0 stop 0 step 0
setting gain LNA to 49
supported sample rates 250000-2560000 step 24000
Exact sample rate is: 1000000.026491 Hz
[R82XX] PLL not locked!
set_center_freq: 770531250
Project 25 IMBE Encoder/Decoder Fixed-Point implementation
Developed by Pavel Yazev E-mail: pyazev@gmail.com
Version 1.0 (c) Copyright 2009
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions; see the file ``LICENSE'' for details.
gr::log :INFO: audio source - Audio sink arch: alsa
Traceback (most recent call last):
File "./scope.py", line 2751, in <module>
app = stdgui2.stdapp(p25_rx_block, "APCO P25 Receiver", 3)
File "/usr/local/lib/python2.7/dist-packages/gnuradio/wxgui/stdgui2.py", line 46, in __init__
wx.App.__init__ (self, redirect=False)
File "/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/_core.py", line 7981, in __init__
self._BootstrapApp()
File "/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/_core.py", line 7555, in _BootstrapApp
return _core_.PyApp__BootstrapApp(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/gnuradio/wxgui/stdgui2.py", line 49, in OnInit
frame = stdframe (self.top_block_maker, self.title, self._nstatus)
File "/usr/local/lib/python2.7/dist-packages/gnuradio/wxgui/stdgui2.py", line 76, in __init__
self.panel = stdpanel (self, self, top_block_maker)
File "/usr/local/lib/python2.7/dist-packages/gnuradio/wxgui/stdgui2.py", line 98, in __init__
self.top_block = top_block_maker (frame, self, vbox, sys.argv)
File "./scope.py", line 224, in __init__
self.open_usrp()
File "./scope.py", line 1118, in open_usrp
self.__set_rx_from_osmosdr()
File "./scope.py", line 867, in __set_rx_from_osmosdr
self.__build_graph(self.src, capture_rate)
File "./scope.py", line 314, in __build_graph
self.trunk_rx = trunking.rx_ctl(frequency_set = self.change_freq, debug = self.options.verbosity, conf_file = self.options.trunk_conf_file, logfile_workers=logfile_workers)
File "/home/ubuntu/Downloads/op25/op25/gr-op25_repeater/apps/trunking.py", line 509, in __init__
self.build_config_tsv(conf_file)
File "/home/ubuntu/Downloads/op25/op25/gr-op25_repeater/apps/trunking.py", line 569, in build_config_tsv
nac = int(fields['nac'], 0)
KeyError: 'nac'
 

jets1961

Member
Joined
Jan 21, 2002
Messages
147
Hi,

I thought I would add to this thread as I am getting the same error as the OP cornpop.

When I run this argument line all works fine.

./scope.py --args rtl+0 -N LNA:49 -f 771.94375e6 -S 2048000 -q 00 -V -2

but as soon as I try to introduce trunking I get error line 509 and 569.

./scope.py --args rtl+0 -N LNA:45 -f 771.94375e6 -S 2048000 -q 00 -V -T trunk.tsv -2

I think I do not understand the syntax I should be using. Does the above argument point to the trunk.tvs file which in turn points to my talkgroup.tsv?

Could someone post in comma format exactly how a trunk.tsv and a talkgrop.tsv should look. I have changed the original trunk.tsv that was installed an forgot to make a backup.

Also the NAC of my system is 0xa which is dec 10 so do I enter the NAC as 10 or 0010 or does it matter? I used the latest install method and all when well, just wondering if thee is something not right in the example?
 

br0adband

Member
Joined
Apr 8, 2005
Messages
1,569
Location
Springfield MO
The configuration files that OP25 uses are tab-delimited, not comma-delimited, meaning you use tabs between the fields and the only time you'd see a comma at all (I could be wrong about this one specific aspect so forgive me if I am) would be in the control channel field as in if you have more than one control channel you'd list them as "CC1,CC2,CC3" etc or something like "771.98125,770.85000,772.73125" and so on. No spaces, ever, and you use the tab key to "jump" to the next field. No spaces, whatsoever, and sometimes when you save a file it might - I'm saying it might because it's happened to me - might get an extra space as the very last character in the file even if you can visually see it if you're copying/pasting information so make absolutely certain that the very last character isn't a space. Highlight the last few lines of the tsv file if needed and see if there's that extra space at the end and delete just that space if required.

That's also the reason the extension is tsv as in the t stands for tab delimited whereas with a csv file it's understood (well, by those that know I suppose) with the c meaning comma delimited. The sv stands for separated values where separated aligns with the idea of delimiting or defining the limits of the fields (which can be pretty long given some spreadsheet information).

With respect to the NACs it's been covered but as a general rule of thumb regardless of what you're doing if you ever see 0x(whatever) that means and is interpreted as "what follows the 0x is a hexadecimal number" so for example the NAC of 061 can be written as 0x61 or 0x061 which works out to the same value. So, when you see 0x you'll know "ok, here comes a number written in hex format..." The 0x itself is not part of the actual hexadecimal number, it's just saying to be on the lookout for a hex number following the 0x.

If the system has a NAC of a or A (same thing) OP25 can work with 0xA, 0x0A, or 0x00A, it's all the same thing since the zeroes are on the left so they're not placeholders. Capital or not, doesn't matter either, a = A and vice versa with hexadecimal notation.

I've attached a copy of what I use for S.N.A.C.C. system here in the Las Vegas area (snacc-fire.tsv which is the equivalent of a trunk.tsv but I rename it for easy reference), a rather large P25 Phase I system. I typically only monitor the Fire and EMS related TGIDs so I had to create a tsv for the specific Fire/EMS TGIDs (snacc-fire-tgids.tsv) and then the whitelist file which has the same TGIDs. I could have put every single TGID on the entire system (current count = 362) in the snacc-fire-tgids.tsv file which would then allow every TGID to get monitored and labeled when OP25 stopped on a transmission but since I only care about the Fire/EMS (current count = about 143) then I just added those alone to get the proper tag info and then created the snacc-fire-whitelist.tsv which contains only the numeric TGID itself matching one in the snacc-fire-tgids.tsv file.

I find it easier to whitelist the small amount of TGIDs for Fire/EMS than creating a much longer blacklist of everything I don't want to monitor, if that makes sense. I put them inside a Zip archive since the forum won't allow for .tsv file extension attachments.

Anyway, they should provide enough of an example to work with.
 

Attachments

Last edited:

jets1961

Member
Joined
Jan 21, 2002
Messages
147
OK so here is the problem. When I open your file in gedit I see the tabs that separate fields (and the comma for the control channel fields). If I open it in LOffice Cal and edit the fields then try to save the file it will only let me save it as either a CSV format or a ODS, even if I name it .tsv.

So how do I save the file in a true tab format? Am I using the wrong editor program? I will google but if anyone know please chime in. Thanks
 

Spitfire8520

Completely Clueless =)
Premium Subscriber
Joined
Jun 29, 2009
Messages
1,809
Location
Colorado
OK so here is the problem. When I open your file in gedit I see the tabs that separate fields (and the comma for the control channel fields). If I open it in LOffice Cal and edit the fields then try to save the file it will only let me save it as either a CSV format or a ODS, even if I name it .tsv.

So how do I save the file in a true tab format? Am I using the wrong editor program? I will google but if anyone know please chime in. Thanks
You could just use gedit or any other plain text editor and save it with a .tsv extension. Sometimes the simple tools are the ones that work the best.
 

br0adband

Member
Joined
Apr 8, 2005
Messages
1,569
Location
Springfield MO
That works, as just described above, but if you must use or choose to use Libre Calc or something else you'll have to save as csv but there will be an additional option dialogue you have to select. Here's the steps as I create a new spreadsheet for saving as csv but in tab-delimited format after which I just change the extension to tsv.

Open LibreOffice Calc and paste whatever info you're using then delete columns if necessary so you only get the TGID and the alphatag - if you're making the whitelist you can delete the tag column since that can only contain the number TGIDs only.



Choose File then "Save As..." on the menu:



Select the All Formats drop down menu item and scroll to the bottom and select Text CSV (.csv):



Give the file a proper name of your choosing then click the Save button - as soon as you do you'll get another dialogue as shown:



Select the "Use Text CSV Format" button and you'll get another dialogue:



In the Field delimiter drop down menu select Tab:



Click OK and voila, it'll save the file at that point as filename.csv but in a tab-delimited format after which you can alter the extension to tsv and that's about it. Using Gedit directly can of course be easier I suppose but if you're dealing with a lot of TGIDs and alpha tags in columns I find it easier to use Calc for that then save out as I just provided the steps for. I can then go back and edit things with Gedit and save "normally" and the tab-delimiters will stay in place with Gedit whenever they're used.
 

jets1961

Member
Joined
Jan 21, 2002
Messages
147
Hi,

So I did get it going, thanks all for the help. I used both calculator and gedit to check it after calculator.

What about white lists, Can I not just listen to all TG on a given system if so how do you do that? Just don&#8217;t have a white list?
 

br0adband

Member
Joined
Apr 8, 2005
Messages
1,569
Location
Springfield MO
By default OP25 using just the basic trunk.tsv (or whatever you name the main system configuration file) will allow you to listen to every TGID that it picks up when there's a transmission on one and it will simply show the TGID itself. The purpose of the second type of file is to label the numeric TGIDs with their alpha tags so it's easier for you to know at a glance what you're listening to instead of just seeing the numeric TGID appear.

The third type of file is either the whitelist or the blacklist which is used to allow (whitelist) or deny (blacklist) specific TGIDs. The information in either the whitelist or the blacklist is simply the numeric TGID which matches something in the second type of file. It works like this:

- main system configuration file that by default allows you to monitor any TGID at all but only provides the numeric TGID (in my example files that's snacc-fire.tsv)

- talkgroups configuration file which contains the TGIDs you wish to provide actual alpha tags for - it's not absolutely necessary to label all of them if you don't want to but the primary purpose of this file is to provide the alpha tag information (in my example files this is snacc-fire-tgids.tsv - it only contains the Fire/EMS talkgroups that I care about monitoring)

- whitelist or blacklist configuration file(s) which contain only numeric TGIDs that match ones in the talkgroups configuration file which is the important part - in order for you to have a working whitelist or a blacklist, you have to have the talkgroups configuration file because it's cross-checking the numeric TGIDs against it (in my example files this is snacc-fire-whitelist.tsv and because it contains exactly the same numeric TGIDs that my snacc-fire-tgids.tsv has that's all I'll be hearing and nothing else)

Because of how I have things set up I don't need to add every single TGID in the entire system to the snacc-fire-tgids.tsv file nor do I have to create a blacklist that blocks everything I don't want to listen so that the whitelist only allows for those ones I do want.

Yeah, it's confusing in some respects I suppose. I have a main config file (snacc-fire.tsv) that says "ok, here's the list of TGIDs and their tags so I can easily know what I'm hearing at a glance (snacc-fire-tgids.tsv), and then I have a list here of only the stuff I want to listen to and nothing else (snacc-fire-whitelist.tsv)."

If you have a huge number of TGIDs and you only want to listen to a few of them (ok, in my situation it's a huge number overall and a fairly large amount I want to monitor but not all of them) it's easier to create a whitelist that allows only what you want to hear to be monitored than it is by having to block the majority which is stuff you don't want.

But the whitelist or blacklist will not work without the second type of file to use as the reference for what to allow/deny. Try this last part:

No talkgroups file + no whitelist + no blacklist = OP25 monitors everything (say 100 talkgroups on the entire system, you'll be able to hear all 100)

Talkgroups file + whitelist = OP25 will only monitor those talkgroups specified in the whitelist and ignore everything else as referenced by the talkgroups file (even if you have every possible talkgroup on the entire system in the talkgroups file - the whitelist becomes the filter for only what you want to allow - say 100 talkgroups on the system, 100 talkgroups in the talkgroups file, 15 on the whitelist means you'll only hear the 15 on the whitelist and the other 85 don't get through)

Talkgroups file + blacklist = OP25 will monitor everything in the talkgroups file but block those specified by the blacklist (the blacklist becomes the deny filter - say 100 talkgroups in the talkgroups file, 15 on the blacklist means you'll hear the 85 that aren't and those 15 don't get through)

Hope that makes sense...
 
Last edited:

KA1RBI

Member
Joined
Aug 15, 2008
Messages
486
But the whitelist or blacklist will not work without the second type of file to use as the reference for what to allow/deny.
it's actually been a while since all that so this may be a wrong memory on my part, but if I recall correctly the TGID alpha-tags file is wholly optional, and the only "penalty" for not having one is the tags will show the numeric IDs instead of text. I'd expect whitelists and blacklists to work equally with or without the alpha-tags file, since these lists contain only numeric IDs not text...

The idea for doing the whitelists and blacklists came from my memory of an early RS P25 scanner (PRO-96 If I recall) that let you define a trunked system as either "open" or "closed". The former would allow anything that wasn't in a specific list of TGs you didn't want (essentially your blacklist); whereas a "closed" system would admit only TGs listed in your specific (white) list. In those scanners the system could be one or the other but not both; likewise in OP25 you are not prevented from adding both a white and black lists, but to do so is a nonsensical configuration...

Hindsight is always 20/20, and to do it over again I'd reconsider the idea of using TSV files for configuration. The original idea was to let the user have a "GUI" configuration process - using a GUI spreadsheet app to edit the files!

73

Max

p.s..... br0adband: many thanks for your ongoing interest in and help with bringing up new users!!!
 

br0adband

Member
Joined
Apr 8, 2005
Messages
1,569
Location
Springfield MO
No worries, I think there was a point in the past where I discovered that the talkgroups alpha tag file wasn't needed and yes the whitelist/blacklist alone could work as they're designed but since most of us (an assumption, uh-oh) do want to get those TGIDs properly tagged to know what we're stopped on at a glance then that became the reason for my yet-again overly word-heavy answers.

And yeah, I wouldn't mind seeing just a pure GUI version of OP25 as most wouldn't, I really do regret never having spent any time at all not getting into software development. I could program in B.A.S.I.C. pretty well back in the late 1970s and early 1980s but that's about it, my focus turned towards being a hardware geek (keeping the machines actually up and running, somebody else could worry about the code) and that's where it's been ever since.

Regardless, considering what OP25 is capable of and also considering it's still the only software-based P25 Phase II capable monitoring solution it's become rather invaluable to me and probably a lot of other people as well so thank you, Max, for all your efforts in creating it and making it useful. ;)
 
Status
Not open for further replies.
Top