Re: [PD] Current best practice for GPIO pins on Raspberry Pi?

2023-11-10 Thread Yann Seznec
Thanks all. I ended up going with Patrice’s solution, making a python script 
that accesses the GPIO pins and sends the data through OSC. I have no prior 
knowledge of Python so I had been avoiding this approach, but it turned out to 
be pretty straightforward. 

If anyone now or in the future would like an extremely bare-bones but 
functional example that takes button inputs from Raspberry Pi GPIO pins and 
sends them to Pure Data, I’ve put a minimalist example up on my GitHub along 
with some documentation. This is primarily for my future self, but perhaps it 
will be of help to others: https://github.com/yannseznec/gpioOSCpd




> On 8 Nov 2023, at 16:13, Patco  wrote:
> 
> Hello,
> 
>  an alternative is about using a python script that communicate with PureData 
> through OSC, it can be done with abstractions on pd side and examples 
> provided by python users.
> 
> Best regards,
> 
> patco
> 
>> Le 8 nov. 2023 à 15:14, Yann Seznec  a écrit :
>> 
>> Hello,
>> 
>> I’m wondering what the best option is nowadays for using the GPIO pins on a 
>> Raspberry Pi in Pure Data. 
>> 
>> Wiring Pi seems to be no longer available, as far as I can tell. I’m not 
>> sure what other options there are?
>> 
>> One option suggested elsewhere for inputs was to use the “retrogame” script 
>> to turn GPIO pin activity into keyboard presses and use the [key] object in 
>> Pd, but I can’t seem to get that script to work properly yet. 
>> 
>> Any suggestions would be great, thanks in advance.
>> 
>> Yann
>> 
>> 
>> ___
>> Pd-list@lists.iem.at mailing list
>> UNSUBSCRIBE and account-management -> 
>> https://lists.puredata.info/listinfo/pd-list
> 

___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] Current best practice for GPIO pins on Raspberry Pi?

2023-11-09 Thread Winfried Ritsch
Maybe not exactly what you need, outputs only: GPIO ASR

If you need to drive GPIOs with soft PWMs for solenoids or the like, there is 
an Pd external for Debian Linux, Arm A20 processors, but should work on 
Raspberry Pis also, since it adds an linux kernel driver using libgpio. It can 
drive up to 140 GPIOs as PWMs on an Olimex A20.

- https://git.iem.at/pd/gpioASR

and needs a kerneldriver: 

- https://git.iem.at/ritsch/gpio-asr

There was a plan to expand its functionality for standard GPIO use, also 
encoder for bldc  motors, but... time flows by ... and no urgent need ... ;-).

mfg winfried

Am Mittwoch, 8. November 2023, 20:53:32 CET schrieb Andrew Lyons:
> The Zynthian project has tackled this problem. Might be some code there
> (it's all open source).
> 
> https://discourse.zynthian.org/t/ecoders-directly-to-the-gpio-of-the-pi-4/47
> 28/23?page=2
> 
> https://discourse.zynthian.org/t/encoder-mapping-for-direct-i-o-connection/4
> 039
> 
> Cheers
> 
> On Wed, Nov 8, 2023, 10:11 AM Dan Wilcox  wrote:
> > I believe there was a basic [gpio] object, perhaps from Miller but I don't
> > find it on his site now.
> > 
> > If someone has the source code, maybe we can put it up separately on
> > github.com/pd-externals with a pd-lib-builder makefile. It should be a
> > simple C object, so easy to compile.
> > 
> > On Nov 8, 2023, at 6:57 PM, pd-list-requ...@lists.iem.at wrote:
> > 
> > Message: 1
> > Date: Wed, 8 Nov 2023 15:14:21 +0100
> > From: Yann Seznec 
> > To: pd-list@lists.iem.at
> > Subject: [PD] Current best practice for GPIO pins on Raspberry Pi?
> > Message-ID: <9052d80b-1595-4402-92d3-066b5a4d3...@yannseznec.com>
> > Content-Type: text/plain; charset=utf-8
> > 
> > Hello,
> > 
> > I?m wondering what the best option is nowadays for using the GPIO pins on
> > a Raspberry Pi in Pure Data.
> > 
> > Wiring Pi seems to be no longer available, as far as I can tell. I?m not
> > sure what other options there are?
> > 
> > One option suggested elsewhere for inputs was to use the ?retrogame?
> > script to turn GPIO pin activity into keyboard presses and use the [key]
> > object in Pd, but I can?t seem to get that script to work properly yet.
> > 
> > Any suggestions would be great, thanks in advance.
> > 
> > Yann
> > 
> > 
> > 
> > Dan Wilcox
> > @danomatika <http://twitter.com/danomatika>
> > danomatika.com
> > robotcowboy.com
> > 
> > 
> > 
> > ___
> > Pd-list@lists.iem.at mailing list
> > UNSUBSCRIBE and account-management ->
> > https://lists.puredata.info/listinfo/pd-list


-- 
- ao.Univ.Prof. DI Winfried Ritsch 
- rit...@iem.at - http://iem.at/ritsch
- Institut fuer Elektronische Musik und Akustik,  University of Music and 
Dramatic Art Graz
- mobil: ++43-664-2439369 Tel. ++43-316-389-3510 (3170) Fax ++43-316-389-3171 
- Tel. ++43-316-389-3510 (3170) Fax ++43-316-389-3171 




___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] Current best practice for GPIO pins on Raspberry Pi?

