TwoToneDetect New TwoToneDetect in the works - Python based

MikeOrlando02

Member
Joined
Oct 8, 2015
Messages
97
Anyone having issues sending AMR pages to ATT users who using mms.att.net? Our ATT users for the past week and a half have reported not getting their pages. When I checked our outgoing email account, I see more bounces from ATT users than usual:

att-e2xms-west.mx.a.cloudfilter.net[35.82.99.184] said: 550 5.1.1
recipient address rejected (in reply to RCPT TO command)

Normally I would say it's a bad number or they changed carriers, but I am seeing this with multiple ATT users from different tone sets. I even emailed directly from the mail service we use (fastmail), my personal email, and corporate email and get similar bounce messages so I know it isn't specific to TTD.

Did ATT do something with their MMS gateway domain or change their antispam rules? Anyone else seeing similar?
Contacted ATT Postmaster, did not get a reply; however the messages starting going through again a few days later.
 

MikeOrlando02

Member
Joined
Oct 8, 2015
Messages
97
Today, our dispatch center is using their backup radio system and the quality is pretty bad. We are missing every page that is put out. The actual pages are A-Tone 1 Second and B-Tone 3 Seconds.

Here is an example paging set.
376.4634146341463 32766 1685892551.7547753
376.4634146341463 22577 1685892551.9488704
376.4634146341463 16323 1685892552.133887
360.3292682926829 20351 1685892552.318896
360.3292682926829 14859 1685892552.5042765
360.3292682926829 13869 1685892552.6896596
360.3292682926829 13950 1685892552.8746545
360.3292682926829 14325 1685892553.059041
360.3292682926829 13476 1685892553.2530246
360.3292682926829 14129 1685892553.4373333
360.3292682926829 13912 1685892553.6216967
360.3292682926829 13792 1685892553.8059573
360.3292682926829 13921 1685892553.9911234
360.3292682926829 13770 1685892554.1758401
360.3292682926829 13543 1685892554.360847
360.3292682926829 13369 1685892554.5393367
360.3292682926829 13848 1685892554.7399552
360.3292682926829 13873 1685892554.909369
360.3292682926829 13565 1685892555.1102061
360.3292682926829 18283 1685892555.2791288

376.4634146341463 29675 1685911411.49455
376.4634146341463 16685 1685911411.6842005
338.8170731707317 19335 1685911411.8745072
338.8170731707317 12771 1685911412.0550218
338.8170731707317 12453 1685911412.2453008
338.8170731707317 12070 1685911412.4252667
338.8170731707317 11947 1685911412.6145554
338.8170731707317 11720 1685911412.7946358
338.8170731707317 11933 1685911412.9850056
338.8170731707317 12043 1685911413.1751032
338.8170731707317 11605 1685911413.3543975
338.8170731707317 11869 1685911413.5447807
338.8170731707317 11705 1685911413.7244766
338.8170731707317 11842 1685911413.9155984
338.8170731707317 11541 1685911414.0945482
338.8170731707317 11691 1685911415.8565686
I was going to try lowering my TTD tone length to A-tone 0.4 and B-tone 1.0 to capture the tones. We are not currently using Tone Gap at all. Since my A-tone is really 1.0 and I have it set to 0.4, do I need to set my gap minimally to 0.6 so it ignores the remainder of the A-tone before seeking the B-tone? Should I increase this gap to 0.8 so if there is any warble between A-B that 200ms disregarded as well?

Thanks!
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,564
Location
Massachusetts
Each line represents a 200 ms sound sample (0.2 sec). So in the first tone set shown above you are hearing 0.6 sec of tone A. In the second, you are hearing 0.4 sec of tone A. If you set your tone length to something longer than these values, you will not get a decode. It isn’t apparent from these if there is a gap. If you are listening, is there a noticeable gap between the end of the A tone and the start of the B tone? If so, use the gap parameter. No need to use the gap for the end of the A tone. The program really only counts the end samples of the A tone and the beginning samples of the B tone.
 

xawen

Member
Joined
Feb 20, 2020
Messages
36
Has anyone seen instances of TTD cutting off recordings at 55 seconds? I have TTD running on a Raspberry Pi and configured to record dispatches and send them via Telegram to a group. It also plays the dispatch live through a speaker on the Pi. Details on my setup are here.

But on longer dispatches, TTD cuts off the recording and the live audio at 55 seconds and I can't figure out why. It typically cuts off in the middle of the dispatcher talking, so it's not a situation where TTD thinks it's silent. What happens is that 1) the live/local audio cuts off suddenly 2) the recording is sent to telegram normally, but cuts off in the same place - at 55 seconds.

Shorter recordings are working correctly with the dispatch followed by a 15 second silence. It just seems that there's something in my config or TTD itself that limits the recordings to 55 seconds.

