TwoToneDetect New TwoToneDetect in the works - Python based

gregc00

Newbie
Joined
Oct 12, 2017
Messages
1
TTD won't detect tones

Hi, I'm new to TTD. Working with a department that has v60 running on an ancient XP PC.

new PC is Win 7 64-bit, I downloaded v69 and the mpeg software as instructed.
I'm using the v69 config file with same parameters as the v60 config (plus a lot more entries)
I copied the tone config files from the old PC

Two issues
1. the squelch level sets itself when the software starts, and it sets too low - any way to change that?

2. When a tone comes in I see the level and frequency update - so it's getting input, but the software doesn't say "2 tone page detected" like the old one. (and running debug mode I see frequency changing as expected)

Should I try re-creating the tone config files?

Thx

Greg C
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,585
Location
Massachusetts
1. the squelch level sets itself when the software starts, and it sets too low - any way to change that?

Adjust it using the slider directly under the audio level bar. After setting it where you want it exit using the exit button and reload TTD. If you exit by simply closing the window the change is lost.

2. When a tone comes in I see the level and frequency update - so it's getting input, but the software doesn't say "2 tone page detected" like the old one. (and running debug mode I see frequency changing as expected)

Try turning your scanner volume up a bit. When a tone is being broadcast, do the frequency numbers that are scrolling by match those that you have in the tone set parameters? If not, you may need to adjust them or open up the tolerance a bit.
 

jhsands

Member
Feed Provider
Joined
Sep 6, 2006
Messages
557
Location
Texarkana, Arkansas
Comma

I searched the thread for "comma" and didn't find what I am looking for.

Can there be a space between the comma and quotation mark?

@blah.com,"Name" to @blah.com, "Name"
 

ryolsen8

Active Member
Feed Provider
Joined
May 1, 2011
Messages
539
Location
BEE07
County update -- tones "changed"

Good Evening gang,

Polk County (WI.) finally updated their ancient radio equipment. Supposedly, nothing was going to change... What do you know - they did (a bit). An agency now reports that half of their pagers don't trip anymore, and the audio now is noticeably worse.

Now onto some TTD issues:

There are three agencies (as of now) that don't trip when paged out, for the TTD.

Here is one of their tones, and what TTD is now reading them as:

Pager Tones: A: 1034.7, B: 304.7
TTD: A: 1032.0, B: 914.0 -- NOT working

Pager Tones: A:1092.4, B: 1063.2
TTD: A: 1091.0, B: 1059.0 -- working

Here are the tones for the agency who's pagers are not tripping:

A: 979.9, B: 296.5
A: 979.9, B: 288.5

Here is my Config file (I have taken out the E-mail information)

[Section1]
email_user = ;user id to log in to email account used for sending emails
email_pwd = == ;password to log into email account used for sending emails encoded in base64
email_server = smtp.gmail.com ;SMTP server address of email provider
email_port = 465 ;port to access email server with
record_seconds = 36.0 ;number of seconds of audio to record after a valid tone set is found
tone_tolerance = 0.02 ;tolerance of tone detection algorithm 1% = .01
input_device_index = 1 ;index of audio input device
output_device_index = 2 ;index of audio output device
audio_threshold = 64 ;threshold of audio squelch. audio signals below this level will be ignored
tone_offset = 0.0 ;tone offset in percentage. .01 = +1% tone offset, -.02 = -2% tone offset, etc.
mp3_bitrate = 32000 ;bit rate of mp3 encoder. Lower bitrate = smaller file size and lower audio quality
BCC = 0 ;1 = email addresses will be BCC'ed (hidden from other recipients). 0 = recipients will see other recipients
email_priority = 1 ;priority of email (1=highest, 3=normal, 5=lowest)
release_time=0.0 ;amount of silence (in seconds) required before recording will stop (max=60 seconds)
email_from =
email_security = SSL
email_authentication = 1
update_interval = 60.0
audio_channel = mono
stacked_extend_record = 1
start_minimized = 0
email_send_sequential = none


Does anyone know what exactly should be changed, and or what things I should try? There is only one agency that have their pagers not working. I am just adding that in here for reference.

Thank you.
 

jhsands

Member
Feed Provider
Joined
Sep 6, 2006
Messages
557
Location
Texarkana, Arkansas
Good Evening gang,

