TwoToneDetect TwoToneDetect on a Raspberry Pi - How To

Status
Not open for further replies.

rgeldart

Member
Premium Subscriber
Joined
Mar 13, 2015
Messages
15
Location
Truro, Nova Scotia
Hi all, I believe I fixed my issue. Here's my solution in case anyone else has this problem.

On my Pi3, I run a script called radiosave. What it does is records the scanner input and splits it up into mp3 files on the hour. It uses pulse audio to function. (in case you want to try it, you can get the script for free here: https://sites.google.com/site/glyman3home/radiosave

Anyhow, the problem was (I think) that I had cron jobs set for everything (TTD & darkice running in separate bash screen sessions, radiosave set to fire without screen in the background)

What happened was radiosave was firing first and hijacking pulse audio. so all I did was change the crontab line from:

# Added radio save config
@reboot [ -x /home/pi/radiosave.sh ] && /home/pi/radiosave.sh start > /dev/null
00 * * * * [ -x /home/pi/radiosave.sh ] && /home/pi/radiosave.sh cron > /dev/null

to

# Added radio save config
@reboot /bin/sleep 120 ; [ -x /home/pi/radiosave.sh ] && /home/pi/radiosave.sh start > /dev/null
00 * * * * [ -x /home/pi/radiosave.sh ] && /home/pi/radiosave.sh cron > /dev/null

after reboot, that seemed to help. Adding a sleep for 120 seconds to radio save allowed TTD to fire first grabbing PA.

Anyhow, hope that helps someone who has similar issues. PA is finicky.

PS: If anyone is thinking about running radiosave, I would highly recommend you look at running a external hard drive and either saving the mp3's and tmp files to the external or running your entire OS directly from the hard drive as the read/write cycles that are created from recording audio can burn your SD card up quite quickly.

Have a great week.
 

davidVT

Member
Feed Provider
Joined
Aug 29, 2010
Messages
138
Location
Washington County,Vermont
Hello All, anyone try TTD on the new Raspian 'Stretch'?
I thought I read the audio support has changed (pulse audio not installed by default) which makes me wonder if TTD will still work 'out of the box'??


Sent from my iPad using Tapatalk
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,547
Location
Massachusetts
Hello All, anyone try TTD on the new Raspian 'Stretch'?
I thought I read the audio support has changed (pulse audio not installed by default) which makes me wonder if TTD will still work 'out of the box'??


Sent from my iPad using Tapatalk

DavidVT: I saw the same note about PA not being included with Stretch. However, other notes indicated that it could still be installed manually. I think that you are right TTD/Stretch won't work "out of the box" on the pi. I will try it sometime but it may be at least a couple weeks.

Jim
 

KD0BML

Member
Feed Provider
Joined
Jan 7, 2008
Messages
54
Hello all,

Is there a working Pi3 B image out there yet. I surfed through the thread here and didn't see one. The image works great on my Pi2 B with the same hardware. All kinds of issues on the Pi3.

Thanks.
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,547
Location
Massachusetts
It runs on a pi3 but takes several tweaks to get it there and to keep it running. Mostly related to pulseaudio. If you want to give it a go, here are some steps from memory to get you started:

1. Image an SD card with the full version of Raspbian Stretch

2. Do a sudo update and reboot.

3. Install pulse audio. You can do thus using Add Programs under Preferences/Pi configuration or at comand line sudo apt install pulseaudio

4. Install pulse audio volume control. Again, either Preferences or command line sudo apt install
pavucontrol.

5. Make a TTD directory

6. Populate the TTD directory with the TTD version and files of your choice from the .zip download from the TwoToneDetect website. Use the linux version of TTD, NOT the one identified specifically for the pi. You will also need tones.cfg, config.cfg, and TTD.cfg.

7. Create a blank file simply named ffmpeg in the TTD directory.

8. Reboot again

9. Try starting pavucontrol, from command line it is pavucontrol, or in the dropdown under the pi icon under Sound.

10. If you get an error message, close it out, go to the command line and type pulseaudio -D

11. Then try starting pavucontrol again. Hopefully, you won’t get the error message.

12. Once you get pavucontrol running, then open a terminal window, cd to your TTD directory, then start TTD by typing python TwoToneDetect69.pyc or whatever your linux program file is called

13. Cross your fingers...

Let me know how it goes, if anyone tries it. There are several more steps to get it to auto start etc. but those won’t help if you can’t make it run from the command line

Jim
 

dwhitesel

Newbie
Joined
Aug 25, 2010
Messages
3
Location
Amelia, Virginia
Trying to get TTD running on RPi 3B...

Hey all...

I'm trying, unsuccessfully, to get TTD running on a RPi 3B.

I tried the pre-configured image route first. The Pi wouldn't even boot with that image. It just hung on the rainbow square screen.

I decided to start from scratch following the instructions at twotonedetect.net.

Everything went fine as per the instructions. The only real difference being that, when I run LevelMeter.pyc, there is no input/output named "pulse".

Code:
AUDIO DEVICE LISTING:
Output Device 0: bcm2835 ALSA: - (hw:0,0)
Output Device 1: bcm2835 ALSA: IEC958/HDMI (hw:0,1)
Input Device 2: USB PnP Sound Device: Audio (hw:1,0)
Output Device 2: USB PnP Sound Device: Audio (hw:1,0)
Output Device 3: sysdefault
Output Device 4: dmix
Input Device 5: default
Output Device 5: default

It appears #5 "default" appears to be the correct one.

Choosing that, I was able to verify that LevelMeter.py is getting audio from the USB device, as the data stream updates as expected in response to audio input.

The problem occurs when I try to launch TwoToneDetect68Pi.pyc.

Code:
pi@raspberrypi:~/TTD $ python TwoToneDetect68Pi.pyc
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.front.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM front
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround40.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround40
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround41
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround50
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround51
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround71.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround71
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM iec958
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'defaults.bluealsa.device'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4996:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM bluealsa
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'defaults.bluealsa.device'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4996:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM bluealsa
connect(2) call to /tmp/jack-1000/default/jack_0 failed (err=No such file or directory)
attempt to connect to server failed
Traceback (most recent call last):
  File "TwoToneDetect68Pi.py", line 182, in <module>
IndexError: list index out of range
Succesfully retrieved local tone info at 21:35:23 on 11/07/17
Succesfully retrieved local tone info at 21:35:23 on 11/07/17
Tone1
Tone2
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.front.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM front
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround40.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround40
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround41
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround50
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround51
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround71.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround71
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM iec958
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'defaults.bluealsa.device'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4996:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM bluealsa
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'defaults.bluealsa.device'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4996:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM bluealsa
connect(2) call to /tmp/jack-1000/default/jack_0 failed (err=No such file or directory)
attempt to connect to server failed
Traceback (most recent call last):
  File "TwoToneDetect68Pi.py", line 1038, in <module>
NameError: name 'input_device' is not defined
Traceback (most recent call last):
  File "TwoToneDetect68Pi.py", line 1071, in <module>
  File "TwoToneDetect68Pi.py", line 1050, in record
NameError: global name 'stream' is not defined
pi@raspberrypi:~/TTD $

When I ran LevelMeter.pyc, pretty much all of the same warnings/errors were displayed, yet it still functioned.

The log files created contain this.

Code:
Traceback (most recent call last):
  File "TwoToneDetect68Pi.py", line 182, in <module>
IndexError: list index out of range
Succesfully retrieved local tone info at 21:51:05 on 11/07/17
Succesfully retrieved local tone info at 21:51:05 on 11/07/17
Tone1
Tone2
Traceback (most recent call last):
  File "TwoToneDetect68Pi.py", line 1038, in <module>
NameError: name 'input_device' is not defined

So, I'm assuming that's the indication of where the magic smoke is being let out.

Anyone have any thoughts on where to go from here?




Here are the config.cfg and tones.cfg files that I'm using. (with sensitive info removed)

Code:
[Section1]
email_user = xxxxx@xxxxxxx.net   ;user id to log in to email account used for sending emails
email_pwd = xxxxxxxxxxxx     ;password to log into email account used for sending emails encoded in base64
email_server = mail.xxxxxxx.net  ;SMTP server address of email provider
email_port = 587                 ;port to access email server with
record_seconds = 30              ;number of seconds of audio to record after a valid tone set is found
record_delay = 6	         ;number of seconds to wait after a tone set is found before starting to record
tone_tolerance = 0.02            ;tolerance of tone detection algorithm  1% = .01
input_device_index = 5           ;index of audio input device
output_device_index = 5          ;index of audio output device
audio_threshold = 1000           ;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 BCCed (hidden from other recipients). 0 = recipients will see other recipients
email_priority = 3               ;priority of email (1=highest, 3=normal, 5=lowest)
release_time= 3.0                 ;amount of silence (in seconds) required before recording will stop (max=60 seconds)
audio_channel = mono
email_from = emailuserid
update_interval = 60.0
stacked_extend_record = 1



Code:
[Tone1]							
Atone = 328						;A tone frequency in Hz
Btone = 349						;B tone frequency in Hz
Atonelength = 1					;Length of A tone (in seconds) that must be seen to generate an alert
Btonelength = 3					;Length of B tone (in seconds) that must be seen immediately following the A tone in order to generate an alert
Description = Test tone 1	 		;Tone set description
text_Emails = xxxxx@xxxxxxx.net			;Email address to send an immediate message with no audio attachment upon tone detection. Separate with commas
mp3_Emails = xxxxx@xxxxxxx.net				;Email addresses to send mp3 attachment to.  Separate with commas
amr_Emails = email2@address2.com			;Email addresses to send AMR attachment to.  Separate with commas
record_delay = 0					;Optional parameter.  Number of seconds to wait to record after a valid tone set is detected
ignore_after = 60					;Optional parameter.  Number of seconds to ignore tone set after a valid set is detected.  
;alert_command = c:\test.bat				;Optional parameter.  Command to run immediately after the tone is detected
;post_email_command = c:\test2.bat			;Optional parameter.  Command to run after tone has been detected and emails have been sent

[Tone2]							
Atone = 570						;A tone frequency in Hz
Btone = 600						;B tone frequency in Hz
Atonelength = 1					;Length of A tone (in seconds) that must be seen to generate an alert
Btonelength = 3					;Length of B tone (in seconds) that must be seen immediately following the A tone in order to generate an alert
Description = Test tone 2				;Tone set description
text_Emails = xxxxx@xxxxxxx.net			;Email address to send an immediate message with no audio attachment upon tone detection. Separate with commas
mp3_Emails = xxxxx@xxxxxxx.net				;Email addresses to send mp3 attachment to.  Separate with commas
amr_Emails = email2@address2.com			;Email addresses to send AMR attachment to.  Separate with commas
record_delay = 0					;Optional parameter.  Number of seconds to wait to record after a valid tone set is detected
ignore_after = 60					;Optional parameter.  Number of seconds to ignore tone set after a valid set is detected.  
;alert_command = c:\test.bat				;Optional parameter.  Command to run immediately after the tone is detected
;post_email_command = c:\test2.bat			;Optional parameter.  Command to run after tone has been detected and emails have been sent

;[Tone2]							
;Atone = 617.3						;A tone frequency in Hz
;Btone = 688.8						;B tone frequency in Hz
;Atonelength = .6					;Length of A tone (in seconds) that must be seen to generate an alert
;Btonelength = .6					;Length of B tone (in seconds) that must be seen immediately following the A tone in order to generate an alert
;Description = Fire Department 2				;Tone set description
;mp3_Emails = email@address.com				;Email addresses to send mp3 attachment to.  Separate with commas

;[Longtone1]
;Longtone = 707.3						;Long tone frequency in Hz
;Longtonelength = 8						;Length of Long Tone (in seconds) that must be seen to generate an alert
;Description = Long Tone Page					;Long tone description
;amr_emails = email@address.com					;Email addresses to send AMR attachment to.  Separate iwth commas
;ignore_after = 60						;Optional parameter.  Number of seconds to ignore tone set after a valid set is detected.  

;ADD MORE TONE SETS HERE USING THE SAME FORMAT AS ABOVE
 

aaknitt

Member
Feed Provider
Joined
Aug 27, 2005
Messages
1,300
Hey all...
Everything went fine as per the instructions. The only real difference being that, when I run LevelMeter.pyc, there is no input/output named "pulse".

This is the root cause of your issues. The "Pi" version of TTD has been hard-coded to look for the "pulse" audio source. With Raspbian Stretch, that no longer works. I'm hoping to address this issue with the v70 TTD release, but don't quite have the Pi stuff 100% robust in the beta version I'm currently testing.

As DC31 previously suggested, you can run the "non-Pi" version on Rasbpian Stretch via the GUI...that will let you select the audio source you want TTD to use until I get the command line version working with the changes to the Stretch OS.

Andy
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,547
Location
Massachusetts
RPi3

Here us what TTD running on a pi3 looks like (gui version). This happens to be the beta of v70 that Andy is testing.
 
Last edited:

dwhitesel

Newbie
Joined
Aug 25, 2010
Messages
3
Location
Amelia, Virginia
Hey guys. Thanks for the quick response.

So, yes. The GUI version came right up and started reading an audio stream. Here's where I'm at thus far.

It appears the audio threshold has to be set manually each time TTD is launched. Is this just a limitation of running the non-Pi version?

It successfully detected a test tone set and sent an email. However, it appears to not be finding ffmpeg. Is this also a known issue with the non-Pi version?

Code:
WAV Group Email sent to xxxxx@xxxxxxx.net via mail.xxxxxxx.net on port 587 using STARTTLS Test tone 1 page received at 20:48:29 on 11/09/17 20:50:55 on 11/09/17
ffmpeg not found, AMR email not sent!

Thanks again for the assistance. I was asked to help in setting up TTD on a RPi by a member of the local fire department. As I understand it, he's been running TTD on an old laptop for several years now, but is concerned that it is on it's last leg. I offered my services, as I am very familiar with Linux and have recently started getting into RPi and Arduino development.
 

KD0BML

Member
Feed Provider
Joined
Jan 7, 2008
Messages
54
So I managed to finally get it running on a Pi 3B. Instead of using stretch I went back and used an older version of Jessie. Followed the instructions on the TTD Pi page, then copied the startup scripts and cron info from the TTD Pi Image with a few directory changes and it's alive! Also was able to get DarkIce configured to run with it.

Another question though. Does the Pi version support left/right mono channels? Was hoping to be able to run 2 instances one for left and one for right channel.

Thanks
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,547
Location
Massachusetts
So I managed to finally get it running on a Pi 3B. Instead of using stretch I went back and used an older version of Jessie. Followed the instructions on the TTD Pi page, then copied the startup scripts and cron info from the TTD Pi Image with a few directory changes and it's alive! Also was able to get DarkIce configured to run with it.

Another question though. Does the Pi version support left/right mono channels? Was hoping to be able to run 2 instances one for left and one for right channel.

Thanks

Yes, it does. In the config.cfg file, you can set it using the audio_channel = parameter. Acceptable entries are mono, left, or right

Jim
 

dwhitesel

Newbie
Joined
Aug 25, 2010
Messages
3
Location
Amelia, Virginia
Success!

I had to remove the ffmpeg package that I installed per the Raspberry Pi install instructions and install ffmpeg through the distro package manager. But it does work now.

So, is there any time frame on an updated RPi version?

Also, is there a recommended method for automatically restarting the GUI version if/when it crashes? Are program crashes that common now? I had read in previous threads that older versions were crashing once or twice a week?

Thanks again the assistance.
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,547
Location
Massachusetts
Success!

I had to remove the ffmpeg package that I installed per the Raspberry Pi install instructions and install ffmpeg through the distro package manager. But it does work now.

So, is there any time frame on an updated RPi version?

Also, is there a recommended method for automatically restarting the GUI version if/when it crashes? Are program crashes that common now? I had read in previous threads that older versions were crashing once or twice a week?

Thanks again the assistance.

Glad to hear that you had success! My GUI version has been stable with a daily reboot of the pi. I did experience the program locking up once or twice without the daily reboot. My pi3 runs two instances of TTD and two instances of Darkice streaming to Broadcastify.
 

BigRedBox80

Member
Feed Provider
Joined
Apr 23, 2015
Messages
170
I'm having some issues with the redundant feature and I'm not sure why. I'm getting double messages sent.


Code:
[REDUNDANT]
file_access = ftp				;options are 'local' or 'ftp'
tone_tracking_file = redundant_tones_1.txt	;for local, use: c:\path\to\filename.txt
TTD_tracking_file = redundant_TTD_1.txt	;for local, use: c:\path\to\filename.txt
redundant_delay = 0				;number of seconds to wait before checking file after a tone set is found.  For primary TTD, set to 0 
redundant_window = 60				;number of seconds to allow timestamps between two tone sets to be different and still be considered the same tone
redundant_down_alert_time = 400			;number of seconds before the admin will be alerted that an instance of the program is offline
redundant_admin_email = email@address.co		;email address to send notifications to
redundant_instance_alias = Station		;Alias to identify this instance of TTD
FTP INFO HERE

Code:
[REDUNDANT]
file_access = ftp				;options are 'local' or 'ftp'
tone_tracking_file = redundant_tones_1.txt	;for local, use: c:\path\to\filename.txt
TTD_tracking_file = redundant_TTD_1.txt		;for local, use: c:\path\to\filename.txt
redundant_delay = 70				;number of seconds to wait before checking file after a tone set is found.  For primary TTD, set to 0 
redundant_window = 60				;number of seconds to allow timestamps between two tone sets to be different and still be considered the same tone
redundant_down_alert_time = 400			;number of seconds before the admin will be alerted that an instance of the program is offline
redundant_admin_email = email@address.co		;email address to send notifications to
redundant_instance_alias = Backup             ;Alias to identify this instance of TTD
FTP INFO HERE

Clocks are in sync within milliseconds of each other.

Logs from the Backup device
Code:
FireDept Tone Set Found
delay timer FireDept 13:16:22 on 11/16/17

delay done FireDept 13:16:23 on 11/16/17
waiting for audio FireDept 13:16:23 on 11/16/17
threshold value: 181.019335984
mono

threshold exceeded
recording audio FireDept 13:16:23 on 11/16/17
iterations: 400

checking redundant_TTD_1.txt on ftp.domain.net at 13:16:46 on 11/16/17
['Backup TTD\t1510859673.09\n', 'Station\t1510859750.99\n']
found a duplicate for Backup TTD at 1510859673.09
['Backup TTD\t1510859807.37\n', 'Station\t1510859750.99\n']


Waiting for Silence FireDept 13:17:00 on 11/16/17
Done recording FireDept 13:17:00 on 11/16/17

done writing WAV FireDept 13:17:00 on 11/16/17

done converting to MP3 FireDept 13:17:00 on 11/16/17

done converting to AMR FireDept 13:17:02 on 11/16/17

waiting 70 seconds to check remote redundant_tones_1.txt file on ftp.domain.net for FireDept

checking redundant_tones_1.txt on ftp.domain.net for FireDept at 13:18:12 on 11/16/17
sending from backup with delay = 70 at 13:18:13 on 11/16/17
logging in
logged in
MP3 Group Email sent to "Person"<jwr@domain.com>, "Whos"<FireDeptfire@ds1.whosresponding.com> 
logging in
logged in
successfully updated redundant_tones_1.txt on ftp.domain.net with FireDept at 13:18:15 on 11/16/17

Text Group Email sent to "Whos"<FireDeptfire-160301@ds1.whosresponding.com> 
checking redundant_TTD_1.txt on ftp.domain.net at 13:19:01 on 11/16/17
['Backup TTD\t1510859807.37\n', 'Station\t1510859885.91\n']
found a duplicate for Backup TTD at 1510859807.37
['Backup TTD\t1510859941.76\n', 'Station\t1510859885.91\n']
 

motomeso

Member
Premium Subscriber
Joined
Dec 19, 2002
Messages
952
Location
Ontario
I'm actually looking for a RPi3 image with the Gui that was mentioned above. I will try installing the Jessie version and see where I get.
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,547
Location
Massachusetts
I'm actually looking for a RPi3 image with the Gui that was mentioned above. I will try installing the Jessie version and see where I get.

No, there is no preconfigured pi3 image out there that I know of. Have you tried the 13 steps outlined in my previous post of Nov. 7?
 

motomeso

Member
Premium Subscriber
Joined
Dec 19, 2002
Messages
952
Location
Ontario
I've got your Ubuntu image running with TTD but still no luck on getting the PiPeater running.
 
Status
Not open for further replies.
Top