Anyone seen similar or have any advice on how to troubleshoot?
 
Last edited:

MikeOrlando02

Member
Joined
Oct 8, 2015
Messages
97
Has anyone seen instances of TTD cutting off recordings at 55 seconds? I have TTD running on a Raspberry Pi and configured to record dispatches and send them via Telegram to a group. It also plays the dispatch live through a speaker on the Pi. Details on my setup are here.

But on longer dispatches, TTD cuts off the recording and the live audio at 55 seconds and I can't figure out why. It typically cuts off in the middle of the dispatcher talking, so it's not a situation where TTD thinks it's silent. What happens is that 1) the live/local audio cuts off suddenly 2) the recording is sent to telegram normally, but cuts off in the same place - at 55 seconds.

Shorter recordings are working correctly with the dispatch followed by a 15 second silence. It just seems that there's something in my config or TTD itself that limits the recordings to 55 seconds.

Anyone seen similar or have any advice on how to troubleshoot?

Could you be hitting a ~60 second timeout?

If the Audio Squelch Level is set too low, the program will continue to detect audio even when there is no radio traffic present, and the recording will continue until a 60 second timeout occurs after the Record Time expires. If your audio recordings are about 60 seconds plus your Record Time, you probably need to adjust your Audio Squelch Level up a bit.
 

MikeOrlando02

Member
Joined
Oct 8, 2015
Messages
97
I have been working on shortening my A and B tone length for more lenient detection when our backup dispatch is in use. Shortening that detection time seems to have messed with the balance I had in detecting the end of the first page and start of the second, I would like these to be two different files. For some reason I had been using a strange Release Time of 0.05, which I presume should be in 200 ms increments so I am currently testing at 0.4. Today, I got a traceback...

I have been monitoring pages and got a notification this AM, but then link was broken and file hadn't been uploaded. How should this feature work - "found a new tone to add to an existing alert thread - killing this one". It seems to have killed... meaning deleted the file it recorded and only recorded the second page. This is not desirable for me, I am all good on stopping the first recording and then starting a second when it detects the second page. But my first recording had already stopped, why did the software delete the first page, not send alerts or FTP upload?

Shortly after I got a traceback, see log file.
376.4634146341463 14037 1686577176.6207886
376.4634146341463 12970 1686577176.8057933
376.4634146341463 13041 1686577176.984271
376.4634146341463 13534 1686577177.1849327
376.4634146341463 13830 1686577177.3703458
338.8170731707317 13303 1686577177.5551932
338.8170731707317 11799 1686577177.739957
338.8170731707317 11548 1686577177.9249501
338.8170731707317 11800 1686577178.1099398
338.8170731707317 11541 1686577178.2884362
Wausaukee Rescue Tone Set Found
starting new alert at 1686577178.3574882
[[['Wausaukee Rescue', 1686577178.2884362, 0]]]

