MAKE Raspberry Pi Automated FM Radio Script.
make-magazine / pirateradio Goto Github PK
View Code? Open in Web Editor NEWRaspberry Pi Automated FM Radio Script
Raspberry Pi Automated FM Radio Script
This guy made a version of PiFM with RDS support (RDS is that thing where the station broadcasts its name and what program/song is playing, so your radio can display it onscreen)
https://github.com/ChristopheJacquet/PiFmRds
It would be cool if this project could send the name of the file that is playing.
Heya! I have it on a raspberry pi 2 and the audio is really bad quality... how to improve?
Have you used DMA in this project to reduce CPU usage? I saw some code about DMA in the code
Please release the modified version of pifm.c.
Another feature that could be really useful.
I'll need to investigate what hardware/software combinations will allow this bluetooth profile.
Will this run on Pi3?
The Disk image provided on the Make website is not starting the Usb's or the Ethernet. It stops at the log in screen and because I cant input anything, I cant use a keyboard or connect ssh. (It boots up fine though).
Can someone point me to where in the C file the gpio pin is configured as 4? I would like to set this up to use a different pin, but am lost. It would be great if this was a configuration item.
I get this error during the execution of PirateRadio.py:
root@raspberrypi:/PirateRadio# python PirateRadio.py
root@raspberrypi:/PirateRadio# ('Playing songs to frequency ', '106.8')
Shuffle is on
Repeat All is on
('Playing ', '/media/pi/16GB/Daft Punk Feat Paul Williams - Touch.mp3')
Traceback (most recent call last):
File "PirateRadio.py", line 179, in
main()
File "PirateRadio.py", line 39, in main
play_songs(files)
File "PirateRadio.py", line 80, in play_songs
subprocess.call(["ffmpeg","-i",filename,"-f","s16le","-acodec","pcm_s16le","-ac", "2" if play_stereo else "1" ,"-ar","44100","-"],stdout=music_pipe_w, stderr=dev_null)
File "/usr/lib/python2.7/subprocess.py", line 522, in call
return Popen(_popenargs, *_kwargs).wait()
File "/usr/lib/python2.7/subprocess.py", line 710, in init
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
PS: I'm running the last image of Raspbian, on my Raspberry Pi B+
Help?
Thanks
I'm trying to get this working on ArchLinuxARM because my Pi's sd card is smaller and nothing is working quite right. The os is all good and dandy with python etc.. I tried using python 2.yadda and 3.yadda, neither work right. I edited a bit of the code (import configparser and the location of file pifm) and changed the defaults because the config file wouldn't load right in python2. In python 3 it wouldn't run at all. I finally got it to run, but it won't play music and essentially jams whatever frequency I use in the defaults, even commercial stations. Albeit this is pretty cool, its not what I was trying to do. What could be going wrong here? I've been working on this for awhile with no success. Have you been able to get this to run in arch? in the future could there possibly be a prepackaged archARM image like the Raspian one on the make site since it takes up less sd card space?
When I try to run the unstable version of PirateRadio.py on my Raspberry pi I get the following error:
TypeError: get() got an unexpected keyword argument 'fallback'
Is it possible to solve this? Thanks!
Will there ever be support for raspberry pi 2?
config_location = "/pirateradio/pirateradio.conf"
should be
config_location = "/pirateradio/pirateradio.config"
or pirateradio.config
should be renamed to pirateradio.conf
.
[root@alarmpi pirateradio]# Traceback (most recent call last):
File "PirateRadio.py", line 180, in
main()
File "PirateRadio.py", line 36, in main
files = build_file_list()
File "PirateRadio.py", line 48, in build_file_list
for root, folders, files in os.walk(music_dir):
File "/usr/lib/python2.7/os.py", line 286, in walk
if isdir(join(top, name)):
File "/usr/lib/python2.7/posixpath.py", line 80, in join
path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 6: ordinal not in range(128)
[root@alarmpi pirateradio]#
What exactly the path should be?
should it be config_location = "/pirateradio/PirateRadio.conf/ ?
are we supposed to create a directory pirateradio under root and move the conf file over there?
the error we are getting is:
File "PirateRadio.py", line 180, in
main()
File "PirateRadio.py",line 35 in main
setup()
File "PirateRadio.py",line 152, in setup
read_config()
File "PirateRadio.py", line 97 in read_config
play_stereo = config.get("pirateradio", "stereo_playback',fallback=True)
TypeError: get() got an unexpected keyword argument 'fallback'
any help would be appreciated !
AirPlay streaming would be a wonderful addition to this.
Would like to set this up as an optional music player for the lab.
This would also benefit from a simple way to configure wifi. Maybe a push button that tries to connect via WPS? Something to play with eventually.
I'm getting an error when running the script for the first time. I tried it on a Raspberry Pi B and a B+ and I get the same error.
Traceback (most recent call last):
File "PirateRadio.py", line 176, in
main()
File "PirateRadio.py", line 31, in main
setup()
File "PirateRadio.py", line 148, in setup
read_config()
File "PirateRadio.py", line 94, in read_config
frequency = config.get("pirateradio",'frequency')
File "/usr/local/lib/python2.7/dist-packages/backports/configparser/init.py", line 786, in get
d = self._unify_values(section, vars)
File "/usr/local/lib/python2.7/dist-packages/backports/configparser/init.py", line 1164, in _unify_values
raise NoSectionError(section)
backports.configparser.NoSectionError: No section: 'pirateradio'
What am i doing wrong. I didn't change anything to the code.
Hello,
You may want to detect the Python edition, by default the latest on Raspbian, "configparser" for 3.x+ will NOT work, you need to change it to "ConfigParser" for 2.x edition.
Just thought I would mention it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.