2023-11-08 Thread Andrew Lyons
The Zynthian project has tackled this problem. Might be some code there
(it's all open source).

https://discourse.zynthian.org/t/ecoders-directly-to-the-gpio-of-the-pi-4/4728/23?page=2

https://discourse.zynthian.org/t/encoder-mapping-for-direct-i-o-connection/4039

Cheers

On Wed, Nov 8, 2023, 10:11 AM Dan Wilcox  wrote:

> I believe there was a basic [gpio] object, perhaps from Miller but I don't
> find it on his site now.
>
> If someone has the source code, maybe we can put it up separately on
> github.com/pd-externals with a pd-lib-builder makefile. It should be a
> simple C object, so easy to compile.
>
> On Nov 8, 2023, at 6:57 PM, pd-list-requ...@lists.iem.at wrote:
>
> Message: 1
> Date: Wed, 8 Nov 2023 15:14:21 +0100
> From: Yann Seznec 
> To: pd-list@lists.iem.at
> Subject: [PD] Current best practice for GPIO pins on Raspberry Pi?
> Message-ID: <9052d80b-1595-4402-92d3-066b5a4d3...@yannseznec.com>
> Content-Type: text/plain; charset=utf-8
>
> Hello,
>
> I?m wondering what the best option is nowadays for using the GPIO pins on
> a Raspberry Pi in Pure Data.
>
> Wiring Pi seems to be no longer available, as far as I can tell. I?m not
> sure what other options there are?
>
> One option suggested elsewhere for inputs was to use the ?retrogame?
> script to turn GPIO pin activity into keyboard presses and use the [key]
> object in Pd, but I can?t seem to get that script to work properly yet.
>
> Any suggestions would be great, thanks in advance.
>
> Yann
>
>
> 
> Dan Wilcox
> @danomatika <http://twitter.com/danomatika>
> danomatika.com
> robotcowboy.com
>
>
>
> ___
> Pd-list@lists.iem.at mailing list
> UNSUBSCRIBE and account-management ->
> https://lists.puredata.info/listinfo/pd-list
>
___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] Current best practice for GPIO pins on Raspberry Pi?

2023-11-08 Thread Miller Puckette
My old 'gpio' object was from 2013. it just issued linux reads and 
writes to some device.  I don't know if it would still work.


I've stuck it on

msp.ucsd.edu/tmp/gpio.c

in case you get desperate enough to want to revive a 10-year-old bit of 
system hackery :)


Miller

On 11/8/23 19:07, Dan Wilcox wrote:
I believe there was a basic [gpio] object, perhaps from Miller but I 
don't find it on his site now.