delay timer Wausaukee Rescue 08:39:38 on 06/12/23
344.1951219512195 12357 1686577178.4975858
4.0
3.6708853244781494
1686577178.6175508
1686577178.2884362
338.8170731707317 11864 1686577178.687346
338.8170731707317 11866 1686577178.8672862
338.8170731707317 11553 1686577179.0571654
338.8170731707317 11265 1686577179.2323353
338.8170731707317 11275 1686577179.4284697
338.8170731707317 11722 1686577179.6069582
338.8170731707317 11549 1686577179.7919552
338.8170731707317 10966 1686577179.976973
338.8170731707317 11803 1686577180.1623611
338.8170731707317 11731 1686577180.347342
338.8170731707317 14605 1686577180.5320148
2172.731707317073 1721 1686577180.7265093
2172.731707317073 1820 1686577181.096091
2172.731707317073 1609 1686577181.4651308
779.8170731707318 32767 1686577181.6495333
478.6463414634146 32767 1686577181.8339126
252.76829268292684 19767 1686577182.0278907
247.390243902439 8947 1686577182.2124164
263.5243902439024 2094 1686577182.396491
397.9756097560976 2093 1686577182.5807939
delay done Wausaukee Rescue 08:39:42 on 06/12/23
waiting for audio Wausaukee Rescue 08:39:42 on 06/12/23
threshold value: 1500
295.7926829268293 1558 1686577182.7651901
268.9024390243902 32767 1686577183.5143023
threshold exceeded
recording audio Wausaukee Rescue 08:39:43 on 06/12/23
iterations: 86
1952.2317073170732 32767 1686577183.6836786
2172.731707317073 19176 1686577183.884326
591.5853658536586 18044 1686577184.0536962
1495.0975609756097 15764 1686577184.2543242
602.3414634146342 14966 1686577184.4325745
543.1829268292682 16605 1686577184.6177413
656.1219512195122 17693 1686577184.8182344
349.5731707317073 8370 1686577184.9876156
639.9878048780488 14034 1686577185.1882899
376.4634146341463 7166 1686577185.358297
349.5731707317073 5501 1686577185.5432878
1694.0853658536585 15660 1686577185.743281
333.4390243902439 5073 1686577185.9213583
623.8536585365854 19777 1686577186.1063566
360.3292682926829 19872 1686577186.2913508
338.8170731707317 13349 1686577186.4763784
354.9512195121951 11424 1686577186.6614044
2172.731707317073 4573 1686577186.8464098
462.5121951219512 9897 1686577187.0470686
365.7073170731707 7973 1686577187.2258658
365.7073170731707 9846 1686577187.410866
844.3536585365854 15914 1686577187.5957224
311.9268292682927 15883 1686577187.7807786
795.9512195121952 11094 1686577187.965789
397.9756097560976 10950 1686577188.1507883
742.170731707317 5238 1686577188.344917
354.9512195121951 4604 1686577188.5143209
774.439024390244 3113 1686577188.7150788
2172.731707317073 2130 1686577188.8843024
683.0121951219512 25088 1686577189.0846112
408.7317073170732 8959 1686577189.2538571
510.9146341463415 14933 1686577189.4539232
2172.731707317073 2578 1686577189.64774
301.1707317073171 12437 1686577189.8164277
1054.0975609756097 15549 1686577190.0167904
1575.7682926829268 19448 1686577190.1861336
376.4634146341463 6840 1686577190.3867934
365.7073170731707 7234 1686577190.5561662
349.5731707317073 7155 1686577190.7575088
344.1951219512195 4947 1686577190.935997
328.0609756097561 4683 1686577191.121013
2172.731707317073 5031 1686577191.3059988
516.2926829268292 32767 1686577191.4910147
Waiting for Silence Wausaukee Rescue 08:39:51 on 06/12/23
247.390243902439 19750 1686577191.6760478
247.390243902439 17434 1686577191.877095
258.1463414634146 3305 1686577192.0551836
397.9756097560976 2093 1686577192.2401981
322.6829268292683 1934 1686577192.4253235
Done recording Wausaukee Rescue 08:39:52 on 06/12/23
./audio/Wausaukee_Rescue_2023_06_12_08_39_38.wav
done writing WAV Wausaukee Rescue 08:39:52 on 06/12/23
done converting to MP3 Wausaukee Rescue 08:39:52 on 06/12/23
done converting to AMR Wausaukee Rescue 08:39:52 on 06/12/23
entry
['Wausaukee Rescue', 1686577178.2884362, 0]
Adding Wausaukee Rescue detection back to active after 0.0 second delay
268.9024390243902 32767 1686577192.9802344
2172.731707317073 21181 1686577193.1652226
2172.731707317073 8699 1686577193.3437183
2172.731707317073 3074 1686577193.54438
2172.731707317073 3216 1686577193.7137227
2172.731707317073 2763 1686577193.9147625
logging in
2172.731707317073 2297 1686577194.083998
logged in
381.8414634146341 15726 1686577194.28433
376.4634146341463 12940 1686577194.4689891
376.4634146341463 13711 1686577194.647841
376.4634146341463 12640 1686577194.848109
376.4634146341463 13022 1686577195.0175233
376.4634146341463 12818 1686577195.2181666
338.8170731707317 12448 1686577195.387582
338.8170731707317 11598 1686577195.588214
338.8170731707317 11631 1686577195.7732089
338.8170731707317 11185 1686577195.951494
338.8170731707317 11692 1686577196.1363232
Wausaukee Rescue Tone Set Found
found a new tone to add to an existing alert thread - killing this one
[[['Wausaukee Rescue', 1686577178.2884362, 0], ['Wausaukee Rescue', 1686577196.151957, 0]]]
338.8170731707317 11201 1686577196.3208845
338.8170731707317 11053 1686577196.505641
338.8170731707317 11332 1686577196.6906233
338.8170731707317 11230 1686577196.875623
338.8170731707317 11482 1686577197.076256
338.8170731707317 11380 1686577197.2547503
338.8170731707317 11931 1686577197.4397154
AMR Group Email sent (addresses redacted)
FTP UPLOAD STARTS HERE
RETURNING AND REMOVING STUFF HERE at 1686577197.493676
alert_list_local: [['Wausaukee Rescue', 1686577178.2884362, 0]]
Traceback (most recent call last):
File "TwoToneDetect.py", line 2260, in alert
ValueError: list.remove(x): x not in list
alert_list: [[['Wausaukee Rescue', 1686577178.2884362, 0], ['Wausaukee Rescue', 1686577196.151957, 0]]]

