TwoToneDetect TwoToneDetect on a Raspberry Pi - How To

Status
Not open for further replies.

Brigs164

Member
Premium Subscriber
Joined
Nov 3, 2010
Messages
5
Location
Marquette
Hey im wonder if this is possible

I want to have a lcd that displays the last page out time and have a relay powering a 12v led light

Ik how to program it but the lcd and relay require the 5v pin on the rPi

I rather not have to use a external power to trigger the relay if any one can help that would be great since im not good with electronics
 

krokus

Member
Premium Subscriber
Joined
Jun 9, 2006
Messages
6,086
Location
Southeastern Michigan
Hey im wonder if this is possible

I want to have a lcd that displays the last page out time and have a relay powering a 12v led light

Ik how to program it but the lcd and relay require the 5v pin on the rPi

I rather not have to use a external power to trigger the relay if any one can help that would be great since im not good with electronics

Add a script, which calls a program to display the current time on the display, and turn on the lamp.

Sent via Tapatalk
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,555
Location
Massachusetts
Get yourself a Sainsmart 4 relay board off Amazon for about $9. Wire it to your pi as shown in the image at: Image - TinyPic - Free Image Hosting, Photo Sharing & Video Hosting Make sure that you remove the jumper across VCC/JDVCC. That utilizes 5 v. to pull the relay in and 3.3 v. to control it. The 5v and 3.3v are separated when the jumper is removed. I have one set up this way and it works like a charm. Some posts talk about exceeding the amp capacity of the pi's 5v. pin if all relays pull in simultaneously. It sounds like you only need one relay, though. Attached is a photo of mine.

You can easily call your python script from the alert_command parameter. Make sure that the script or program is accessible from the folder that TTD is running from. Then it would be something like: alert_command = sudo python blink.py
 
Last edited:

DC31

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

Brigs164

Member
Premium Subscriber
Joined
Nov 3, 2010
Messages
5
Location
Marquette

dancomp

Member
Joined
Jun 19, 2014
Messages
2
Location
Cameron, MO
Problem setting up on PI

Here is a screenshot of the problem that is occurring, everything is setup and configured. When I launch the twotonedetect60api.py program it gets to the point of 'audio_threshold' is not defined, and that is it. Any Ideas on what to do to fix this issue?
 

Attachments

  • pi.jpg
    pi.jpg
    74 KB · Views: 735

nick223

Member
Feed Provider
Joined
Jan 10, 2009
Messages
1,135
Location
Ottawa Illinois
Any idea why this keeps happening to my vnc? It's like the gray screen of death. Every so many months it happens to one of my pis and the only fix is to have to reimage a new sd card.
a2a4ujam.jpg
 

n0nhj

In way too deep...
Feed Provider
Joined
Feb 8, 2004
Messages
356
Location
Lakewood, WA
Errors at the end - not finding audio card?

I've managed to get all the way through to the end, and keep getting a fatal error when I get to running LevelMeter or TwoToneDetect.

This is a new Raspberry B+ I did have to do some install --fix missing when I was installing python

Any suggestions? Only my second project with the Pi, and very little linux experience.
I do see the activity light flashing on the USB audio card briefly when running level meter.
Did try two different models of USB audio cards

Thanks
Chuck

