TwoToneDetect TwoToneDetect on a Raspberry Pi - How To

Status
Not open for further replies.

MDM38

Member
Joined
Oct 23, 2011
Messages
22
When you “ start TTD from terminal on my gui” what exact command are you using? Your error message is showing that when TTD tries to email the attachment that it can’t find the .mp3 file. Usually thus means that ffmpeg isn’t creating it properly.

Does your TTD_B/audio folder contain ANY files?

From terminal I cd to TTD_B and then use: PULSE_SOURCE=alsa_input.usb-0d8c_C-Media_USB_Audio_Device-00-Device_1.analog-mono python TwoToneDetect68Pi.pyc

Yes, my TTD_B folders have "audio" and "logfiles" folders, in addition to config.cfg, LevelMeter.pyc, startTTD_B.sh, tones.cfg, and TwoToneDetect68Pi.pyc

Inside of my audio folder are the mp3s from when I run it on the gui, but nothing from when it runs in screen.
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,547
Location
Massachusetts
If you start it in a detached screen from your Terminal, does it work properly?

PULSE_SOURCE=alsa_input.usb-0d8c_C-Media_USB_Audio_Device-00-Device_1.analog-mono screen -dmS TTD python TwoToneDetect68Pi.pyc

Trying to determine if the problem lies with screen or with the scripts. If the problem is with the scripts, you should be able to achieve autostart on Jessie without them.
 

MDM38

Member
Joined
Oct 23, 2011
Messages
22
If you start it in a detached screen from your Terminal, does it work properly?

PULSE_SOURCE=alsa_input.usb-0d8c_C-Media_USB_Audio_Device-00-Device_1.analog-mono screen -dmS TTD python TwoToneDetect68Pi.pyc

Trying to determine if the problem lies with screen or with the scripts. If the problem is with the scripts, you should be able to achieve autostart on Jessie without them.

Yes, if I start a screen from terminal, start TTD, then detach the screen, it runs correctly and creates and mails an mp3. If I kill the screen and allow cron to run the TTDcheck.sh, it does not work.
 

aaknitt

Member
Feed Provider
Joined
Aug 27, 2005
Messages
1,300
Yes, if I start a screen from terminal, start TTD, then detach the screen, it runs correctly and creates and mails an mp3. If I kill the screen and allow cron to run the TTDcheck.sh, it does not work.
I've run into something similar on Buster. My workaround is to start TTDcheck.sh by adding this line:
Code:
@/home/pi/TTD/TTDcheck.sh

to /etc/xdg/lxsession/LXDE-pi/autostart

I then modified TTDcheck.sh to run forever and check to see if TTD is running once per minute rather than scheduling it to run once per minute through crontab.

Andy
 

MDM38

Member
Joined
Oct 23, 2011
Messages
22
I've run into something similar on Buster. My workaround is to start TTDcheck.sh by adding this line:
Code:
@/home/pi/TTD/TTDcheck.sh

to /etc/xdg/lxsession/LXDE-pi/autostart

I then modified TTDcheck.sh to run forever and check to see if TTD is running once per minute rather than scheduling it to run once per minute through crontab.

Andy

Thank you for the reply. I was able to set everything up with v71 on Stretch instead of Buster and it has been running very well for a few weeks now.
 

MDM38

Member
Joined
Oct 23, 2011
Messages
22
Does anyone know what the middle column of numbers is? The number recently changed from around 2000 to around 30,000. I am trying to narrow down what caused this changes and if it is important to my tone decoding. I recently had DC interference from my scanner power cable and changed to a different cable. I am running version 71c on Stretch.

FFMPEG FOUND
default selected as audio input device
default selected as audio output device

Successfully retrieved local tone info at 08:38:34 on 06/21/20
Successfully retrieved local tone info at 08:38:34 on 06/21/20
Tone1
Successfully retrieved local tone info at 08:38:34 on 06/21/20
939.706463415 32740 1592743267.66
1357.95731707 32767 1592743267.99
744.160609756 32766 1592743268.09
554.046585366 32744 1592743268.2
575.773902439 32767 1592743268.53
401.955365854 32753 1592743268.64
1493.75304878 32702 1592743268.75
1167.84329268 32183 1592743269.07
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,547
Location
Massachusetts
It is a measure of volume. 32K is top end. Try turning the volume of your scanner down a little.
 

MDM38

Member
Joined
Oct 23, 2011
Messages
22
It is a measure of volume. 32K is top end. Try turning the volume of your scanner down a little.

Thank you. While trying to troubleshoot another issue, I had unplugged and reconnected the USB sound card. When I did this, it reset my settings is pulseaudio,which I had not noticed, which resulted in the high volume level. I have reset the pulse audio levels which resolved the issue.

I know the first column is the tone frequency, the middle is the volume, but what is the third column?
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,547
Location
Massachusetts
Thank you. While trying to troubleshoot another issue, I had unplugged and reconnected the USB sound card. When I did this, it reset my settings is pulseaudio,which I had not noticed, which resulted in the high volume level. I have reset the pulse audio levels which resolved the issue.

I know the first column is the tone frequency, the middle is the volume, but what is the third column?
Timestamp
 

csantella

Newbie
Joined
May 29, 2020
Messages
4
After running for a few days, my TTD stopped and has the final line of "bye!" in the log. Any ideas? Found the Pi still running, but TTD was not.
 

aaknitt

Member
Feed Provider
Joined
Aug 27, 2005
Messages
1,300
After running for a few days, my TTD stopped and has the final line of "bye!" in the log. Any ideas? Found the Pi still running, but TTD was not.
Sounds like you're running a slightly older version. In that case, make sure you have the "Start Headless" box checked. Otherwise when you close the browser window of the GUI TTD will close. The "bye" message gets printed when the browser window closes.