338.8170731707317 11569 1686577197.6252506
338.8170731707317 11133 1686577197.8099785
338.8170731707317 11469 1686577197.9950094
338.8170731707317 11639 1686577198.1799867
338.8170731707317 15962 1686577198.3741145
2172.731707317073 1537 1686577198.5434697
2172.731707317073 1502 1686577198.7440891
2172.731707317073 1506 1686577198.9138665
941.1585365853658 32767 1686577199.4839199
252.76829268292684 32751 1686577199.677739
252.76829268292684 19639 1686577199.8467274
247.390243902439 5940 1686577200.0470464
./audio/Wausaukee_Rescue_2023_06_12_08_39_38.mp3 uploaded to crivitzrescue.com
274.280487804878 32767 1686577200.2164173
2172.731707317073 23049 1686577200.4170814
2172.731707317073 9954 1686577200.602107
2172.731707317073 3921 1686577200.7877634
1473.5853658536585 19825 1686577200.9662318
510.9146341463415 14946 1686577201.1511393
623.8536585365854 17413 1686577201.3361325
516.2926829268292 2949 1686577201.5211458
618.4756097560976 21055 1686577201.7061756
354.9512195121951 14018 1686577201.907141
580.829268292683 12621 1686577202.0853102
403.3536585365854 11964 1686577202.2703173
602.3414634146342 23029 1686577202.455507
1398.2926829268292 23094 1686577202.640522
1581.1463414634147 21462 1686577202.8251991
381.8414634146341 6313 1686577203.0102344
381.8414634146341 12995 1686577203.1952236
392.5975609756098 11185 1686577203.3737206
333.4390243902439 3648 1686577203.5743785
344.1951219512195 6413 1686577203.7437568
500.1585365853659 17557 1686577203.9444304
1457.4512195121952 12134 1686577204.1294556
360.3292682926829 4780 1686577204.3141491
639.9878048780488 24169 1686577204.499109
580.829268292683 19173 1686577204.677895
2172.731707317073 1843 1686577204.8782344
752.9268292682926 2105 1686577205.0477965
467.890243902439 13636 1686577205.2482688
521.670731707317 10718 1686577205.4333005
462.5121951219512 14658 1686577205.618479
435.6219512195122 17059 1686577205.8035104
532.4268292682926 8794 1686577205.9820082
387.219512195122 5210 1686577206.1664598
392.5975609756098 4364 1686577206.3508325
1253.0853658536585 12011 1686577206.5352025
295.7926829268293 3275 1686577206.735355
645.3658536585366 18034 1686577206.904741
1382.158536585366 21389 1686577207.10538
360.3292682926829 9402 1686577207.2838778
2172.731707317073 6739 1686577207.468882
435.6219512195122 8146 1686577207.6538868
564.6951219512196 9239 1686577207.8392758
2172.731707317073 2454 1686577208.0241454
376.4634146341463 3202 1686577208.2091656
435.6219512195122 5049 1686577208.4032607
1253.0853658536585 12740 1686577208.5882645
376.4634146341463 2450 1686577208.7733107
344.1951219512195 5079 1686577208.9583106
591.5853658536586 13755 1686577209.1437302
295.7926829268293 9418 1686577209.3287373
2172.731707317073 5411 1686577209.513602
2172.731707317073 3183 1686577209.707894
467.890243902439 10663 1686577209.8763847
328.0609756097561 2950 1686577210.076402
489.4024390243902 7888 1686577210.2608109
467.890243902439 8557 1686577210.4451778
360.3292682926829 8930 1686577210.6295624
354.9512195121951 4938 1686577210.8139112
2172.731707317073 2237 1686577211.0078936
2172.731707317073 1639 1686577211.17641
1296.1097560975609 32767 1686577211.376426
855.109756097561 32767 1686577211.560831
247.390243902439 19718 1686577211.7452002
258.1463414634146 7915 1686577211.929564
252.76829268292684 2098 1686577212.1139128
403.3536585365854 2089 1686577212.3079104
263.5243902439024 1503 1686577212.4764032
247.390243902439 32767 1686577240.7207668
1753.2439024390244 21620 1686577240.9051836
1645.6829268292684 9617 1686577241.0895712
968.0487804878048 3734 1686577241.2739253
1446.6951219512196 4000 1686577241.4679031
473.2682926829268 17711 1686577241.6520503
1339.1341463414635 24257 1686577241.8369772
419.4878048780488 15722 1686577242.0219543
1505.8536585365853 11643 1686577242.2069974
1425.1829268292684 5153 1686577242.3920236
1640.3048780487804 8554 1686577242.5776565
494.780487804878 9375 1686577242.756154
699.1463414634146 6899 1686577242.9567797
2495.4146341463415 4202 1686577243.12615
537.8048780487804 4010 1686577243.3267934
2420.121951219512 4060 1686577243.5122836
1817.780487804878 3105 1686577243.6971817
704.5243902439024 28844 1686577243.8818514
1000.3170731707318 31739 1686577244.0603292
1548.878048780488 1921 1686577244.4461215
2172.731707317073 1513 1686577244.6151757
408.7317073170732 3599 1686577244.9838898
2172.731707317073 4427 1686577245.184794
2172.731707317073 3913 1686577245.3632762
2172.731707317073 1569 1686577245.5483034
1866.1829268292684 2189 1686577245.7489753
623.8536585365854 32767 1686577245.918714
247.390243902439 19764 1686577246.1036923
247.390243902439 10945 1686577246.2885911
252.76829268292684 2080 1686577246.4825387
301.1707317073171 2097 1686577246.6675582
301.1707317073171 1656 1686577246.8525693
checking for stale alerts to clear out 1686577406.6075032
 

