Make-Magazine / PirateRadio

Raspberry Pi Automated FM Radio Script
459 stars 156 forks source link

Error running PirateRadio.py #26

Open SergioVicent65 opened 8 years ago

SergioVicent65 commented 8 years ago

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

dmorawetz commented 8 years ago

Looks like you haven't installed ffmpeg on your RaspberryPi?

0xicl33n commented 8 years ago

@Morosko ffmpeg does not exist anymore. It has been replaced by avconv. I just ran into this error too

http://askubuntu.com/questions/432542/is-ffmpeg-missing-from-the-official-repositories-in-14-04

I have hacked away at the python code to use avconv and remove some things that were preventing it from working.

https://github.com/0xicl33n/PirateRadio

root@zeru[~/PirateRadio]#python3 PirateRadio.py
Playing songs to frequency  88.9
Shuffle is on
Repeat All is on
Playing  /pirateradio/bignic - Zenzizenzic Soundtrack - 03 girl.flac
guillermogf commented 8 years ago

ffmpeg does not exist anymore

That's not exactly true. The project still exits and Debian has gone back to using it. In fact it is currently available in the Jessie-backports and Testing repositories.

dmontenegro commented 8 years ago

It test your repo and the code works but it doesnt send the signal. @0xicl33n Do you know if it works for any Pi? (Ex. Pi3)

isfanl commented 8 years ago

i got this error when executing PirateRadio.py

pi@raspberrypi:~/PirateRadio $ python PirateRadio.py Traceback (most recent call last): 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' pi@raspberrypi:~/PirateRadio $

what should i do ?

in-sympathy commented 6 years ago

I have exactly the same error

d4m4s74 commented 6 years ago

Which version of python are you using? the keyword fallback is in python 3, but not in python 2

in-sympathy commented 6 years ago

Hi, thanks for your answer. I’am just trying to launch the script in terminal as python PirateRadio.py

After you asked I tried to use python3 and even tried it with sudo, but got even more errors:

sudo python3 PirateRadio.py

Traceback (most recent call last): File "/usr/lib/python3.5/configparser.py", line 1135, in _unify_values sectiondict = self._sections[section] KeyError: 'pirateradio'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): 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 98, in read_config frequency = config.get("pirateradio",'frequency') File "/usr/lib/python3.5/configparser.py", line 778, in get d = self._unify_values(section, vars) File "/usr/lib/python3.5/configparser.py", line 1138, in _unify_values raise NoSectionError(section) configparser.NoSectionError: No section: 'pirateradio'

On Dec 22, 2017, at 4:02 PM, d4m4s74 notifications@github.com wrote:

Which version of python are you using? the keyword fallback is in python 3, but not in python 2

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Make-Magazine/PirateRadio/issues/26#issuecomment-353603879, or mute the thread https://github.com/notifications/unsubscribe-auth/AFLpF7mB_b1cg7C8oGyJdLnczrX6yowKks5tC7ZxgaJpZM4HmSLp.

in-sympathy commented 6 years ago

Made it work, thanks, there were issues with file paths

On Dec 22, 2017, at 4:05 PM, Alexander Golubets alexanderre@me.com wrote:

Hi, thanks for your answer. I’am just trying to launch the script in terminal as python PirateRadio.py

After you asked I tried to use python3 and even tried it with sudo, but got even more errors:

sudo python3 PirateRadio.py

Traceback (most recent call last): File "/usr/lib/python3.5/configparser.py", line 1135, in _unify_values sectiondict = self._sections[section] KeyError: 'pirateradio'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): 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 98, in read_config frequency = config.get("pirateradio",'frequency') File "/usr/lib/python3.5/configparser.py", line 778, in get d = self._unify_values(section, vars) File "/usr/lib/python3.5/configparser.py", line 1138, in _unify_values raise NoSectionError(section) configparser.NoSectionError: No section: 'pirateradio'

Best regards,

Oleksandr Golubets +38(063) 871 51 31 alexanderre@icloud.com mailto:alexanderre@icloud.com

On Dec 22, 2017, at 4:02 PM, d4m4s74 <notifications@github.com mailto:notifications@github.com> wrote:

Which version of python are you using? the keyword fallback is in python 3, but not in python 2

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Make-Magazine/PirateRadio/issues/26#issuecomment-353603879, or mute the thread https://github.com/notifications/unsubscribe-auth/AFLpF7mB_b1cg7C8oGyJdLnczrX6yowKks5tC7ZxgaJpZM4HmSLp.

in-sympathy commented 6 years ago

Hi guys, sorry for bothering. The script works and says it is playing the files (use regular mp3s), but I can’t find the transmission on any frequency I tried. I use RasPi 3, so maybe there is something that needs to be changed? I also used a 60 cm copper wire as an antenna and connected it to the pin 4 on my RasPi 3. Should the PIN number be the same on RasPi 2 & 3?