Polk County (WI.) finally updated their ancient radio equipment. Supposedly, nothing was going to change... What do you know - they did (a bit). An agency now reports that half of their pagers don't trip anymore, and the audio now is noticeably worse.

Now onto some TTD issues:

There are three agencies (as of now) that don't trip when paged out, for the TTD.

Here is one of their tones, and what TTD is now reading them as:

Pager Tones: A: 1034.7, B: 304.7
TTD: A: 1032.0, B: 914.0 -- NOT working

Pager Tones: A:1092.4, B: 1063.2
TTD: A: 1091.0, B: 1059.0 -- working

Here are the tones for the agency who's pagers are not tripping:

A: 979.9, B: 296.5
A: 979.9, B: 288.5

Check for this in your tones.cfg file and adjust as needed.
Atonelength = .6
Btonelength = .6
gaplength = 0

For GMail it is recommended to use STARTTLS and port 587.
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,585
Location
Massachusetts
Good Evening gang,

Polk County (WI.) finally updated their ancient radio equipment. Supposedly, nothing was going to change... What do you know - they did (a bit). An agency now reports that half of their pagers don't trip anymore, and the audio now is noticeably worse.

Now onto some TTD issues:

There are three agencies (as of now) that don't trip when paged out, for the TTD.

Here is one of their tones, and what TTD is now reading them as:

Pager Tones: A: 1034.7, B: 304.7
TTD: A: 1032.0, B: 914.0 -- NOT working

Pager Tones: A:1092.4, B: 1063.2
TTD: A: 1091.0, B: 1059.0 -- working

Here are the tones for the agency who's pagers are not tripping:

A: 979.9, B: 296.5
A: 979.9, B: 288.5

Here is my Config file (I have taken out the E-mail information)

[Section1]
email_user = ;user id to log in to email account used for sending emails
email_pwd = == ;password to log into email account used for sending emails encoded in base64
email_server = smtp.gmail.com ;SMTP server address of email provider
email_port = 465 ;port to access email server with
record_seconds = 36.0 ;number of seconds of audio to record after a valid tone set is found
tone_tolerance = 0.02 ;tolerance of tone detection algorithm 1% = .01
input_device_index = 1 ;index of audio input device
output_device_index = 2 ;index of audio output device
audio_threshold = 64 ;threshold of audio squelch. audio signals below this level will be ignored
tone_offset = 0.0 ;tone offset in percentage. .01 = +1% tone offset, -.02 = -2% tone offset, etc.
mp3_bitrate = 32000 ;bit rate of mp3 encoder. Lower bitrate = smaller file size and lower audio quality
BCC = 0 ;1 = email addresses will be BCC'ed (hidden from other recipients). 0 = recipients will see other recipients
email_priority = 1 ;priority of email (1=highest, 3=normal, 5=lowest)
release_time=0.0 ;amount of silence (in seconds) required before recording will stop (max=60 seconds)
email_from =
email_security = SSL
email_authentication = 1
update_interval = 60.0
audio_channel = mono
stacked_extend_record = 1
start_minimized = 0
email_send_sequential = none


Does anyone know what exactly should be changed, and or what things I should try? There is only one agency that have their pagers not working. I am just adding that in here for reference.

Thank you.

At the risk of sounding like I know what I am talking about, when I really don't...

I experience the same issues. You are seeing harmonics in the system. In your first example above, note how the freq that TTD is hearing is three times the spec freq. That is the third harmonic. If you analyze the recording using Audacity you will see freq peaks at each of the harmonics. This is normal but when the third harmonic is stronger than the correct freq, TTD doesnt decode and pagers may not open. My experience is that it happens most commonly with the low freq tones. I haven't found a good solution. You can try adjusting your input volume. You can add a second tone set for the troublsome depts using the off-spec tone. I have added second tone sets.
If people's pagers are not opening, that is a real concern. That shows that the problem lies in the radio system and not with TTD.

More later, I have to go now...
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,585
Location
Massachusetts
At the risk of sounding like I know what I am talking about, when I really don't...

I experience the same issues. You are seeing harmonics in the system. In your first example above, note how the freq that TTD is hearing is three times the spec freq. That is the third harmonic. If you analyze the recording using Audacity you will see freq peaks at each of the harmonics. This is normal but when the third harmonic is stronger than the correct freq, TTD doesnt decode and pagers may not open. My experience is that it happens most commonly with the low freq tones. I haven't found a good solution. You can try adjusting your input volume. You can add a second tone set for the troublsome depts using the off-spec tone. I have added second tone sets.
If people's pagers are not opening, that is a real concern. That shows that the problem lies in the radio system and not with TTD.