xawen

Member
Joined
Feb 20, 2020
Messages
36
Could you be hitting a ~60 second timeout?

If the Audio Squelch Level is set too low, the program will continue to detect audio even when there is no radio traffic present, and the recording will continue until a 60 second timeout occurs after the Record Time expires. If your audio recordings are about 60 seconds plus your Record Time, you probably need to adjust your Audio Squelch Level up a bit.

Hmm, I guess that's possible. I have played with the squelch, but usually moving it down (thinking that maybe it's accidentally detecting silence). I will try to adjust it up. RTL-Airband does a good job of only sending audio when the frequency is actually active.

At 55 seconds those are some long pages.
Yeah, they are. These are usually the working fires with 10 or so units assigned. Tones for each station and batallion then dispatch calls out each unit. Not uncommon for all of that to take 30-40 seconds before they actually call out the incident. Problem is that they do the talkgroup assignment at the end, so when it cuts off I miss that and have to go hunting.
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,564
Location
Massachusetts
Hmm, I guess that's possible. I have played with the squelch, but usually moving it down (thinking that maybe it's accidentally detecting silence). I will try to adjust it up. RTL-Airband does a good job of only sending audio when the frequency is actually active.


Yeah, they are. These are usually the working fires with 10 or so units assigned. Tones for each station and batallion then dispatch calls out each unit. Not uncommon for all of that to take 30-40 seconds before they actually call out the incident. Problem is that they do the talkgroup assignment at the end, so when it cuts off I miss that and have to go hunting.
could you share your configuration file (config.cfg) and the information on one of your tone sets from tones.cfg?
 

xawen

Member
Joined
Feb 20, 2020
Messages
36
could you share your configuration file (config.cfg) and the information on one of your tone sets from tones.cfg?
Sure thing. I actually did a writeup of the entire config in another post that includes the config files and all the details I could think of. It's in the link below. The only thing that has changed since then is adding a notch filter into the rtl-airband config to cut out the CTCSS tone.

[Guide] TwoToneDetect with RTL-SDR and local audio
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,564
Location
Massachusetts
Sure thing. I actually did a writeup of the entire config in another post that includes the config files and all the details I could think of. It's in the link below. The only thing that has changed since then is adding a notch filter into the rtl-airband config to cut out the CTCSS tone.

[Guide] TwoToneDetect with RTL-SDR and local audio
Lots of information in that other post. However, if we are going to troubleshoot your current setup, we are going to need the current tones.cfg that you are using. Obviously, your current setup uses totally different tone sets and descriptions than what you previously posted.

i also use rtl_airband as analog source for TTD on a pi and it works very well. The same calls are dispatched over a P25 digital system. I have another pi running boatbod OP25 on that and feeding audio into TTD on the same pi. Works like a charm. All calls are sent out as push notifications through IaR and Pushover. I ditched emails/texts 2-1/2 years ago.
 

xawen

Member
Joined
Feb 20, 2020
Messages
36
Lots of information in that other post. However, if we are going to troubleshoot your current setup, we are going to need the current tones.cfg that you are using. Obviously, your current setup uses totally different tone sets and descriptions than what you previously posted.

i also use rtl_airband as analog source for TTD on a pi and it works very well. The same calls are dispatched over a P25 digital system. I have another pi running boatbod OP25 on that and feeding audio into TTD on the same pi. Works like a charm. All calls are sent out as push notifications through IaR and Pushover. I ditched emails/texts 2-1/2 years ago.

Fair enough, however the configs in that post actually are from my real configs (with some redactions). The full contents of the current config/tones files are below. There are a few variations from what's in the post above, however these were all made trying to troubleshoot this issue. Both versions have the same problem with cutting off some longer dispatches.

tones.cfg
Code:
[Tone1]
Atone = 669.9
Btone = 617.4
Atonelength = 1
Btonelength = 1
Description = St. 2 - Woodland
record_delay = 0
record_seconds = 0
release_time = 30
playback_during_record = 1
alert_command = curl "https://api.telegram.org/[redacted]/sendMessage?chat_id=[redacted]" --data-urlencode "text=Dispatch for [d]"
post_email_command = curl -F document=@"[mp3]" https://api.telegram.org/[redacted]/sendDocument?chat_id=[redacted]

