bobrathbone / piradio

Raspberry PI internet radio
GNU General Public License v3.0
40 stars 31 forks source link

Added initial Piface compatibility. #2

Open Fighter19 opened 9 years ago

Fighter19 commented 9 years ago

This little fork allows people to use their Piface module with their Rasperry. It's based heavily on the original code of PiRadio. However it wasn't tested on the normal environment and instead on Arch Linux. It's working fine there, as soon as you change the service directory and set up all the config files and symlinks yourself. As of this I couldn't test the installation routine.

bobrathbone commented 9 years ago

Hi Patrick,

Many thanks for your contribution and I am most definitely interested in merging it with the mainstream radio code.

Before I do this I want to thoroughly test it (I ordered a Pi face today).

Do you have any documentation for this project (Installation of piface etc.)

Regards

Bob

Bob Rathbone

http://www.bobrathbone.com/ http://www.bobrathbone.com

http://www.linkedin.com/pub/bob-rathbone/36/b26/a31?trk=shareTw linkedin_small

http://www.lpi.org/ lpic2-logo-extra-small

From: Fighter19 [mailto:notifications@github.com] Sent: 03 January 2015 15:32 To: bobrathbone/piradio Subject: [piradio] Added initial Piface compatibility. (#2)

This little fork allows people to use their Piface module with their Rasperry. It's based heavily on the original code of PiRadio. However it wasn't tested on the normal environment and instead on Arch Linux. It's working fine there, as soon as you change the service directory and set up all the config files and symlinks yourself. As of this I couldn't test the installation routine.


You can merge this Pull Request by running

git pull https://github.com/Fighter19/piradio master

Or view, comment on, or merge it at:

https://github.com/bobrathbone/piradio/pull/2

Commit Summary

File Changes

Patch Links:

— Reply to this email directly or view it on GitHub https://github.com/bobrathbone/piradio/pull/2 . https://github.com/notifications/beacon/AGeEBlEQvoLXVQ6eEZo670RvS1tRgY7vks5nd_TugaJpZM4DN_EM.gif

No virus found in this message. Checked by AVG - www.avg.com Version: 2015.0.5577 / Virus Database: 4257/8865 - Release Date: 01/04/15

Fighter19 commented 9 years ago

Thanks for the reply, Yes there is a really good documentation on installing the PiFace on their site (http://piface.github.io/pifacecad/) as mentioned in the source file. It features a lot of good and usable examples. Installing the PiFace is "easy" for the "user", as you just have to connect it to the GPIO ports (you can't do it wrong). After that you can get the packages, if they aren't in the repo (according to the doc they are) you can compile them from source and simply install them (what I did, as I was installing it on Arch Linux). The rest is handled by the library. Unfortunately there aren't any schematics, else I'm sure you could use the RPi.GPIO package directly.

bobrathbone commented 9 years ago

Hello Patrick,

My piface card arrived this week.

I installed the piface software and configured it today.

Your radio_piface.py program worked perfectly. Well done.

I am going to include the piface software in the mainstream software and documentation with an acknowledgement to you as the author.

I have one question did you configure a remote control at all?

Any tips would be gratefully received.

Regards

Bob

Bob Rathbone

http://www.bobrathbone.com/ http://www.bobrathbone.com

http://www.linkedin.com/pub/bob-rathbone/36/b26/a31?trk=shareTw linkedin_small

http://www.lpi.org/ lpic2-logo-extra-small

From: Fighter19 [mailto:notifications@github.com] Sent: 04 January 2015 16:21 To: bobrathbone/piradio Cc: Bob Rathbone Subject: Re: [piradio] Added initial Piface compatibility. (#2)

Thanks for the reply, Yes there is a really good documentation on installing the PiFace on their site (http://piface.github.io/pifacecad/) as mentioned in the source file. It features a lot of good and usable examples. Installing the PiFace is "easy" for the "user", as you just have to connect it to the GPIO ports (you can't do it wrong). After that you can get the packages, if they aren't in the repo (according to the doc they are) you can compile them from source and simply install them. The rest is handled by the library. Unfortunately there aren't any schematics, else I'm sure you could use the RPi.GPIO package directly.

— Reply to this email directly or view it on GitHub https://github.com/bobrathbone/piradio/pull/2#issuecomment-68636334 . https://github.com/notifications/beacon/AGeEBtpF2h6NdM6gaAb_rtlDh8JCzK7Hks5neVHPgaJpZM4DN_EM.gif

No virus found in this message. Checked by AVG - www.avg.com Version: 2015.0.5577 / Virus Database: 4257/8893 - Release Date: 01/08/15

Fighter19 commented 9 years ago

Hello Bob, Thanks for your reply, I just want to add that it should be cleaned up before merging. At one point "revision" from the RPi board is still needed as argument and there is a run function for debugging (if started as demon I didn't know how to get output, so I decided to run it directly). And the LCD doesn't get turned off by shutdown, everything can be done pretty fast. I'll try to fix it in the next commit. Regards, Patrick

Fighter19 commented 9 years ago

Regarding your question on whether IR works, yes it does (just tested it now).

You can create an IRListener event with the functions provided by the pifacecad library. It then executes a function specified by the user using callbacks. Before you do so you need LIRC successfully configured (for the PiFace:"http://www.piface.org.uk/guides/setting_up_pifacecad/setting_up_PiFace_CAD_to_use_a_remote/"). Then you have to create a configuration file for your remote (sudo irrecord -d /dev/lirc0 /etc/lirc/lircd.conf) (It could be you have to rename or delete the existing file). This config file is used by the lirc daemon you'll have to startup. When you enter the Name for the button you're pressing, you'll need to include it later in the config file used by the program. Each button needs to be configured. the syntax for each button is:

begin remote = * #React to calls from all remotes button = BTN_0 #Listens to LIRC event BTN_0 prog = piradio #Listener needs to look only for his configuration: (listener = pifacecad.IREventListener(prog="piradio") config = zero #Triggers callback as if it was listener.register("zero", function_btn0) end

After registering the callbacks you just need to activate the listener. listener.activate()

bobrathbone commented 9 years ago

Hi Patrick,

Thanks for the info

To make your code compatible with 3.14 onwards you need to amend the displayTime() routine.

This allows the date format to be changed (See 3.14 manual)

Regards

Bob

Display time and timer/alarm

def displayTime(lcd,radio):

    dateFormat = radio.getDateFormat()

    todaysdate = strftime(dateFormat)

Bob Rathbone

From: Fighter19 [mailto:notifications@github.com] Sent: 09 January 2015 19:34 To: bobrathbone/piradio Cc: Bob Rathbone Subject: Re: [piradio] Added initial Piface compatibility. (#2)

Hello Bob, Thanks for your reply, I just want to add that it should be cleaned up before merging. At one point "revision" from the RPi board is still needed as argument and there is a run function for debugging (if started as demon I didn't know how to get output, so I decided to run it directly). And the LCD doesn't get turned off by shutdown, everything can be done pretty fast. I'll try to fix it in the next commit. Regards, Patrick

— Reply to this email directly or view it on GitHub https://github.com/bobrathbone/piradio/pull/2#issuecomment-69377107 . https://github.com/notifications/beacon/AGeEBsZ9r-iRU-_8gWss64cOHCRVVI4Bks5ngBZ8gaJpZM4DN_EM.gif

No virus found in this message. Checked by AVG - www.avg.com Version: 2015.0.5577 / Virus Database: 4257/8897 - Release Date: 01/09/15

Fighter19 commented 9 years ago

Done, however I didn't find time to test it, but I'm pretty sure it should be fine now.

bobrathbone commented 9 years ago

Hi Patrick,

Just to let you know I released your software last week with support for the PiFace.

There is also a daemon to control the Remote control, See version 4.0 manual.

Regards

Bob Rathbone

http://www.bobrathbone.com/ http://www.bobrathbone.com

From: Fighter19 [mailto:notifications@github.com] Sent: 18 January 2015 00:16 To: bobrathbone/piradio Cc: Bob Rathbone Subject: Re: [piradio] Added initial Piface compatibility. (#2)

Done, however I didn't find time to test it, but I'm pretty sure it should be fine now.

— Reply to this email directly or view it on GitHub https://github.com/bobrathbone/piradio/pull/2#issuecomment-70388839 .Image removed by sender.

No virus found in this message. Checked by AVG - www.avg.com Version: 2015.0.5645 / Virus Database: 4260/8950 - Release Date: 01/18/15