More later, I have to go now...

Part 2 ...
Your experience closely mirrors mine. My problem tone sets each have either an A or B tone frequency between 290 - 310 hz. All three of your problem tone sets above have a tone pretty much in that range (288-304). An electrical engineer acquaintance of mine suggests that the suspect again may be harmonics. In this case it may be the fifth harmonic of the 60 hz AC power supplying the transmitter. Five times sixty is guess what: 300 hz. May be an explanation of why the tones in the area of 300 hz are distorted, sometimes not opening pagers and causing missed decodes on TTD.

I have other tone sets in the 320-340 hz range that have never been a problem.
 

aaknitt

Member
Feed Provider
Joined
Aug 27, 2005
Messages
1,305
If people's pagers are not opening, that is a real concern. That shows that the problem lies in the radio system and not with TTD.

DC31 is entirely correct. TTD detects the strongest frequency in the signal. Pagers typically function a little differently and will trigger as long as the desired frequency is present, even if it's not the strongest frequency. If the pagers aren't opening up due to a harmonic issue, it has to be pretty bad, and needs to be fixed on the console/transmitter side, ASAP. TTD not working is one thing, but pagers not working is a much bigger problem.

As DC31 mentioned, a workaround for TTD is to set the B tone in TTD to the third harmonic rather than the "actual" B tone. However, sometimes just which dispatch console is being used can make a difference...one console may be "clean" and another "dirty" with harmonics. Likewise, if you have multiple transmitter sites or towers or backup paging sites, they may have different characteristics as well. So to be safe, you'll want to set up two tone sets...one using the actual B tone and a duplicate using the third harmonic B tone. Not ideal, but better than nothing.

Andy
 

ryolsen8

Active Member
Feed Provider
Joined
May 1, 2011
Messages
539
Location
BEE07
DC31 is entirely correct. TTD detects the strongest frequency in the signal. Pagers typically function a little differently and will trigger as long as the desired frequency is present, even if it's not the strongest frequency. If the pagers aren't opening up due to a harmonic issue, it has to be pretty bad, and needs to be fixed on the console/transmitter side, ASAP. TTD not working is one thing, but pagers not working is a much bigger problem.

As DC31 mentioned, a workaround for TTD is to set the B tone in TTD to the third harmonic rather than the "actual" B tone. However, sometimes just which dispatch console is being used can make a difference...one console may be "clean" and another "dirty" with harmonics. Likewise, if you have multiple transmitter sites or towers or backup paging sites, they may have different characteristics as well. So to be safe, you'll want to set up two tone sets...one using the actual B tone and a duplicate using the third harmonic B tone. Not ideal, but better than nothing.

Andy

This has been so very helpful. So- for the first tone set- keep the A tone the same, and change the B tone (duplicating the original) from 304.7 to 180.0 - the 3rd harmonic. Would I continue this practice for the other low tones as well? Just continue using the 3rd harmonic? Assuming it’s however many times higher than original?
 

aaknitt

Member
Feed Provider
Joined
Aug 27, 2005
Messages
1,305
This has been so very helpful. So- for the first tone set- keep the A tone the same, and change the B tone (duplicating the original) from 304.7 to 180.0 - the 3rd harmonic. Would I continue this practice for the other low tones as well? Just continue using the 3rd harmonic? Assuming it’s however many times higher than original?

For the three agencies you listed that aren't working, here are the six tone sets you'll want to set up:

Agency 1
A: 1034.7, B: 304.7 – Actual
A: 1037.7, B: 914.1 – Third Harmonic Version (304.7 x 3 = 914.1)

Agency 2
A: 979.9, B: 296.5 – Actual
A: 979.9, B: 889.5 – Third Harmonic Version (296.5 x 3 = 889.5)

Agency 3
A: 979.9, B: 288.5 – Actual
A: 979.9, B: 865.5 – Third Harmonic Version (288.5 x 3 = 865.5)
 

ryolsen8

Active Member
Feed Provider
Joined
May 1, 2011
Messages
539
Location
BEE07
For the three agencies you listed that aren't working, here are the six tone sets you'll want to set up:

Agency 1
A: 1034.7, B: 304.7 – Actual
A: 1037.7, B: 914.1 – Third Harmonic Version (304.7 x 3 = 914.1)

Agency 2
A: 979.9, B: 296.5 – Actual
A: 979.9, B: 889.5 – Third Harmonic Version (296.5 x 3 = 889.5)

Agency 3
A: 979.9, B: 288.5 – Actual
A: 979.9, B: 865.5 – Third Harmonic Version (288.5 x 3 = 865.5)

Perfect! I just entered the information in, and we'll see at Pager Testing this evening how it works out.
 

jhsands

Member
Feed Provider
Joined
Sep 6, 2006
Messages
557
Location
Texarkana, Arkansas
I searched the thread for "comma" and didn't find what I am looking for.

Can there be a space between the comma and quotation mark?

@blah.com,"Name" to @blah.com, "Name"


Anyone??

#2 - TTD is still sending e-mails during the "exclude from up to exclude to" timeframes. The computer has the corresponding time in 12 Hour format. Yesterday's pages were at 17:32 and it sent e-mails to the people in "exclude_emails". Again, the computer time was "5:32 PM" when the pages came in.

Reference the attached rr.png.
 

Attachments

  • rr.png
    rr.png
    4.6 KB · Views: 281

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,585
Location
Massachusetts
Anyone??

#2 - TTD is still sending e-mails during the "exclude from up to exclude to" timeframes. The computer has the corresponding time in 12 Hour format. Yesterday's pages were at 17:32 and it sent e-mails to the people in "exclude_emails". Again, the computer time was "5:32 PM" when the pages came in.

Reference the attached rr.png.

The space between the comma and quote is optional. It works either way.

Did you restart TTD after entering the exclude info? It looks like you got it right.
 

jhsands

Member
Feed Provider
Joined
Sep 6, 2006
Messages
557
Location
Texarkana, Arkansas
The space between the comma and quote is optional. It works either way.

Did you restart TTD after entering the exclude info? It looks like you got it right.

Yes, it restarts everyday at 5:10 P.M. Some days it ignores the pages during the time frame and some days it doesn't.

I'm going to run a scheduled task to kill it at 5:20 P.M. and then another scheduled task to start it at 5:40 P.M.
 

longreacher

Member
Joined
Mar 11, 2011
Messages
24
Location
NB
Been using v67 for a while, updating to v69, struggling with ftpuploader

Our department has been running TTD for a few years now on a pi, and it works beautifully. I'm no trying to update our pi to v69 and bring in the functionality of ftpuploader. However, when I run it using this command.

python ftpuploader.py [mp3] lrfd.orgfree.com/callmp3 myusername mypassword

I'm getting this as output

Traceback (most recent call last):
File "ftpuploader.py", line 34, in <module>
ftp.connect(host,port,10)
File "/usr/lib/python2.7/ftplib.py", line 132, in connect
self.sock = socket.create_connection((self.host, self.port), self.timeout)
gaierror: [Errno -2] Name or service not known
could not upload [mp3] to lrfd.orgfree.com/callmp3


Any thoughts on what I'm missing here?
Thanks.
 
Last edited:

aaknitt

Member
Feed Provider
Joined
Aug 27, 2005
Messages
1,305
Our department has been running TTD for a few years now on a pi, and it works beautifully. I'm no trying to update our pi to v69 and bring in the functionality of ftpuploader. However, when I run it using this command.

python ftpuploader.py [mp3] lrfd.orgfree.com/callmp3 myusername mypassword

I'm getting this as output

Traceback (most recent call last):
File "ftpuploader.py", line 34, in <module>
ftp.connect(host,port,10)
File "/usr/lib/python2.7/ftplib.py", line 132, in connect
self.sock = socket.create_connection((self.host, self.port), self.timeout)
gaierror: [Errno -2] Name or service not known
could not upload [mp3] to lrfd.orgfree.com/callmp3


Any thoughts on what I'm missing here?
Thanks.

If I'm interpreting this correctly, it looks like you want to upload the file to a "/callmp3" subdirectory of your website. Rather than including this path in the host field, you'll want to specify the subdirectory using the --remotepath argument. So try this instead:

python ftpuploader.py [mp3] lrfd.orgfree.com myusername mypassword --remotepath /callmp3/