[Tone2]
Atone = 669.9
Btone = 651.9
Atonelength = 1
Btonelength = 1
Description = St. 3 - Riva
record_delay = 0
record_seconds = 15
release_time = 30
playback_during_record = 1
alert_command = curl "https://api.telegram.org/[redacted]/sendMessage?chat_id=[redacted]" --data-urlencode "text=Dispatch for [d]"
post_email_command = curl -F document=@"[mp3]" https://api.telegram.org/[redacted]/sendDocument?chat_id=[redacted]

[Tone3]
Atone = 707.3
Btone = 651.9
Atonelength = 1
Btonelength = 1
Description = St. 7 - Davidsonville
mp3_Emails = email@address.com
record_delay = 0
record_seconds = 15
release_time = 30
playback_during_record = 1
alert_command = curl "https://api.telegram.org/[redacted]/sendMessage?chat_id=[redacted]" --data-urlencode "text=Dispatch for [d]"
post_email_command = curl -F document=@"[mp3]" https://api.telegram.org/[redacted]/sendDocument?chat_id=[redacted]

[Tone4]
Atone = 669.9
Btone = 553.9
Atonelength = 1
Btonelength = 1
Description = Batallion 3
mp3_Emails = email@address.com
record_delay = 0
record_seconds = 15
release_time = 30
playback_during_record = 1
alert_command = curl "https://api.telegram.org/[redacted]/sendMessage?chat_id=[redacted]" --data-urlencode "text=Dispatch for [d]"
post_email_command = curl -F document=@"[mp3]" https://api.telegram.org/[redacted]/sendDocument?chat_id=[redacted]

[Longtone1]
Longtone = 707.3
Longtonelength = 6
Description = Long Tone Page
amr_emails = email@address.com
record_delay = 2
record_seconds = 15
release_time = 3
ignore_after = 60


config.cfg
Code:
[Section1]
email_user = emailuser@address.com
email_pwd = cGFzc3dvcmQ=
email_server = localhost.local
email_port = 587
input_device_index = 5
output_device_index = 5
audio_threshold = 222.86094420380775
tone_offset = 0.0
mp3_bitrate = 32000
bcc = 0
email_priority = 3
audio_channel = mono
email_from = emailuser@address.com
instance_id = none
email_security = STARTTLS
email_authentication = 1
email_send_sequential = none
upload_ftp_server = ftp.yourserver.net
upload_ftp_port = 21
upload_ftp_username =
upload_ftp_password =
upload_file_prefix = http://www.example.come/audio/
upload_ftp_remote_path = /audio/
copy_from_email = 0
start_headless = 1
allow_remote_access = 1
gui_remote_access_port = 8081
record_release_time = 10
iar_api_key =
update_interval = 60.0
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,564
Location
Massachusetts
Fair enough, however the configs in that post actually are from my real configs (with some redactions). The full contents of the current config/tones files are below. There are a few variations from what's in the post above, however these were all made trying to troubleshoot this issue. Both versions have the same problem with cutting off some longer dispatches.

tones.cfg
Code:
[Tone1]
Atone = 669.9
Btone = 617.4
Atonelength = 1
Btonelength = 1
Description = St. 2 - Woodland
record_delay = 0
record_seconds = 0
release_time = 30
playback_during_record = 1
alert_command = curl "https://api.telegram.org/[redacted]/sendMessage?chat_id=[redacted]" --data-urlencode "text=Dispatch for [d]"
post_email_command = curl -F document=@"[mp3]" https://api.telegram.org/[redacted]/sendDocument?chat_id=[redacted]

[Tone2]
Atone = 669.9
Btone = 651.9
Atonelength = 1
Btonelength = 1
Description = St. 3 - Riva
record_delay = 0
record_seconds = 15
release_time = 30
playback_during_record = 1
alert_command = curl "https://api.telegram.org/[redacted]/sendMessage?chat_id=[redacted]" --data-urlencode "text=Dispatch for [d]"
post_email_command = curl -F document=@"[mp3]" https://api.telegram.org/[redacted]/sendDocument?chat_id=[redacted]

[Tone3]
Atone = 707.3
Btone = 651.9
Atonelength = 1
Btonelength = 1
Description = St. 7 - Davidsonville
mp3_Emails = email@address.com
record_delay = 0
record_seconds = 15
release_time = 30
playback_during_record = 1
alert_command = curl "https://api.telegram.org/[redacted]/sendMessage?chat_id=[redacted]" --data-urlencode "text=Dispatch for [d]"
post_email_command = curl -F document=@"[mp3]" https://api.telegram.org/[redacted]/sendDocument?chat_id=[redacted]

