this is excellent.!! I have picoreplayer on my Rasp Model A and will try
this over the weekend.
so, for picoreplayer, what packages would I need - python, GPIO.
anything else?
ashwin.isaac's Profile:
TheD6Bel wrote:
Hello RobbeD
your script work perfectly!
i change ip 127.0.0.1 to my nas ip (lms run on my synology) and and
change GPIO.output(18, True) to GPIO.output(18, False) and
GPIO.output(18, False) to GPIO.output(18, True) for work with my relay.
Thanks ;)
That's very good
Hello, after few days of test i keep your first script.
Your last script are some bugs, ei:
-if i put my music on pause and switch power off, the script don't
work.
-if i listen my music and power off, the relay switch off but if i power
on relay don't move, i need play music, power off and
That's weird, I don't have those problems here.. Are you using the web
user interface or another controller?
You can run the script and check the output.. Maybe it has something to
do with LMS settings?
RobbeD's
hello,
i tried for you on a new install of picoreplayer 1.18b, and i can't run
script!
on picoreplayer you need libraries and is not inclued, you don't have
python, nano, gpio,...
for you the best way, you install squeezeplug, boot time is not same but
it's work ;)
sorry for not can help you
Again BIG thanks TheD6Bel!
I do no longer work with piCorePlayer, I have installed Squeezeplayer on
wheezy debian.
If I want to edit rc.local, I have got the Error writing /etc/rc.local:
Permission denied
I logged in as user pi is that wrong?
#!/bin/sh -e
#
# rc.local
#
# This script is
Ok I did
sudo nano /etc/rc.local
then I could save! :-)
Now it looks like this, ist that ok?
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will exit 0 on success or any other
# value on error.
#
# In order to
Hello,
when i did /yourpath is your path directory. My script is in
/home/script/ and i add on rc.local:
python /home/script/relay.py
;)
TheD6Bel's Profile: http://forums.slimdevices.com/member.php?userid=58077
View
A very BIG thank you *TheD6Bel* for your absolute perfect explenation.
Now why it took so long that i didmy replay was because piCorePlayer was
not good for me (I think) i coulnot even install or open nano.
So I installed Whezzy debian iso and setup the squeezeslave like
described in this
hello, your script like this
Code:
import sys, string, select
from socket import *
import RPi.GPIO as GPIO
# Define maximum xPL message size
buff = 1500
# Define xPL base port
port = 3865
# Sub routine for sending a heartbeat
def SendHeartbeat()
Hi!
That's strange, I thought the script would run without problems.. I am
thinking if I did install something extra on the raspberry..
It's also weird that the script doesn't understand the import command..
I run the script like this: python relay.py
Can you try that?
Sorry my mistake!
for run script i make ./rxpl.py
i'am on work now, i tried tonight
TheD6Bel's Profile: http://forums.slimdevices.com/member.php?userid=58077
View this thread:
Hello RobbeD
your script work perfectly!
i change ip 127.0.0.1 to my nas ip (lms run on my synology) and and
change GPIO.output(18, True) to GPIO.output(18, False) and
GPIO.output(18, False) to GPIO.output(18, True) for work with my relay.
Thanks ;)
I'm very sorry for beeing an absolut beginner, can anybody explain me in
short words how I get this script on my running piCorePlayer and what
pins its going to switch?
Do I have to use Putty?
Thank you very much for your time, all out there!!
palmerx wrote:
I'm very sorry for beeing an absolut beginner, can anybody explain me in
short words how I get this script on my running piCorePlayer and what
pins its going to switch?
Do I have to use Putty?
Thank you very much for your time, all out there!!
Hello,
yes you need putty.
Hello RobbeD,
don't work for me :
Code:
root@squeezeplug:/home/pi/script# ./rxpl.py
./rxpl.py: line 1: import: command not found
from: can't read /var/mail/socket
./rxpl.py: line 3: import: command not found
./rxpl.py: line 6: buff: command not found
This looks amazing, would that work on the PiCorePlayer also to turn on
my Amp??
https://sites.google.com/site/picoreplayer/home
palmerx's Profile: http://forums.slimdevices.com/member.php?userid=63498
View this thread:
palmerx wrote:
This looks amazing, would that work on the PiCorePlayer also to turn on
my Amp??
https://sites.google.com/site/picoreplayer/home
Hello,
normally yes. You need only setup script with ip of server and mac from
picoreplayer.
I had to change the script for run every 2 sec
Hey guys,
I recently changed the script so it now works with the XPL plugin.. This
makes the script more smooth and lightweight! It also now reacts
instant! :-)
To make the script run you'll need to install the xPL plugin in LMS.
After that you just change the name of the player in the script
RobbeD wrote:
Hey guys,
I recently changed the script so it now works with the XPL plugin.. This
makes the script more smooth and lightweight! It also now reacts
instant! :-)
To make the script run you'll need to install the xPL plugin in LMS.
After that you just change the name of
TheD6Bel, that's great news! :-)
I have added another piece of code that checks every two seconds if the
server is online. If the server is online, then the status of the player
is checked, otherwise not. The file is in attachment.
14795
For your problem that the relay is on when LMS is turned
hello,
your file is the same script :)
but thanks for you work ;)
TheD6Bel's Profile: http://forums.slimdevices.com/member.php?userid=58077
View this thread: http://forums.slimdevices.com/showthread.php?t=71077
Hi, indeed, the python script is indentation-sensitive.
For me, the script works the way I copied it here on the forum.. But i'm
aware that maybe the lay-out is not that good..
I'll add my script here in attachment..
14774
I now did the indentation with WING-IDE and it looks correct..
Hope it
RobbeD wrote:
is there a way to make the script use less resources?
Only had a quick look, but it is a busy loop that gets executed once per
second. I would look at something like the xPL plugin or something else
that can actively send you a message when the player gets activated.
it works !!! thanks
I just have a problem is when LMS is off the relay is on ans when LMS is
turn on relay switch off.
i need change your script but it WORKS ! BIG THANKS
TheD6Bel's Profile:
i resolve my first problem :)
i change
#!/usr/bin/env python
to
#!/usr/bin/env python3
but i have a error in line 82 :
root@squeezeplug:/home# ./gpio.sh
File ./gpio.sh, line 82
playerdetected = playerId
^
TheD6Bel's
I fixed the second error
if (playerId == playermac):
playerdetected = playerId
not
if (playerId == playermac):
playerdetected = playerId
but I have another error
root@squeezeplug:/home# ./gpio.sh
File ./gpio.sh, line 84
if playerdetected :
^
TheD6Bel wrote:
but I have another error
root@squeezeplug:/home# ./gpio.sh
File ./gpio.sh, line 84
if playerdetected :
^
SyntaxError: invalid syntax
I I'm not good in script, so I do not know fix it
This isn't really a script error, it is a python syntax error, and the
error is in
i tried but don't work :(
i put the script in /hom/gpio.sh with chmod 777
i put before yout script
#!/usr/bin/env python
# -*- coding: utf-8 -*-
i put ip of RPi : 192.168.1.9
and mac adress of squeezeslave (in web interface, setting, player, ) :
b8:27:eb:e4:2a:af
I edit /etc/rc.local
and
if i execute gpio.sh i have error:
root@squeezeplug:/home# ./gpio.sh
Traceback (most recent call last):
File ./gpio.sh, line 52, in module
responce = json.loads(data)
File /usr/lib/python2.7/json/__init__.py, line 326, in loads
return _default_decoder.decode(s)
File
Hi, I'll tell you what I did to make it work:
I saved the script as relay.py and ran it just with python relay.py
(as root).
Later I made a service script in etc\init.d to run it at boot..
Maybe you should try to add :9000 behind the ip adress of your server?
Maybe that can be the problem.
My
Hello,
Sorry for bumping this thread, but for people who are still searching
for an easy script to trigger a relay i've created a python script that
runs at boot.
The script checks the powerstate of the player every second (script runs
on a raspberry pi where squeezelite is installed), and if
Thanks, i test now ;)
TheD6Bel's Profile: http://forums.slimdevices.com/member.php?userid=58077
View this thread: http://forums.slimdevices.com/showthread.php?t=71077
___
Ok! :-) Let me know if it works or not..
RobbeD's Profile: http://forums.slimdevices.com/member.php?userid=56967
View this thread: http://forums.slimdevices.com/showthread.php?t=71077
epoch1970 wrote:
did you see this one :
http://forums.slimdevices.com/showthread.php?88269-Sample-code-JSON-API-in-your-languagep=636134viewfull=1#post636134
i see, but isn't for manage GPIO, is for have inforamtions over
serveurs/player
but thanks :)
epoch1970 wrote:
Wha??
Have you tried gpio raspberry pi python on google ?
On google! I searched on the forum, on RPi forum i open un post and i
have a python script for manage GPIO but is only with MPD not LMS. I
try change this script for LMS
did you see this one :
http://forums.slimdevices.com/showthread.php?88269-Sample-code-JSON-API-in-your-languagep=636134viewfull=1#post636134
epoch1970's Profile: http://forums.slimdevices.com/member.php?userid=16711
View
TheD6Bel wrote:
my problem is to create a python script with the status of every player
:(
Well you have to ask the server for the available players, then query in
a loop each player for its status.
Players can come and go, so the first step is never a waste of time;
also when a player is
hello,
I did a search but I have not found a script to manage GPIO over RPi
TheD6Bel's Profile: http://forums.slimdevices.com/member.php?userid=58077
View this thread: http://forums.slimdevices.com/showthread.php?t=71077
Wha??
Have you tried gpio raspberry pi python on google ?
epoch1970's Profile: http://forums.slimdevices.com/member.php?userid=16711
View this thread: http://forums.slimdevices.com/showthread.php?t=71077
Hello i instal a python for LMS and is very easy to have status of
server
PYLMS https://github.com/jingleman/PyLMS
TheD6Bel's Profile: http://forums.slimdevices.com/member.php?userid=58077
View this thread:
Hello,
I also looking for a solution to control an amp with GPIO ports RPi.
For the moment there is a script that works with MPD, must modify it to
work under squeezebox. This script based on the status of mpd.
TheD6Bel wrote:
it is possible to know the status of squeezebox go to
IPSQUEEZEBOX:9000/status.txt
You're better off using the CLI available on port 9090. Available
commands are listed in LMS: click help at the bottom of the LMS main
page (http://IPSQUEEZEBOX:9000), then Technical
I do not even answer
root@squeezeplug:~# echo serverstatus |netcat -w1 127.0.0.1 9090
root@squeezeplug:~# echo players list|netcat -w1 127.0.0.1 9090
:(
TheD6Bel's Profile:
TheD6Bel wrote:
I do not even answer
root@squeezeplug:~# echo serverstatus |netcat -w1 127.0.0.1 9090
root@squeezeplug:~# echo players list|netcat -w1 127.0.0.1 9090
:(
-verify netcat is installed. Use telnet 127.0.0.1 9090 if you don't
have netcat (type 'exit' to quit from telnet if
hello, for me netcat is instaled:
root@squeezeplug:~# netcat
usage: nc [-46bCDdhjklnrStUuvZz] [-I length] [-i interval] [-O length]
[-P proxy_username] [-p source_port] [-q seconds] [-s source]
[-T toskeyword] [-V rtable] [-w timeout] [-X proxy_protocol]
[-x proxy_address[:port]] [destination]
mhh. I think there are 2 versions of netcat in existence and they behave
slightly differently when it comes to end of lines.
Perhaps something like this would work better for you: echo -e
serverstatus\nexit\n | netcat localhost 9090 . I am not sure.
But anyway, it looks like the server is
root@squeezeplug:~# echo -e serverstatus\nexit\n | netcat localhost
9090
serverstatus lastscan%3A1352124017 version%3A7.7.2
uuid%3A40adacd5-c19a-4c10-bea4-fe1b4481dbce info%20total%20albums%3A4
info%20total%20artists%3A3 info%20total%20genres%3A3
info%20total%20songs%3A67 player%20count%3A1
Hi,
Could someone help me to modify the Power Switch plugin to control the
gpio pins on the raspberry pi? I think this could be easier than using
an USB-relay..
How do I start with this? I have no experience with squeezebox
plugins..
Thanks in advance!
RobbeD wrote:
Hi,
Could someone help me to modify the Power Switch plugin to control the
gpio pins on the raspberry pi? I think this could be easier than using
an USB-relay..
How do I start with this? I have no experience with squeezebox
plugins..
Thanks in advance!SBS/LMS Plugins are
Hi!
I know your post is almost three years old, but you never know..
I also would like to use a relay for this purpose!
My idea is to let a script run in the background that checks the
powerstate of the player (squeezeplay) on the server via CLI.
If the powerstate of the player is on, the relax
Have a look at the Denon plugins or IR blaster. They do this and all
you'd need to do is replace the code they use to switch devices on and
off with the code you need. The Denon ones use http or at least TCp I
believe so maybe they are easier to convert.
You could look at the Power Switch plugin and modify it to talk to your
usb relay.
http://www.gwendesign.com/slimserver/dev_hard_and_software.htm#powerswitchii
gharris999's Profile:
Hi there,
After setting up Squeezebox Server on a 24/7 server running Ubuntu,
connecting a SQ3 and a SQ boom to it, I use SqueezeboxSlave as a daemon
on the server itself.
All works perfectly, so I'm up to the next step: turning on the powered
speakers connected to the server automatically when
54 matches
Mail list logo