"pi@raspberrypi ~/ttd/dist $ python LevelMeter.pyc
ALSA lib confmisc.c:1286: (snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.front.0:CARD=0'
ALSA lib conf.c:4241: (_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4720: (snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2217: (snd_pcm_open_noupdate) Unknown PCM front
ALSA lib pcm.c:2217: (snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2217: (snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2217: (snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib confmisc.c:1286: (snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround40.0:CARD=0'
ALSA lib conf.c:4241: (_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4720: (snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2217: (snd_pcm_open_noupdate) Unknown PCM surround40
ALSA lib confmisc.c:1286: (snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4241: (_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4720: (snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2217: (snd_pcm_open_noupdate) Unknown PCM surround41
ALSA lib confmisc.c:1286: (snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4241: (_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4720: (snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2217: (snd_pcm_open_noupdate) Unknown PCM surround50
ALSA lib confmisc.c:1286: (snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4241: (_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4720: (snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2217: (snd_pcm_open_noupdate) Unknown PCM surround51
ALSA lib confmisc.c:1286: (snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround71.0:CARD=0'
ALSA lib conf.c:4241: (_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4720: (snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2217: (snd_pcm_open_noupdate) Unknown PCM surround71
ALSA lib confmisc.c:1286: (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:4241: (_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4720: (snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2217: (snd_pcm_open_noupdate) Unknown PCM iec958
ALSA lib confmisc.c:1286: (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:4241: (_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4720: (snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2217: (snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib confmisc.c:1286: (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:4241: (_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4720: (snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2217: (snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib pcm.c:2217: (snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2217: (snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2217: (snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2217: (snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2217: (snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2217: (snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm_dmix.c:957: (snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_dmix.c:1018: (snd_pcm_dmix_open) unable to open slave
FATAL: cannot locate cpu MHz in /proc/cpuinfo

pi@raspberrypi ~/ttd/dist $"
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,555
Location
Massachusetts
I've managed to get all the way through to the end, and keep getting a fatal error when I get to running LevelMeter or TwoToneDetect.

This is a new Raspberry B+ I did have to do some install --fix missing when I was installing python

Any suggestions? Only my second project with the Pi, and very little linux experience.
I do see the activity light flashing on the USB audio card briefly when running level meter.
Did try two different models of USB audio cards

Thanks
Chuck

"pi@raspberrypi ~/ttd/dist $ python LevelMeter.pyc
ALSA lib confmisc.c:1286: (snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.front.0:CARD=0'

ALSA lib pcm_dmix.c:957: (snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_dmix.c:1018: (snd_pcm_dmix_open) unable to open slave
FATAL: cannot locate cpu MHz in /proc/cpuinfo

pi@raspberrypi ~/ttd/dist $"

The TTD-Pi program is incompatible with the most recent update to the Raspian operating system (I believe a June 2014 date). So what you want to do is to image your SD card with an earlier version of the OS to get TTD-Pi to work. Or if you send me a Private Message from this forum, I will send you a link to a copy of my card with the older OS and an operating TTD-Pi program as well as darkice for streaming to RadioReference.
 

phool

Member
Joined
Jul 30, 2014
Messages
8
Was there a lot of tweaking involved in getting darkice and TTD-Pi to co-exist? I'm on my 4th OS after figuring out the lastest Raspiban incompatibility.
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,555
Location
Massachusetts
Was there a lot of tweaking involved in getting darkice and TTD-Pi to co-exist? I'm on my 4th OS after figuring out the lastest Raspiban incompatibility.

Are you using a Model B+ pi by chance? This has complicated things considerably as only the most current OS works on the Model B+ so until some work is done on the program, TTD will not run on a Model B+

I have successfully run darkice on the B+ tonight following G Lyman's installation instructions.

If you have the older Model B (and they are still available) and are running TTD concurrently you need to get the audio from PulseAudio. Here is what my darkice.cfg looks like when also running TTD:

[general]
duration = 0 # duration of encoding, in seconds. 0 means forever
bufferSecs = 5 # size of internal slip buffer, in seconds
reconnect = yes # reconnect to the server(s) if disconnected

# this section describes the audio input that will be streamed
[input]
device = pulse # OSS DSP soundcard device for the audio input
sampleRate = 11025 # sample rate in Hz. try 11025, 22050 or 44100
bitsPerSample = 16 # bits per sample. try 16
channel = 1 # channels. 1 = mono, 2 = stereo

# this section describes a streaming connection to an IceCast2 server
# there may be up to 8 of these sections, named [icecast2-0] ... [icecast2-7]
# these can be mixed with [icecast-x] and [shoutcast-x] sections
[icecast2-0]
bitrateMode = cbr # constant bit rate
bitrate = 16
format = mp3 # format of the stream: mp3
quality = .1 # quality of the stream sent to the server
lowpass = 3000 # low pass filter to save bandwidth
server = audio1.radioreference.com # host name of the server
port = 80 # 8000 port of the IceCast2 server, usually 8000
password = XXXXXXX # stream631 # source password to the IceCast2 server
mountPoint = XXXXXXX #EMR1 # mount point of this stream on the IceCast2 server
name = Franklin County Fire/EMS Shelburne Control # name of the stream
description = Simulcast 1 # description of the stream
url = RadioReference.com - Scanner Frequencies and Radio Frequency Reference # URL related to the stream
genre = Public Safety # genre of the stream
public = yes # advertise this stream?
#localDumpFile = recording.mp3 # local dump file
#fileAddDate = yes
 

phool

Member
Joined
Jul 30, 2014
Messages
8
Nope, I'm using the good ole B model. B+ came out a week after I received the B. I'm going to give it another shot over the weekend here using the instructions I found previously in the forums.

It's been a few years since I really USED linux command line, but it's coming back. I've gotten SSH and XLDE running every time, so confidence is building. Thanks for sharing the config.

I'm also using the January '14 release of raspian too, just for good measure.
 

phool

Member
Joined
Jul 30, 2014
Messages
8
Success! Turns out my $2.06 usb sound device was defective. Tried it on 2 other windows computer, not a single peep was getting in the microphone port. Got a new one today and hand it up and functional within 40 minutes from a fresh raspbian install. Now to tweak and figure out why Gmail isn't passing emails to my sms relay. Thanks!
 

nick223

Member
Feed Provider
Joined
Jan 10, 2009
Messages
1,135
Location
Ottawa Illinois
So my Pi rebooted as scheduled last Friday, and came up with a new "feature"... TTD now sends out audio that sounds like it's being played on fast forward. Here is a sample:

Garbled TTD from Pi on SoundCloud - Hear the world

Anyone have any ideas?


Fastest agency I've ever heard. Sounds like the jimmy johns freaky fast delivery commercial. Lol

Check your audio levels?
 
Status
Not open for further replies.
Top