Also keep in mind that the [mp3] tag only works when the script is called from TTD and TTD automatically substitutes the filename and path for the [mp3] tag. If you're running the ftpuploader script manually from the command line for testing, you'll want to manually replace [mp3] with the path to the file. For example, replace [mp3] with /audio/testfile.mp3

Andy
 

longreacher

Member
Joined
Mar 11, 2011
Messages
24
Location
NB
Hi Andy,
Thanks for the help (again). I've made those corrections, and am still running into the same error. I wonder if it might be due to my trying to upgrade to v69. I might try a clean install on a backup pi tonight to see if I can get better results.
Here is the output of my latest error message.

python ftpuploader.py sample.mp3 lrfd.orgfree.com/ username password --remotepath /callmp3/


Traceback (most recent call last):
File "ftpuploader.py", line 34, in <module>
ftp.connect(host,port,10)
File "/usr/lib/python2.7/ftplib.py", line 132, in connect
self.sock = socket.create_connection((self.host, self.port), self.timeout)
gaierror: [Errno -2] Name or service not known
could not upload sample.mp3 to lrfd.orgfree.com/
 

rampatter

Newbie
Joined
Nov 2, 2017
Messages
1
I still cant figure this out ...



Waiting for Silence GRVFD 20:20:15 on 07/07/14
Done recording GRVFD 20:20:18 on 07/07/14
done writing WAV GRVFD 20:20:18 on 07/07/14
done converting to MP3 GRVFD 20:20:23 on 07/07/14
MP3 Email sent! GRVFD page received at 20:20:23 on 07/07/14 20:20:31 20:20:31 on 07/07/14
done converting to AMR GRVFD 20:20:36 on 07/07/14
Traceback (most recent call last):
File "TwoToneDetect65cPi.py", line 465, in mail
File "/usr/lib/python2.7/smtplib.py", line 613, in login
raise SMTPAuthenticationError(code, resp)
SMTPAuthenticationError: (534, '5.7.14 <https://accounts.google.com/ContinueSignIn?sarp=1&scc=1&plt=AKgnsbvwB\n5.7.14 3W1fJEH5bTwQNTeeyL3ITMju7w3kPGzDMo_ikN56q0NIoiW6C7EKHh-NYrhkTeA_jTFmf0\n5.7.14 wzA8YzLCpLmd4CB3jRXXRFsiCcv-9131G1pIogehkLJifxphvHwsE-z77x8-KtUxKEkb95\n5.7.14 CbTN69uRqvFbpmM-NhZypNMoJEZXbYZjHYGIffEDGWPR4UUt8miX9mI6gaEZz6fjjD0WSb\n5.7.14 VBBrOgA> Please log in via your web browser and then try again.\n5.7.14 Learn more at\n5.7.14 https://support.google.com/mail/bin/answer.py?answer=78754 p12sm692766igx.18 - gsmtp')
Email not sent on attempt 1trying again in five seconds for GRVFD Page Received at 20:20:36 on 07/07/14
Traceback (most recent call last):
File "TwoToneDetect65cPi.py", line 465, in mail
File "/usr/lib/python2.7/smtplib.py", line 613, in login
raise SMTPAuthenticationError(code, resp)
SMTPAuthenticationError: (534, '5.7.14 <https://accounts.google.com/ContinueSignIn?sarp=1&scc=1&plt=AKgnsbuRJ\n5.7.14 lpcjlOlcIu_AYUNqRc2sygByUI9sqN06Pj3k7_JiBlVArmcvHktyVLYWUWSgvn_UTvHwWZ\n5.7.14 pwA0G46AWJ1Tv2opI4VPAw_p0tc9bZGViu2uvrNri8qePO7oD06c4gowEM7x9tIcD-tyFw\n5.7.14 V_r6xaa1q0cMqkQJFpcai0Xaxr2kG49

It is because Google blocks sign-in attempts from apps which do not use modern security standards (mentioned on their support page). You can however, turn on/off this safety feature by going to the link below:

Go to this link and select Turn On

https://www.google.com/settings/security/lesssecureapps

Moreover google block an ip when you try to send a email since a unusual location, so, you can unblock in the next link

https://support.google.com/accounts/answer/6009563

and clicked in

accounts.google.com/DisplayUnlockCaptcha .

More....

Send mail from Gmail account using Python
 
Top