WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: picore and python  (Read 10927 times)

Offline Silver1omo

  • Newbie
  • *
  • Posts: 8
picore and python
« 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.
Code: [Select]
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
Code: [Select]
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.

Offline lykkedk

  • Full Member
  • ***
  • Posts: 182
Re: picore and python
« Reply #1 on: September 25, 2014, 05:01:13 AM »
Hey  :)

Look here, and when fixed, you can try again :

http://forum.tinycorelinux.net/index.php/topic,16439.0.html

Regards... Jesper

Offline Silver1omo

  • Newbie
  • *
  • Posts: 8
Re: picore and python
« Reply #2 on: September 25, 2014, 11:10:10 AM »
Jesper, I read that thread, but don't see what I need to fix.

Offline lykkedk

  • Full Member
  • ***
  • Posts: 182
Re: picore and python
« Reply #3 on: September 25, 2014, 11:31:48 AM »
Did you expand mmcblk0p2, reboot and resize.

Its explained in the Readme file

Jesper

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: picore and python
« Reply #4 on: September 25, 2014, 11:46:05 AM »
Where is your /tce directory?
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline Silver1omo

  • Newbie
  • *
  • Posts: 8
Re: picore and python
« Reply #5 on: September 25, 2014, 11:54:03 AM »
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.

Offline lykkedk

  • Full Member
  • ***
  • Posts: 182
Re: picore and python
« Reply #6 on: September 25, 2014, 12:00:35 PM »
Cool :)

Let us see, when you have set up youre
Relay, schematic etc...

Would be nice to see

Jesper

Offline Silver1omo

  • Newbie
  • *
  • Posts: 8
Re: picore and python
« Reply #7 on: September 25, 2014, 02:59:04 PM »

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1242
Re: picore and python
« Reply #8 on: September 26, 2014, 04:24:11 PM »
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.

Offline lykkedk

  • Full Member
  • ***
  • Posts: 182
Re: picore and python
« Reply #9 on: September 26, 2014, 06:07:24 PM »
Paul.

Care to share the details..

The determination of player statement, toggle a relay sounds very interesting!

Jesper.

Offline Silver1omo

  • Newbie
  • *
  • Posts: 8
Re: picore and python
« Reply #10 on: September 27, 2014, 01:50:37 AM »
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.

Offline Silver1omo

  • Newbie
  • *
  • Posts: 8
Re: picore and python
« Reply #11 on: September 27, 2014, 10:52:18 PM »
Got the parts and stuffed them in a project box. It is working  ;D

Offline lykkedk

  • Full Member
  • ***
  • Posts: 182
Re: picore and python
« Reply #12 on: September 28, 2014, 02:17:23 AM »
Cool :)

Congrats..

Regards... Jesper

(Btw: picture perhaps? Tinypic.com

Offline Silver1omo

  • Newbie
  • *
  • Posts: 8
Re: picore and python
« Reply #13 on: September 30, 2014, 09:33:16 PM »
Quick and dirty:


Offline Silver1omo

  • Newbie
  • *
  • Posts: 8
Re: picore and python
« Reply #14 on: September 30, 2014, 09:35:22 PM »
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.