alexreinert / piVCCU

piVCCU is a project to install the original Homematic CCU3 firmware inside a virtualized container (lxc) on ARM based single board computers.
Apache License 2.0
306 stars 65 forks source link

pivccu usage of raspberry ports #99

Closed brgbrg closed 5 years ago

brgbrg commented 5 years ago

I installed the pivccu3 image (Raspbian_Stretch_Lite_piVCCU3_2018-11-19.zip) successfully on my Raspberry 2, applying the HM-MOD-RPI-PCB as the RF modem.

I also have another very simple bash script application, which uses some GPIO pins (GPIO 5,6,12,14,16,19,20,26,21). Some of these pins seem also be used by pivccu, as the application can no longer read the state of some of the pins.

Does pivccu use other pins / prevent the use of other pins of the raspberry then the pins needed for the HM-MOD-RPI-PCB? Can I avoid this somehow?

Kind regards

Rolf Breuning 
alexreinert commented 5 years ago

GPIO 16, 20 and 21 are in use if a RPI-RF-MOD is detected, but not, if the HM-MOD-RPI-PCB or no radio module at all is detected. I will check, if there might be a bug in this on sunday.

brgbrg commented 5 years ago

I can confirm that 16,20,21 seem to be used. After a reboot I did a simple test: $ echo 5 > "/sys/class/gpio/export" $ echo 6 > "/sys/class/gpio/export" $ echo 12 > "/sys/class/gpio/export" $ echo 13 > "/sys/class/gpio/export" $ echo 16 > "/sys/class/gpio/export" -bash: echo: write error: Device or resource busy $ echo 19 > "/sys/class/gpio/export" $ echo 20 > "/sys/class/gpio/export" -bash: echo: write error: Device or resource busy $ echo 21 > "/sys/class/gpio/export" -bash: echo: write error: Device or resource busy $ echo 26 > "/sys/class/gpio/export"

alexreinert commented 5 years ago

Ok, I found the problem. please update the package pivccu-modules-dkms using apt and reboot.

brgbrg commented 5 years ago

I updated pivccu-modules-dkms and pivccu3. I checked all gpios outside the range of the HM-MOD-RPI-PCB using: arr=( 27 22 23 24 10 9 25 8 7 11 5 6 12 13 16 19 20 21 26 ); for i in "${arr[@]}"; do echo $i; echo $i > "/sys/class/gpio/export"; done Everything - ok I checked my application - ok I upgraded the overall system with apt-get upgrade, repeated the checks above - ok

Your fix was successful and you can close the topic

Thanks for this fast resolution !