Andy
 

Mark181

Member
Feed Provider
Joined
Jun 18, 2020
Messages
37
Location
Ocean County, NJ
Hi, I'm trying to get Record Delay to work on my Two-Tone Detect on a Raspberry Pi using the latest TTD IMG running TTD73f, but it's not working. I tried saving the setting and rebooting, but that still did not work. Can anyone help or have any suggestions?
 

aaknitt

Member
Feed Provider
Joined
Aug 27, 2005
Messages
1,300
Hi, I'm trying to get Record Delay to work on my Two-Tone Detect on a Raspberry Pi using the latest TTD IMG running TTD73f, but it's not working. I tried saving the setting and rebooting, but that still did not work. Can anyone help or have any suggestions?
It's a bug. It'll be fixed in the next release.

Andy
 

ealbright

Newbie
Joined
Nov 8, 2020
Messages
3
Hello all! Has anyone been able to get TwoToneDetect73f running on a pi4 with Buster? I had been running 71c on a pi 3 but it started having issues so I decided to update to a pi4. Initially I tried running the 71c from the pi3 but it was giving the same issue of locking up. I’ve ran through all of the issues getting sound setup ( compiling ffmpeg from source) and it works with the 71c version. What I am seeing when I start 73f are the normal alsa warnings and the last thing before I’m returned to a prompt is an error with flush.

I’m a little lost at this point. So has anyone been able to get 73f running?
 

ealbright

Newbie
Joined
Nov 8, 2020
Messages
3
I found the fix for the issue in another thread:


If anyone else is fighting this, the way the config is being read has changed and all comments have to be removed.

Hello all! Has anyone been able to get TwoToneDetect73f running on a pi4 with Buster? I had been running 71c on a pi 3 but it started having issues so I decided to update to a pi4. Initially I tried running the 71c from the pi3 but it was giving the same issue of locking up. I’ve ran through all of the issues getting sound setup ( compiling ffmpeg from source) and it works with the 71c version. What I am seeing when I start 73f are the normal alsa warnings and the last thing before I’m returned to a prompt is an error with flush.

I’m a little lost at this point. So has anyone been able to get 73f running?
 

AFD103

Member
Premium Subscriber
Joined
Nov 17, 2020
Messages
26
Been running 71c on a Windows box for several months without much of a problem. Want to try to reduce the footprint and switch to a Raspberry Pi. Downloaded the image referenced above and got 73f running. Kind of.

When sending email to multiple recipients, it'll throw a SMTPRecipientsRefused error if "Send Emails Sequentially" is set to ALL. If set to NONE, the messages will be delivered OK. Loaded 73d, and the same error occurred. Loaded 71c with the same config files, and everything works ok. This occurs on both the Win and the X versions. I don't know python and sendmail THAT well, but maybe the list isn't being passed properly?

Debug messaging from windows debug exe as follows:

setting mail server up
set up mail server
starting TLS
done starting TLS
logging in
logged in
Traceback (most recent call last):
File "TwoToneDetect73f.py", line 1427, in mail
File "smtplib.py", line 881, in sendmail
smtplib.SMTPRecipientsRefused: {}
Email not sent via mail.twc.com on port 587 using STARTTLS on attempt 1 trying again in five seconds for Test
Traceback (most recent call last):
File "TwoToneDetect73f.py", line 1356, in mail
ValueError: list.remove(x): x not in list
Email not sent via mail.twc.com on port 587 using STARTTLS on attempt 2 trying again in five seconds for Test
Traceback (most recent call last):
File "TwoToneDetect73f.py", line 1356, in mail
ValueError: list.remove(x): x not in list
Email not sent via mail.twc.com on port 587 using STARTTLS on attempt 3 trying again in five seconds for Test
max retries exceeded, failed to send email
 

aaknitt

Member
Feed Provider
Joined
Aug 27, 2005
Messages
1,300
Been running 71c on a Windows box for several months without much of a problem. Want to try to reduce the footprint and switch to a Raspberry Pi. Downloaded the image referenced above and got 73f running. Kind of.

When sending email to multiple recipients, it'll throw a SMTPRecipientsRefused error if "Send Emails Sequentially" is set to ALL. If set to NONE, the messages will be delivered OK. Loaded 73d, and the same error occurred. Loaded 71c with the same config files, and everything works ok. This occurs on both the Win and the X versions. I don't know python and sendmail THAT well, but maybe the list isn't being passed properly?

Debug messaging from windows debug exe as follows:

setting mail server up
set up mail server
starting TLS
done starting TLS
logging in
logged in
Traceback (most recent call last):
File "TwoToneDetect73f.py", line 1427, in mail
File "smtplib.py", line 881, in sendmail
smtplib.SMTPRecipientsRefused: {}
Email not sent via mail.twc.com on port 587 using STARTTLS on attempt 1 trying again in five seconds for Test
Traceback (most recent call last):
File "TwoToneDetect73f.py", line 1356, in mail
ValueError: list.remove(x): x not in list
Email not sent via mail.twc.com on port 587 using STARTTLS on attempt 2 trying again in five seconds for Test
Traceback (most recent call last):
File "TwoToneDetect73f.py", line 1356, in mail
ValueError: list.remove(x): x not in list
Email not sent via mail.twc.com on port 587 using STARTTLS on attempt 3 trying again in five seconds for Test
max retries exceeded, failed to send email
There's a bug with the sequential sending in v73f. It'll be fixed in the next release.

Andy
 
Status
Not open for further replies.
Top