[Tone4]
Atone = 669.9
Btone = 553.9
Atonelength = 1
Btonelength = 1
Description = Batallion 3
mp3_Emails = email@address.com
record_delay = 0
record_seconds = 15
release_time = 30
playback_during_record = 1
alert_command = curl "https://api.telegram.org/[redacted]/sendMessage?chat_id=[redacted]" --data-urlencode "text=Dispatch for [d]"
post_email_command = curl -F document=@"[mp3]" https://api.telegram.org/[redacted]/sendDocument?chat_id=[redacted]

[Longtone1]
Longtone = 707.3
Longtonelength = 6
Description = Long Tone Page
amr_emails = email@address.com
record_delay = 2
record_seconds = 15
release_time = 3
ignore_after = 60


config.cfg
Code:
[Section1]
email_user = emailuser@address.com
email_pwd = cGFzc3dvcmQ=
email_server = localhost.local
email_port = 587
input_device_index = 5
output_device_index = 5
audio_threshold = 222.86094420380775
tone_offset = 0.0
mp3_bitrate = 32000
bcc = 0
email_priority = 3
audio_channel = mono
email_from = emailuser@address.com
instance_id = none
email_security = STARTTLS
email_authentication = 1
email_send_sequential = none
upload_ftp_server = ftp.yourserver.net
upload_ftp_port = 21
upload_ftp_username =
upload_ftp_password =
upload_file_prefix = http://www.example.come/audio/
upload_ftp_remote_path = /audio/
copy_from_email = 0
start_headless = 1
allow_remote_access = 1
gui_remote_access_port = 8081
record_release_time = 10
iar_api_key =
update_interval = 60.0
Some things to try as starters:

1. Set both Atone and Btone lengths to 0.6
2. remove the special characters (. -) from your descriptions. Use underscores as separators, i.e., Battalion_3
3. Set all your record_seconds parameters to 30
4. Set all your release_time to 3
5. Add this to your config.cfg: stacked_extend_record = 1
6. In config.cfg set record_release_time = 3

BTW, do you know what version of TTD you are running?
 

xawen

Member
Joined
Feb 20, 2020
Messages
36
Some things to try as starters:

1. Set both Atone and Btone lengths to 0.6
2. remove the special characters (. -) from your descriptions. Use underscores as separators, i.e., Battalion_3
3. Set all your record_seconds parameters to 30
4. Set all your release_time to 3
5. Add this to your config.cfg: stacked_extend_record = 1
6. In config.cfg set record_release_time = 3

BTW, do you know what version of TTD you are running?

