Using Python to Update Icecast Scanner Audio Feeds with a Raspberry Pi

Status
Not open for further replies.

JWFoxJr

Member
Feed Provider
Joined
Jul 13, 2009
Messages
3
Location
West Seneca, NY
Brandon -

Thanks for the help. After making the changes I need (username, password, etc), I am able to send the frequency data to RadioReference, but not the alpha tag. I was also going to add your block from an earlier post to add "Scanning..." for when the scanner is "idle" (as in not locked on a channel).

This is what I'm seeing on my Pi:

Code:
Sat Jan  3 05:32:02 2015
Icecast Update OK  
424.0875
Sat Jan  3 05:32:02 2015
Icecast Update OK  
423.9875
Sat Jan  3 05:32:03 2015
Icecast Update OK  
453.6250
I know that you said you would need access to a Pro2052 to be able to debug and test. Would it help if I gave you an account on my Pi so that you could access the scanner?

From what I'm seeing it doesn't look like the the lookup table or the logging is working.

PM if you want an account, and I'll get you set up.

Thanks.
Joe
 

Mick83002

Member
Joined
Oct 17, 2012
Messages
9
Location
Jackson, Wyoming
Two questions; has anyone really ever gotten this to work??? I have far more hours in it than it could ever be worth. Also, if you have gotten it to work, have you been able to get it to work on a web page. So that you can just call up a web page and have the audio along with the channel information show up on the page as it receives???
 

kb2ear

Member
Premium Subscriber
Joined
Jan 9, 2004
Messages
14
Location
New Jersey
So what is missing to get gre scanners to work? I have the cable plugged in to my pi and it show up as ttyUSB1
 

bbrasmussen

Member
Premium Subscriber
Joined
Dec 14, 2007
Messages
140
Location
Woods Cross, UT
When I tried to get my RS Pro-106 to talk, it did it through a RS USB cable/adapter using it's own protocol - not purely serial. It showed up as USBtty1 but didn't communicate. If GRE scanners don't use this adapter and use serial then it should work. Otherwise you need a Linux driver for the RS USB scanner cable to make it work. I don't have a GRE-branded scanner, just the GRE-manufactured Pro-106.
 

bnewhouse

Newbie
Feed Provider
Joined
Dec 25, 2006
Messages
3
Location
Sault Ste. Marie, MI
alright, im having trouble with "sudo apt-get install python-serial, python-requests" its giving me an error message.

E: unable to locate package python-serial.

and

$ python metaPy.py &
I get

Traceback (most recent call last):
File "metaPy.py", line 5, in <module>
import requests
ImportError: No module named requests
 

celbaseman

Member
Feed Provider
Joined
Feb 2, 2003
Messages
169
Location
Poway, CA
I have been running a RasPi on my feed for a couple of months, works fine. I am trying to add the alpha tags from my BCD 996xt. When the python app runs I get an error Icecast Update Error 401.

pi@bcfypi1 ~ $ python metaPy.py
SD CITY FIRE 5008 DISP 7B
Sun Dec 6 20:05:53 2015
Icecast Update Error 401


A couple issues in the python file I have questions about are:

1 Asks for icecastUser, is this different from the mount ID?

2. Can the audio server listed on broadcastify be used or do I need the IP of the server?
 

celbaseman

Member
Feed Provider
Joined
Feb 2, 2003
Messages
169
Location
Poway, CA
I must apologize, this happens even at work. I ask someone a question then I read the instructions one more time and realize my error.

I looked and saw where to put source in the user name.

Now it works.

pi@bcfypi1 ~ $ python metaPy.py
SD CITY FIRE 5168 ADMIN 7A
Sun Dec 6 20:22:06 2015
Icecast Update OK
 

goaliebob99

Member
Joined
Apr 7, 2006
Messages
18
Location
Tucson, AZ
For those of you with the BCD996P2 how are you getting the USB cable to be recognized on the Rasp Pi? Mine doesn't seem to recognize it. Also, how do you get your icecast feed back to radio reference?

I am assuming that you all are doing darkice to icecast then icecast to broadcasify.
 

goaliebob99

Member
Joined
Apr 7, 2006
Messages
18
Location
Tucson, AZ
Ok So I am able to see the USB via the lsusb command. I can see it on bus 001 device 008 ID 1965:001a I am unsure how to mount it to ttyusb
 