If someone has the source code, maybe we can put it up separately on 
github.com/pd-externals 
<https://urldefense.com/v3/__http://github.com/pd-externals__;!!Mih3wA!H8fVaWGNsJj7sRtceIBHPZIPU04qP2rE5S5a6i1dbaQIEh_yXEV621KT5eKVtL5rwyCFj8sE0_vMia4$> with 
a pd-lib-builder makefile. It should be a simple C object, so easy to 
compile.



On Nov 8, 2023, at 6:57 PM, pd-list-requ...@lists.iem.at wrote:

Message: 1
Date: Wed, 8 Nov 2023 15:14:21 +0100
From: Yann Seznec 
To:pd-list@lists.iem.at
Subject: [PD] Current best practice for GPIO pins on Raspberry Pi?
Message-ID: <9052d80b-1595-4402-92d3-066b5a4d3...@yannseznec.com>
Content-Type: text/plain;charset=utf-8

Hello,

I?m wondering what the best option is nowadays for using the GPIO 
pins on a Raspberry Pi in Pure Data.


Wiring Pi seems to be no longer available, as far as I can tell. I?m 
not sure what other options there are?


One option suggested elsewhere for inputs was to use the ?retrogame? 
script to turn GPIO pin activity into keyboard presses and use the 
[key] object in Pd, but I can?t seem to get that script to work 
properly yet.


Any suggestions would be great, thanks in advance.

Yann



Dan Wilcox
@danomatika 
<https://urldefense.com/v3/__http://twitter.com/danomatika__;!!Mih3wA!H8fVaWGNsJj7sRtceIBHPZIPU04qP2rE5S5a6i1dbaQIEh_yXEV621KT5eKVtL5rwyCFj8sE8qO8JMw$>
danomatika.com 
<https://urldefense.com/v3/__http://danomatika.com__;!!Mih3wA!H8fVaWGNsJj7sRtceIBHPZIPU04qP2rE5S5a6i1dbaQIEh_yXEV621KT5eKVtL5rwyCFj8sEgd8p0xI$>
robotcowboy.com 
<https://urldefense.com/v3/__http://robotcowboy.com__;!!Mih3wA!H8fVaWGNsJj7sRtceIBHPZIPU04qP2rE5S5a6i1dbaQIEh_yXEV621KT5eKVtL5rwyCFj8sE20SnXjQ$>





___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://urldefense.com/v3/__https://lists.puredata.info/listinfo/pd-list__;!!Mih3wA!H8fVaWGNsJj7sRtceIBHPZIPU04qP2rE5S5a6i1dbaQIEh_yXEV621KT5eKVtL5rwyCFj8sE9q75-bQ$




___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] Current best practice for GPIO pins on Raspberry Pi?

2023-11-08 Thread Dan Wilcox
I believe there was a basic [gpio] object, perhaps from Miller but I don't find 
it on his site now.

If someone has the source code, maybe we can put it up separately on 
github.com/pd-externals <http://github.com/pd-externals> with a pd-lib-builder 
makefile. It should be a simple C object, so easy to compile. 

> On Nov 8, 2023, at 6:57 PM, pd-list-requ...@lists.iem.at wrote:
> 
> Message: 1
> Date: Wed, 8 Nov 2023 15:14:21 +0100
> From: Yann Seznec mailto:y...@yannseznec.com>>
> To: pd-list@lists.iem.at <mailto:pd-list@lists.iem.at>
> Subject: [PD] Current best practice for GPIO pins on Raspberry Pi?
> Message-ID: <9052d80b-1595-4402-92d3-066b5a4d3...@yannseznec.com 
> <mailto:9052d80b-1595-4402-92d3-066b5a4d3...@yannseznec.com>>
> Content-Type: text/plain; charset=utf-8
> 
> Hello,
> 
> I?m wondering what the best option is nowadays for using the GPIO pins on a 
> Raspberry Pi in Pure Data. 
> 
> Wiring Pi seems to be no longer available, as far as I can tell. I?m not sure 
> what other options there are?
> 
> One option suggested elsewhere for inputs was to use the ?retrogame? script 
> to turn GPIO pin activity into keyboard presses and use the [key] object in 
> Pd, but I can?t seem to get that script to work properly yet. 
> 
> Any suggestions would be great, thanks in advance.
> 
> Yann


