What is the *current* prefered method to read GPIO pins from within PD on a raspberry pi 4?
Hello, My actual favorite method to read/write GPIO ports is about using a python script outside PureData and manage communication between the python script and PureData with UDP socket. This way there is no limitation on PureData side about how to handle GPIO, and this way makes possible management through other softwares or from another computer. It’s very easy and stable, and there are many examples about how to use sockets with python.
Le 24 nov. 2022 à 13:46, Simon Iten itensimon@gmail.com a écrit :
What is the *current* prefered method to read GPIO pins from within PD on a raspberry pi 4?
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Hello,
are you not getting unreliable latency due to the local network connection between your gpios and pd processes and triggers? When I used this method previously, timings between gpio reading and pd receiving the udp packages varied between 5 to 15ms.
Patco wrote on 24/11/2022 15:51:
Hello, My actual favorite method to read/write GPIO ports is about using a python script outside PureData and manage communication between the python script and PureData with UDP socket. This way there is no limitation on PureData side about how to handle GPIO, and this way makes possible management through other softwares or from another computer. It’s very easy and stable, and there are many examples about how to use sockets with python.
Le 24 nov. 2022 à 13:46, Simon Iten itensimon@gmail.com a écrit :
What is the *current* prefered method to read GPIO pins from within PD on a raspberry pi 4?
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
Latency might be problematic with realtime processes and in my case this is not for realtime. You might be interested into realtime kernel used in patchbox os for rpi. I've got jack+pd- nogui running with 2ms buffer and no xrun.
Le jeu. 24 nov. 2022, 18:38, Sebastian Lexer s.lexer@incalcando.com a écrit :
Hello,
are you not getting unreliable latency due to the local network connection between your gpios and pd processes and triggers? When I used this method previously, timings between gpio reading and pd receiving the udp packages varied between 5 to 15ms.
Patco wrote on 24/11/2022 15:51:
Hello, My actual favorite method to read/write GPIO ports is about using a
python script outside PureData and manage communication between the python script and PureData with UDP socket. This way there is no limitation on PureData side about how to handle GPIO, and this way makes possible management through other softwares or from another computer. It’s very easy and stable, and there are many examples about how to use sockets with python.
Le 24 nov. 2022 à 13:46, Simon Iten itensimon@gmail.com a écrit :
What is the *current* prefered method to read GPIO pins from within PD
on a raspberry pi 4?
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 ->
Get Pd-L2Ork and use its K12 mode abstractions that include out-of-box RPi connectivity (see extra/K12 subfolder). Best paired with lots-of-pots RPi shield that gives you 8 channels of GPIO I/O (including software PWM on all 8 channels or the usual hw PWM via dedicated hardware GPIO pins) and 8 channels of analog input via SPI (needs to be enabled in /boot/config.txt and requires reboot once enabled).
Best,
Ico
Maybe helpful : (for 100+ GPIOs if you need to drive solenoids or the like)
Once ago doing a robot player for xylophones I needed a lot of GPIOs and used the GPIO-monster Olimex-A20 (maybe compares with RPI3), and we at Atelier Algorythmics wrote a kernel driver for it and a pd externals using this.
its general linux kernel stuff, still beta and we did not test it on other boards very much and did not get the time to enhance it ...
Please inform me if anybody succeeds and open for suggestions, we want to develop it further for a new piayer piano electronics...
mfg winfried
Am Freitag, 25. November 2022, 00:08:23 CET schrieb Ico Bukvic:
Get Pd-L2Ork and use its K12 mode abstractions that include out-of-box RPi connectivity (see extra/K12 subfolder). Best paired with lots-of-pots RPi shield that gives you 8 channels of GPIO I/O (including software PWM on all 8 channels or the usual hw PWM via dedicated hardware GPIO pins) and 8 channels of analog input via SPI (needs to be enabled in /boot/config.txt and requires reboot once enabled).
Best,
Ico
Latency might be problematic with realtime processes and in my case this is not for realtime. You might be interested into realtime kernel used in patchbox os for rpi. I've got jack+pd- nogui running with 2ms buffer and no xrun.
Le jeu. 24 nov. 2022, 18:38, Sebastian Lexer s.lexer@incalcando.com a
écrit :
Hello,
are you not getting unreliable latency due to the local network connection between your gpios and pd processes and triggers? When I used this method previously, timings between gpio reading and pd receiving the udp packages varied between 5 to 15ms.
Patco wrote on 24/11/2022 15:51:
Hello,
My actual favorite method to read/write GPIO ports is about using a
python script outside PureData and manage communication between the python script and PureData with UDP socket. This way there is no limitation on PureData side about how to handle GPIO, and this way makes possible management through other softwares or from another computer. It’s very easy and stable, and there are many examples about how to use sockets with python.
Le 24 nov. 2022 à 13:46, Simon Iten itensimon@gmail.com a écrit :
What is the *current* prefered method to read GPIO pins from within PD
on a raspberry pi 4?
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
Maybe helpful : (for 100+ GPIOs if you need to drive solenoids or the like)
Once ago doing a robot player for xylophones I needed a lot of GPIOs and used the GPIO-monster Olimex-A20 (maybe compares with RPI3), and we at Atelier Algorythmics wrote a kernel driver for it and a pd externals using this.
its general linux kernel stuff, still beta and we did not test it on other boards very much and did not get the time to enhance it ...
Please inform me if anybody succeeds and open for suggestions, we want to develop it further for a new piayer piano electronics...
mfg winfried
Am Freitag, 25. November 2022, 00:08:23 CET schrieb Ico Bukvic:
Get Pd-L2Ork and use its K12 mode abstractions that include out-of-box RPi connectivity (see extra/K12 subfolder). Best paired with lots-of-pots RPi shield that gives you 8 channels of GPIO I/O (including software PWM on all 8 channels or the usual hw PWM via dedicated hardware GPIO pins) and 8 channels of analog input via SPI (needs to be enabled in /boot/config.txt and requires reboot once enabled).
Best,
Ico
Latency might be problematic with realtime processes and in my case this is not for realtime. You might be interested into realtime kernel used in patchbox os for rpi. I've got jack+pd- nogui running with 2ms buffer and no xrun.
Le jeu. 24 nov. 2022, 18:38, Sebastian Lexer s.lexer@incalcando.com a
écrit :
Hello,
are you not getting unreliable latency due to the local network connection between your gpios and pd processes and triggers? When I used this method previously, timings between gpio reading and pd receiving the udp packages varied between 5 to 15ms.
Patco wrote on 24/11/2022 15:51:
Hello,
My actual favorite method to read/write GPIO ports is about using a
python script outside PureData and manage communication between the python script and PureData with UDP socket. This way there is no limitation on PureData side about how to handle GPIO, and this way makes possible management through other softwares or from another computer. It’s very easy and stable, and there are many examples about how to use sockets with python.
Le 24 nov. 2022 à 13:46, Simon Iten itensimon@gmail.com a écrit :
What is the *current* prefered method to read GPIO pins from within PD
on a raspberry pi 4?
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