goaliebob99

Member
Joined
Apr 7, 2006
Messages
18
Location
Tucson, AZ
Ok Progress... So it turns out that the scanner is there.. just a bit hidden.

You have to go into the serial folder, then the byid folder and the scanner is listed there. So I was able to get the script to run on my 996p2, but this is the output. Anyone know what this is about.

Simulcast B 18034 PCSO South-1
Traceback (most recent call last):
File "metaPy.py", line 91, in <module>
updateData(metadata)
File "metaPy.py", line 73, in updateData
r = requests.get((requestToSend), auth=(icecastUser,icecastPass))
File "/usr/lib/python2.7/dist-packages/requests/api.py", line 60, in get
return request('get', url, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/api.py", line 49, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 457, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 569, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 407, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', error(111, 'Connection refused'))

It gets the most recent call then crashes.
 

goaliebob99

Member
Joined
Apr 7, 2006
Messages
18
Location
Tucson, AZ
Ok Progress... So it turns out that the scanner is there.. just a bit hidden.

You have to go into the serial folder, then the byid folder and the scanner is listed there. So I was able to get the script to run on my 996p2, but this is the output. Anyone know what this is about.

Simulcast B 18034 PCSO South-1
Traceback (most recent call last):
File "metaPy.py", line 91, in <module>
updateData(metadata)
File "metaPy.py", line 73, in updateData
r = requests.get((requestToSend), auth=(icecastUser,icecastPass))
File "/usr/lib/python2.7/dist-packages/requests/api.py", line 60, in get
return request('get', url, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/api.py", line 49, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 457, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 569, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 407, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', error(111, 'Connection refused'))

It gets the most recent call then crashes.
It turned out to be a configuration issue. Got it working finally.

For review.

Setup darkice to stream to icecast. Once that is setup, locate the path to your serial device. My raspi set the USB connection from my BCD996p2 under:

" /dev/serial/by-id/usb-UNIDEN_AMERICA_CORP._BCD996P2_Serial_Port_if00"

Once you have the path setup correctly in the script, you can now run it and it works. Make sure that you have your user name / pass and mount points set correctly otherwise it wont work correctly.

All is working correctly. Now I just need to get the people at Broadcastify my info so they can pull my stream.
 

nick223

Member
Feed Provider
Joined
Jan 10, 2009
Messages
1,100
Location
Ottawa Illinois
I had my 996p2 working for the longest time on /dev/ttyACM0 now in the last few days it just stopped any ideas?
 

121940kz

Member
Joined
Aug 3, 2014
Messages
80
Does anyone have the original instructions and script that were on this site http://www.k7bbr.net/projects/metapy.htm

It appears that the site pages were taken down. I would like to try and get the python script running with my GRE-PSR500. I have the original radio shack serial cable.
 

121940kz

Member
Joined
Aug 3, 2014
Messages
80
Alpha Tags Working on PSR-500 and Raspberry Pi!!

Hey all, was wondering if anyone would like to test out the new script that i wrote for the GRE PSR-500 scanners (Pro-106 and Pro-197 and PSR-600) to get alpha tags working on the Raspberry pi. It's been working great for me for the past 4 days, so i would like others to test it as well, mainly on the other scanners listed. Theoretically it should work on the pro-106 and 197.

It turns out that the default drivers on the raspberry pi should work for the radioshack serial cable. I didn't have to do any messing with that, however i did run a raspberry pi update. Special thanks to Brandon Rasmussen who provided me with the file that he created which works for the Uniden scanners. I used his code to send the updates to the broadcastify servers, but pretty much scratched everything else due to the difference in scanner communication.

Plug in your serial cable to the scanner and to the Pi, and then copy the attached file somewhere on it. From the directory it is in, run python GreTags.py and see what happens. I would like to know if this works for the Pro 106, Pro 197, and PSR 600. Those are all pretty much the same scanners. I am unsure of any other Radioshack scanners so i would not be surprised if any others did not work.

Please provide me some feedback! Thanks
 

Attachments

bkcarter333

Member
Joined
Apr 22, 2006
Messages
3
Location
Kaysville, Utah
Did you get this working?

I have a Pro-197 that I am testing your script on. It appears to be working, but I am wondering what else you have done with it? I simply want to add the Alpha tags to an private feed.

Thanks!
 
Status
Not open for further replies.
Top