Thanks for the reply here. It's been a few days since we've had one of those really long dispatches (probably a good thing since they're usually structure fires), so I haven't been able to test changes. In the mean time:

Running version 74d right now. I've been keeping up with updates while trying to fix this and it's happened across the last 5-6 versions.

1. Set both Atone and Btone lengths to 0.6
I can try this, but my local department actually publishes that the tones are 1 second. Will a shorter tone length mess with detection? That part has been pretty rock solid.
2. remove the special characters (. -) from your descriptions. Use underscores as separators, i.e., Battalion_3
Done
3. Set all your record_seconds parameters to 30
Done
4. Set all your release_time to 3
I will try this, but I have it set long because it's not uncommon for our dispatchers to pause while they get additional information. The long release time helps with that.
5. Add this to your config.cfg: stacked_extend_record = 1
I'll add this, but I haven't seen this one before. Any idea what it does?
6. In config.cfg set record_release_time = 3
Same answer as #4
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,564
Location
Massachusetts
Thanks for the reply here. It's been a few days since we've had one of those really long dispatches (probably a good thing since they're usually structure fires), so I haven't been able to test changes. In the mean time:

Running version 74d right now. I've been keeping up with updates while trying to fix this and it's happened across the last 5-6 versions.

1. Set both Atone and Btone lengths to 0.6
I can try this, but my local department actually publishes that the tones are 1 second. Will a shorter tone length mess with detection? That part has been pretty rock solid.
Better to have your lengths set to slightly less than the published. If your Atone length is set to 1.0 and for some reason the radio/computer only hears 0.9 sec of it, you don't decode. Set it to 0.6 and you will reliably get the decodes. Same for BTone.
2. remove the special characters (. -) from your descriptions. Use underscores as separators, i.e., Battalion_3
Done
3. Set all your record_seconds parameters to 30
Done
4. Set all your release_time to 3
I will try this, but I have it set long because it's not uncommon for our dispatchers to pause while they get additional information. The long release time helps with that.
It is likely that your 30 sec setting here is the root of your problems. Every time there is a bit of radio traffic it resets the timer to wait for 30 more seconds. There is a maximum timeout in the program that I don't remember offhand but the repeating resets of your timer likely are hitting it. Better to set a longer record_seconds and a lower release_time. (better yet, train the dispatchers to be concise)
5. Add this to your config.cfg: stacked_extend_record = 1
I'll add this, but I haven't seen this one before. Any idea what it does?
It was added during some revision to the program and isn't well documented. My understanding is that when it detects stacked tones it doesn't start recording the audio until the last tone is completed, then sends the same audio recording to all the appropriate agencies in the stacked tone sets. Entering this setting will also likely help considerably if you are seeing stacked tones.
6. In config.cfg set record_release_time = 3
Same answer as #4
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,564
Location
Massachusetts
Better to have your lengths set to slightly less than the published. If your Atone length is set to 1.0 and for some reason the radio/computer only hears 0.9 sec of it, you don't decode. Set it to 0.6 and you will reliably get the decodes. Same for BTone.

It is likely that your 30 sec setting here is the root of your problems. Every time there is a bit of radio traffic it resets the timer to wait for 30 more seconds. There is a maximum timeout in the program that I don't remember offhand but the repeating resets of your timer likely are hitting it. Better to set a longer record_seconds and a lower release_time. (better yet, train the dispatchers to be concise)

It was added during some revision to the program and isn't well documented. My understanding is that when it detects stacked tones it doesn't start recording the audio until the last tone is completed, then sends the same audio recording to all the appropriate agencies in the stacked tone sets. Entering this setting will also likely help considerably if you are seeing stacked tones.
According to some program notes that I have found, there is a 60 second timeout on the recorded audio. This is hard-coded in the program and not user-configurable. If your long pages involve stacked tones, then the stacked_extend_record will help.

(Edit) Note also that the stacked_extend_record only works with tone sets that are included in your tones.cfg. If you haven't entered a tone set in your tones.cfg, the program thinks that it is just plain audio.
 

xawen

Member
Joined
Feb 20, 2020
Messages
36
Better to have your lengths set to slightly less than the published. If your Atone length is set to 1.0 and for some reason the radio/computer only hears 0.9 sec of it, you don't decode. Set it to 0.6 and you will reliably get the decodes. Same for BTone.

It is likely that your 30 sec setting here is the root of your problems. Every time there is a bit of radio traffic it resets the timer to wait for 30 more seconds. There is a maximum timeout in the program that I don't remember offhand but the repeating resets of your timer likely are hitting it. Better to set a longer record_seconds and a lower release_time. (better yet, train the dispatchers to be concise)

It was added during some revision to the program and isn't well documented. My understanding is that when it detects stacked tones it doesn't start recording the audio until the last tone is completed, then sends the same audio recording to all the appropriate agencies in the stacked tone sets. Entering this setting will also likely help considerably if you are seeing stacked tones.
Finally had a long page this morning that cut off. This one was 1:10 with some pauses in between some of the tones. It doesn't look like this one stacked tones/pages (I only got a notification for 1 station).

Here's a link if you want to hear the recording.

I'm making the rest of the changes you suggested now to continue testing.
 

MikeOrlando02

Member
Joined
Oct 8, 2015
Messages
97
I have been noticing sporadic issues with my /logfiles/known_hosts file contents being wiped out and the file being empty. This prevents my audio from being uploaded via SFTP. I created a script that periodically checks the /logfiles/heartbeat.txt file and then the contents of the known_host file. Here are my results for the last three months:

2023-04-28 08:31:52,919 (WARNING) - Line:135 - *** knownhosts Repaired ***
2023-05-28 10:16:01,672 (WARNING) - Line:135 - *** knownhosts Repaired ***
2023-06-28 11:23:18,464 (WARNING) - Line:145 - *** knownhosts Repaired ***

This only appears to be occurring on the 28th of each month. Is there some sort of monthly cleanup task or other component built into TTD that runs on the 28th of the month? If so, it seems to be erasing the contents of the /logfiles/known_hosts.
 

xawen

Member
Joined
Feb 20, 2020
Messages
36
Some things to try as starters:

1. Set both Atone and Btone lengths to 0.6
2. remove the special characters (. -) from your descriptions. Use underscores as separators, i.e., Battalion_3
3. Set all your record_seconds parameters to 30
4. Set all your release_time to 3
5. Add this to your config.cfg: stacked_extend_record = 1
6. In config.cfg set record_release_time = 3

BTW, do you know what version of TTD you are running?
Just an update. These settings are definitely working better than what I had originally. I suspect the issue is still there (I see some recordings come really close to cutting off), but these timings seem to run long enough to make up for any weirdness with the release times. A lot more of my recordings run long (multiple dispatches), but I think that's just due to the longer record_seconds parameter. I have not lost the end of a dispatch since I change to these timings. Thanks again for the help, even if I need to tweak further this gives me a much better starting point.
 
Top