Dan Wilcox
@danomatika <http://twitter.com/danomatika>
danomatika.com <http://danomatika.com/>
robotcowboy.com <http://robotcowboy.com/>



___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] Current best practice for GPIO pins on Raspberry Pi?

2023-11-08 Thread Ico Bukvic
Use pd-l2ork. It comes with disis_gpio and disis_spi (for analog inputs,
like the ones found on Lots-of-Pots shield) which should cover all your
needs. It includes both hardware and software PWM, as well as all the usual
I/O GPIO stuff.

Best,

Ico

-- 
Ivica Ico Bukvic, D.M.A.
Director, Creativity + Innovation
Director, Human-Centered Design iPhD
Institute for Creativity, Arts, and Technology

Virginia Tech
Creative Technologies in Music
School of Performing Arts – 0141
Blacksburg, VA 24061
(540) 231-6139
i...@vt.edu

ci.icat.vt.edu
l2ork.icat.vt.edu
ico.bukvic.net



On Wed, Nov 8, 2023 at 10:14 AM Patco  wrote:

> Hello,
>
>   an alternative is about using a python script that communicate with
> PureData through OSC, it can be done with abstractions on pd side and
> examples provided by python users.
>
> Best regards,
>
> patco
>
> > Le 8 nov. 2023 à 15:14, Yann Seznec  a écrit :
> >
> > Hello,
> >
> > I’m wondering what the best option is nowadays for using the GPIO pins
> on a Raspberry Pi in Pure Data.
> >
> > Wiring Pi seems to be no longer available, as far as I can tell. I’m not
> sure what other options there are?
> >
> > One option suggested elsewhere for inputs was to use the “retrogame”
> script to turn GPIO pin activity into keyboard presses and use the [key]
> object in Pd, but I can’t seem to get that script to work properly yet.
> >
> > Any suggestions would be great, thanks in advance.
> >
> > Yann
> >
> >
> > ___
> > Pd-list@lists.iem.at mailing list
> > UNSUBSCRIBE and account-management ->
> https://lists.puredata.info/listinfo/pd-list
>
>
>
>
> ___
> Pd-list@lists.iem.at mailing list
> UNSUBSCRIBE and account-management ->
> https://lists.puredata.info/listinfo/pd-list
>
___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] Current best practice for GPIO pins on Raspberry Pi?

2023-11-08 Thread Patco
Hello,

  an alternative is about using a python script that communicate with PureData 
through OSC, it can be done with abstractions on pd side and examples provided 
by python users.

Best regards,

patco

> Le 8 nov. 2023 à 15:14, Yann Seznec  a écrit :
> 
> Hello,
> 
> I’m wondering what the best option is nowadays for using the GPIO pins on a 
> Raspberry Pi in Pure Data. 
> 
> Wiring Pi seems to be no longer available, as far as I can tell. I’m not sure 
> what other options there are?
> 
> One option suggested elsewhere for inputs was to use the “retrogame” script 
> to turn GPIO pin activity into keyboard presses and use the [key] object in 
> Pd, but I can’t seem to get that script to work properly yet. 
> 
> Any suggestions would be great, thanks in advance.
> 
> Yann
> 
> 
> ___
> Pd-list@lists.iem.at mailing list
> UNSUBSCRIBE and account-management -> 
> https://lists.puredata.info/listinfo/pd-list




___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


[PD] Current best practice for GPIO pins on Raspberry Pi?

2023-11-08 Thread Yann Seznec
Hello,

I’m wondering what the best option is nowadays for using the GPIO pins on a 
Raspberry Pi in Pure Data. 

Wiring Pi seems to be no longer available, as far as I can tell. I’m not sure 
what other options there are?

One option suggested elsewhere for inputs was to use the “retrogame” script to 
turn GPIO pin activity into keyboard presses and use the [key] object in Pd, 
but I can’t seem to get that script to work properly yet. 

Any suggestions would be great, thanks in advance.

Yann


___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list