Tiny Core Linux
Tiny Core Base => Raspberry Pi => Topic started by: Silver1omo on September 25, 2014, 03:09:42 AM
-
I have installed picoreplayer in a RPI B and decided to add GPIO support to activate/deactivate a relay and turn off/on the amp.
tc@piCorePlayer:~$ uname -a
Linux piCorePlayer 3.14.4-piCore+ #1 PREEMPT Sat May 31 15:15:24 CEST 2014 armv6l GNU/Linux
Faced problems adding extension due to the limited size of the tce partition so I resized it:
/dev/mmcblk0p2 906.6M 57.8M 805.4M 7% /mnt/mmcblk0p2
And then tried to install python using tce-load -wi python.tcz, it downloaded but did not install, so I tried tce-load -i python.tcz
tc@piCorePlayer:~$ tce-load -i python.tcz
mount: mounting /dev/loop50 on /tmp/tcloop/python failed: Invalid argument
Spent some time searching in google with no luck. Any help will be appreciated.
-
Hey :)
Look here, and when fixed, you can try again :
http://forum.tinycorelinux.net/index.php/topic,16439.0.html (http://forum.tinycorelinux.net/index.php/topic,16439.0.html)
Regards... Jesper
-
Jesper, I read that thread, but don't see what I need to fix.
-
Did you expand mmcblk0p2, reboot and resize.
Its explained in the Readme file
Jesper
-
Where is your /tce directory?
-
Jesper, I did.
Bela, is in mnt/mmcblk0p2/tce
I just re-installed picoreplayer and resized and expanded mmcblk0p2 then installed compile-essentials, python-dev and python-RPi.GPIO. It is working now.
-
Cool :)
Let us see, when you have set up youre
Relay, schematic etc...
Would be nice to see
Jesper
-
This looks like it can work:
http://raspberrypihobbyist.blogspot.com/2012/10/revision-to-relay-circuit.html
-
I just use these
http://www.ebay.com/itm/5V-Four-4-Channel-Relay-Module-With-optocoupler-For-PIC-AVR-DSP-ARM-Arduino-8051-/310574401892?pt=LH_DefaultDomain_0&hash=item484fad4964
Even though these are 5 volts. Power the module with 5 volts, and the 3.3 volts from the GPIO is plenty enough to activate the relay.
I use a slightly modified version of squeezelite to toggle the relay based on the state of the player.
-
Paul.
Care to share the details..
The determination of player statement, toggle a relay sounds very interesting!
Jesper.
-
I found a LMS plugin that executes scripts on the LMS server based on player status/events, squeezedvera.
So I "press" the power button on the squeezebox app and squezzedvera executes a shell script in LMS that opens a CGI page (wget) in the RPI, that executes a python script and I have GPIO control!
So now I just need to get and wire the relays.
There should be a lot of cleaner options, but this seems to work nicely, I have only tested with a DMM. Off 0v, On 3.3v.
-
Got the parts and stuffed them in a project box. It is working ;D
-
Cool :)
Congrats..
Regards... Jesper
(Btw: picture perhaps? Tinypic.com
-
Quick and dirty:
(http://i568.photobucket.com/albums/ss128/silver1omo/Random/20140930_2022191.jpg)
(http://i568.photobucket.com/albums/ss128/silver1omo/Random/20140930_2020501.jpg)
-
I just use these
http://www.ebay.com/itm/5V-Four-4-Channel-Relay-Module-With-optocoupler-For-PIC-AVR-DSP-ARM-Arduino-8051-/310574401892?pt=LH_DefaultDomain_0&hash=item484fad4964
Even though these are 5 volts. Power the module with 5 volts, and the 3.3 volts from the GPIO is plenty enough to activate the relay.
I use a slightly modified version of squeezelite to toggle the relay based on the state of the player.
I might try one of those modules. They seem popular.
-
Hi Paul,
What modifications did you make to trigger a gpio based on the player state.
Jeff
-
Hi Paul,
What modifications did you make to trigger a gpio based on the player state.
Jeff
You will have to compile your own version of squeezelite.
take a look here. http://forums.slimdevices.com/showthread.php?97046-Announce-Squeezelite-a-small-headless-squeezeplay-emulator-for-linux-(alsa-only)&p=736122&highlight=ampidle#post736122
-
Hi Paul,
What modifications did you make to trigger a gpio based on the player state.
Jeff
Hi Jeff,
Here's a different way of doing it.
http://www.pinkfishmedia.net/forum/showthread.php?t=165465
It just monitors the status of the player on LMS. Its just a shell script, no extra extensions to load.
regards
Greg
-
Here's a different way of doing it.
http://www.pinkfishmedia.net/forum/showthread.php?t=165465
It just monitors the status of the player on LMS. Its just a shell script, no extra extensions to load.
regards
Greg
That's probably alot easier....lol. I wrote that before I even knew about LMSCLI.
My code also looks for a paused player.....after it is paused for so long, the relay is turned off too. Which you can do with the LMSCLI too.