Hi list,
is there some external or stdout/daemon trick to access the gpio from pd on the Raspberry pi ?
Thanks
Hi Charlot -
I think either I or a grad student (we'll see) will be writing a Pd extern to do this efficiently -- for the moment it would be possible with a Python script (using netsend/netreceive in Pd) but having an extern would be more lightweight and probably more robust. I'm running an informal seminar about Pi stuff and once we get it together we're planning to blog what we end up doing.
cheers Miller
On Thu, Jan 24, 2013 at 06:09:03PM +0100, Charles Goyard wrote:
Hi list,
is there some external or stdout/daemon trick to access the gpio from pd on the Raspberry pi ?
Thanks
-- Charlot
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Hi Miller,
Miller Puckette wrote:
I think either I or a grad student (we'll see) will be writing a Pd extern to do this efficiently -- for the moment it would be possible with a Python script (using netsend/netreceive in Pd) but having an extern would be more lightweight and probably more robust.
great, thanks! Meanwhile I found out about webiopi, which can act as a placeholder ATM. (http://code.google.com/p/webiopi/wiki/RESTAPI)
Will you use /dev/mem and require root privileges, or the /sys/class/gpio filesystem? (see http://www.raspberrypi.org/phpBB3/viewtopic.php?f=29&t=9667&p=198848 for how to change permissions, non-standard !)
hi all,
i made a small program which uses GPIO to scan a keypad matrix and send OSC data to pd it depends on liblo and libbcm2835 it's very specific to my project but could help someone... code is here : https://github.com/avilleret/pianophone
cheers
a
-- do it yourself http://antoine.villeret.free.fr
2013/1/25 Charles Goyard cg@fsck.fr
Hi Miller,
Miller Puckette wrote:
I think either I or a grad student (we'll see) will be writing a Pd
extern
to do this efficiently -- for the moment it would be possible with a
Python
script (using netsend/netreceive in Pd) but having an extern would be
more
lightweight and probably more robust.
great, thanks! Meanwhile I found out about webiopi, which can act as a placeholder ATM. (http://code.google.com/p/webiopi/wiki/RESTAPI)
Will you use /dev/mem and require root privileges, or the /sys/class/gpio filesystem? (see http://www.raspberrypi.org/phpBB3/viewtopic.php?f=29&t=9667&p=198848 for how to change permissions, non-standard !)
-- Charlot
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Me, I was just planning to see how the python-GPIO library does it and make similar Pd externs. But I don't know what I'm doing :)
M
On Fri, Jan 25, 2013 at 10:12:49AM +0100, Antoine Villeret wrote:
hi all,
i made a small program which uses GPIO to scan a keypad matrix and send OSC data to pd it depends on liblo and libbcm2835 it's very specific to my project but could help someone... code is here : https://github.com/avilleret/pianophone
cheers
a
-- do it yourself http://antoine.villeret.free.fr
2013/1/25 Charles Goyard cg@fsck.fr
Hi Miller,
Miller Puckette wrote:
I think either I or a grad student (we'll see) will be writing a Pd
extern
to do this efficiently -- for the moment it would be possible with a
Python
script (using netsend/netreceive in Pd) but having an extern would be
more
lightweight and probably more robust.
great, thanks! Meanwhile I found out about webiopi, which can act as a placeholder ATM. (http://code.google.com/p/webiopi/wiki/RESTAPI)
Will you use /dev/mem and require root privileges, or the /sys/class/gpio filesystem? (see http://www.raspberrypi.org/phpBB3/viewtopic.php?f=29&t=9667&p=198848 for how to change permissions, non-standard !)
-- Charlot
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Since writnig that I think I found a good toolset and C api, called WiringPi, on:
https://projects.drogon.net/raspberry-pi/wiringpi/
cheers Miller
On Sat, Jan 26, 2013 at 10:29:17AM +0100, Charles Goyard wrote:
Hi,
python rpi-gpio uses /dev/mem and thus requires root privileges.
Miller Puckette wrote:
Me, I was just planning to see how the python-GPIO library does it and make similar Pd externs. But I don't know what I'm doing :)
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
sounds like you guys are programming pic microcontrollers
On Sat, Jan 26, 2013 at 6:34 PM, Miller Puckette msp@ucsd.edu wrote:
Since writnig that I think I found a good toolset and C api, called WiringPi, on:
https://projects.drogon.net/raspberry-pi/wiringpi/
cheers Miller
On Sat, Jan 26, 2013 at 10:29:17AM +0100, Charles Goyard wrote:
Hi,
python rpi-gpio uses /dev/mem and thus requires root privileges.
Miller Puckette wrote:
Me, I was just planning to see how the python-GPIO library does it and make similar Pd externs. But I don't know what I'm doing :)
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Hi,
Miller Puckette wrote:
Since writnig that I think I found a good toolset and C api, called WiringPi, on:
Real nice, it can use both /dev/mem and /sys/class/gpio interface. And it comes with a command-line utility to setup the sys/class/gpio.
It really sound like the way to go.
Charlot
Hi list,
I could make use of gpio (as output) within pd with just [textfile] :
on the command-line:
echo gpio17 > /sys/class/gpio/export echo out > /sys/class/gpio/gpio17/direction chown charles /sys/class/gpio/gpio17/value
inside pd:
[ set 1 ( [ write /sys/class/gpio/gpio17/value cr ( | [ textfile ]
works.
I use it to drive a light system from a track of a audio file containing only square waves at a given frequency (say, cues embedded inside an audio file).
I basically snapshot~ and see if it's over or below 0, and turn the gpio on/off on change.
I started using pd on the pi three hours ago and have it playing audio and banging the gpio in no time.
Thanks to all for this wonderful community.
I'm very happy ;).
Hi Charles / list,
Can I ask you/anyone a question re: permissions for accessing the gpio pins please?
Currently I can't get past: "echo gpio17 > /sys/class/gpio/export" which gives me "permission denied" with everything I've tried.
Are you using WiringPi to allow access to the gpio and if not how?
I'd like to stick with Miller's [gpio] object http://crca.ucsd.edu/~msp/syllabi/206.13w/index.htm (found in the earlier split thread - apologies for the noise) and keep as much within Pd as possible.
Best wishes,
Julian
On 28 January 2013 14:14, Charles Goyard cg@fsck.fr wrote:
Hi list,
I could make use of gpio (as output) within pd with just [textfile] :
on the command-line:
echo gpio17 > /sys/class/gpio/export echo out > /sys/class/gpio/gpio17/direction chown charles /sys/class/gpio/gpio17/value
inside pd:
[ set 1 ( [ write /sys/class/gpio/gpio17/value cr ( | [ textfile ]
works.
I use it to drive a light system from a track of a audio file containing only square waves at a given frequency (say, cues embedded inside an audio file).
I basically snapshot~ and see if it's over or below 0, and turn the gpio on/off on change.
I started using pd on the pi three hours ago and have it playing audio and banging the gpio in no time.
Thanks to all for this wonderful community.
I'm very happy ;).
-- Charles
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
BTW - Forgot to add: I did read through this thread (as mentioned by Charles): http://www.raspberrypi.org/phpBB3/viewtopic.php?f=29&t=9667&p=198848 And left none the wiser... Seemed to me that there are several possible implementations, though I am completely unsure as to which one would work with the /sys/class/gpio/ method that [gpio] makes use of?
I think I'm going to be asking several possibly dumb questions around gpio until I can get my head around all this so apologies up-front.
Julian
J
On 2 April 2013 09:46, Julian Brooks jbeezez@gmail.com wrote:
Hi Charles / list,
Can I ask you/anyone a question re: permissions for accessing the gpio pins please?
Currently I can't get past: "echo gpio17 > /sys/class/gpio/export" which gives me "permission denied" with everything I've tried.
Are you using WiringPi to allow access to the gpio and if not how?
I'd like to stick with Miller's [gpio] object http://crca.ucsd.edu/~msp/syllabi/206.13w/index.htm (found in the earlier split thread - apologies for the noise) and keep as much within Pd as possible.
Best wishes,
Julian
On 28 January 2013 14:14, Charles Goyard cg@fsck.fr wrote:
Hi list,
I could make use of gpio (as output) within pd with just [textfile] :
on the command-line:
echo gpio17 > /sys/class/gpio/export echo out > /sys/class/gpio/gpio17/direction chown charles /sys/class/gpio/gpio17/value
inside pd:
[ set 1 ( [ write /sys/class/gpio/gpio17/value cr ( | [ textfile ]
works.
I use it to drive a light system from a track of a audio file containing only square waves at a given frequency (say, cues embedded inside an audio file).
I basically snapshot~ and see if it's over or below 0, and turn the gpio on/off on change.
I started using pd on the pi three hours ago and have it playing audio and banging the gpio in no time.
Thanks to all for this wonderful community.
I'm very happy ;).
-- Charles
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Hi Julian,
The commands I gave and to be run as root. so:
sudo bash echo gpio17 > /sys/class/gpio/export echo out > /sys/class/gpio/gpio17/direction chown charles /sys/class/gpio/gpio17/value exit pd &
Can you post the full command set you tried ?
It seems there's an overall consensus on running pd (and all kinds of other stuff) as root on the pi. I don't agree with this but that's life and I don't use the pi much anyway.
Cheers,
Hey Charles,
Thanks for the prompt response.
After sudo bash I get: root@raspberrypi:/home/pi# echo gpio17 > /sys/class/gpio/export bash: echo: write error: Invalid argument
The previous commands I tried were sudo'ing everything and also 'sudo -i'.
OAN:
Dumb question #256 I'm presuming 'gpio17' is to allow access to pin 17 and not what was my first impression that gpio17 allows access to all 18 pins?
Best wishes,
Julian
On 2 April 2013 10:35, Charles Goyard cg@fsck.fr wrote:
Hi Julian,
The commands I gave and to be run as root. so:
sudo bash echo gpio17 > /sys/class/gpio/export echo out > /sys/class/gpio/gpio17/direction chown charles /sys/class/gpio/gpio17/value exit pd &
Can you post the full command set you tried ?
It seems there's an overall consensus on running pd (and all kinds of other stuff) as root on the pi. I don't agree with this but that's life and I don't use the pi much anyway.
Cheers,
-- Charles
Julian Brooks wrote:
Hi Charles / list,
Can I ask you/anyone a question re: permissions for accessing the gpio
pins
please?
Currently I can't get past: "echo gpio17 > /sys/class/gpio/export" which gives me "permission denied" with everything I've tried.
Are you using WiringPi to allow access to the gpio and if not how?
I'd like to stick with Miller's [gpio] object http://crca.ucsd.edu/~msp/syllabi/206.13w/index.htm (found in the earlier split thread - apologies for the noise) and keep as much within Pd as possible.
Best wishes,
Julian
On 28 January 2013 14:14, Charles Goyard cg@fsck.fr wrote:
Hi list,
I could make use of gpio (as output) within pd with just [textfile] :
on the command-line:
echo gpio17 > /sys/class/gpio/export echo out > /sys/class/gpio/gpio17/direction chown charles /sys/class/gpio/gpio17/value
inside pd:
[ set 1 ( [ write /sys/class/gpio/gpio17/value cr ( | [ textfile ]
works.
I use it to drive a light system from a track of a audio file
containing
only square waves at a given frequency (say, cues embedded inside an audio file).
I basically snapshot~ and see if it's over or below 0, and turn the
gpio
on/off on change.
I started using pd on the pi three hours ago and have it playing audio
and
banging the gpio in no time.
Thanks to all for this wonderful community.
I'm very happy ;).
-- Charles
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Hi,
Julian Brooks wrote:
After sudo bash I get: root@raspberrypi:/home/pi# echo gpio17 > /sys/class/gpio/export bash: echo: write error: Invalid argument
That's strange. I don't have a pi handy for now to double check my instructions. Maybe I forgot something.
I'm presuming 'gpio17' is to allow access to pin 17 and not what was my first impression that gpio17 allows access to all 18 pins?
yes, only creates the gpio17 "file" for pin 17.
For whatever reason on my install (and this is based upon the one Miller shared at the CrashSpace RPi session in February 2013) sudo bash echo gpio17 > /sys/class/gpio/export wont work. But sudo echo "17" > /sys/class/gpio/export Does
Will test some more with the [gpio] object later - out of time now:(
Cheers Charles,
Julian
On 2 April 2013 12:22, Charles Goyard cg@fsck.fr wrote:
Hi,
Julian Brooks wrote:
After sudo bash I get: root@raspberrypi:/home/pi# echo gpio17 > /sys/class/gpio/export bash: echo: write error: Invalid argument
That's strange. I don't have a pi handy for now to double check my instructions. Maybe I forgot something.
I'm presuming 'gpio17' is to allow access to pin 17 and not what was my first impression that gpio17 allows access to all 18 pins?
yes, only creates the gpio17 "file" for pin 17.
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Miller Puckette wrote:
I think either I or a grad student (we'll see) will be writing a Pd extern to do this efficiently -- for the moment it would be possible with a Python script (using netsend/netreceive in Pd) but having an extern would be more lightweight and probably more robust.
Hi Miller,
Did this extern and blog happen beyond the extern found in: http://crca.ucsd.edu/~msp/syllabi/206.13w/index.htm ?
I can get this one to load, but not to open the gpio.
If I send [open 1( to [gpio 4] I get the error /sys/class/gpio/gpio4/value: No such file or directory in the console
best,
J
Hi Julian, All,
I think I've figured out the [gpio] external. It works fine, but there there is no documentation, however, the .c file is not very complicated.
The test-gpio.pd file is not very good as documentation, so I am attaching a draft help file.
The argument of [gpio] is the pin number. The first thing to do is [enable 1( and not [open 1(, which is equivalent to the: sudo echo "17" > /sys/class/gpio/export command.
Then [open 1(, then [output 1/0( to choose direction and then write (float) to or read (bang) from the pin...
There are still a few more things I need to discover, but more tomorrow when I have some jumper cables and feel more awake.
best,
J
Morning Jaime,
Nice digging - well done.
As I don't read C I admit to being somewhat at sea with the possibilities of the object so really good to hear someone else is rooting around in this.
I did manage to get access to the GPIO pins making use of the messages that Charles mentioned: sudo bash echo "1" > /sys/class/gpio/export echo out > /sys/class/gpio/gpio1/direction chown pi /sys/class/gpio/gpio1/value
But really good to just do it from within Pd - how'd you get round the sudo-thing?
Not sure what it is you're doing project-wise with the GPIO pins but I've spent a couple of weeks digging through the somewhat endless bits and pieces of documentation on the web so perhaps I could be of assistance with some pointers on that front?
Most of the info/code is Python-based and there's plenty of it (I'm also a complete noob re Python as well!) Miller and Charles were certainly on the right track with WiringPi as I would say it's easily the most referenced library. . My own interest is with getting a fairly recent i2c thermal imaging sensor going (see other thread) and Martin Peach is giving us some invaluable help with that but it would be my ideal scenario to be able to control, manage and filter the sensors data from within Pd (once we get the thing going!).
My understanding from reading Miller's initial message re [gpio] is that it's based on WiringPi so I can't help wondering if there's also a method to include the i2c library that's a subset of WiringPi as well? Would be super-useful.
Obviously early days yet but I'm sure we can get there eventually.
All the best,
Julian
On 12 April 2013 06:21, J Oliver jaime.oliver2@gmail.com wrote:
Hi Julian, All,
I think I've figured out the [gpio] external. It works fine, but there there is no documentation, however, the .c file is not very complicated.
The test-gpio.pd file is not very good as documentation, so I am attaching a draft help file.
The argument of [gpio] is the pin number. The first thing to do is [enable 1( and not [open 1(, which is equivalent to the: sudo echo "17" > /sys/class/gpio/export command.
Then [open 1(, then [output 1/0( to choose direction and then write (float) to or read (bang) from the pin...
There are still a few more things I need to discover, but more tomorrow when I have some jumper cables and feel more awake.
best,
J