rpi_gpio icon indicating copy to clipboard operation
rpi_gpio copied to clipboard

Update to raspberry-gpio-python version 0.7.

Open francois2metz opened this issue 5 years ago • 6 comments
trafficstars

Hi,

I updated the extension to the latest version of raspberry-gpio-python. It fixes a bug with the raspberry pi 4 (See there: https://sourceforge.net/p/raspberry-gpio-python/code/ci/5021b32713c453cccfa17edc15bfeb85f6dca074/)

I tested it and it works!

francois2metz avatar Jul 15 '20 16:07 francois2metz

Can confirm this works for Rpi 3 and 4

cc @ClockVapor

rojosinalma avatar Mar 11 '21 13:03 rojosinalma

Confirm this works for RPi 3B+ with Ruby 3.0.0. Many thanks @francois2metz

htrung1303 avatar Aug 02 '21 14:08 htrung1303

Can confirm works on RPi B with Ruby 2.5.0 installed from buster repository.

PhilipBotha avatar Oct 13 '21 12:10 PhilipBotha

I'm running into this compilation error with your fork: gem_make.out.txt

To reproduce this, put this in a Gemfile and run bundle:

source "https://rubygems.org"
gem "rpi_gpio", github: "francois2metz/rpi_gpio", branch: "update-raspi4"

synthead avatar Nov 28 '21 08:11 synthead

Same problem here like @synthead

thomaswitt avatar Feb 17 '23 09:02 thomaswitt

I'm running into this compilation error with your fork: gem_make.out.txt

To reproduce this, put this in a Gemfile and run bundle:

source "https://rubygems.org"
gem "rpi_gpio", github: "francois2metz/rpi_gpio", branch: "update-raspi4"

Same problem here like @synthead

The issue seem to stem from some of the variable definitions being made in common.h. The variables should be declared with the extern keyword in the header file and only defined in the source (c) file.

The header files are also missing include guards which can be problematic. Should not be an issue in this gem.

Update: The multiple definition of threads is proving tricky as it isn't immediately obvious if they are supposed to be the same global variable, or two separate variables. An additional complication is a shadow variable declared in the add_edge_detect function in event_gpio.c file.

Update: I've made a fork where I've attempted a fix. I've removed the global threads definitions and am only using local stack variables as the thread ID that would be stored in the variable is never used.

This is untested. Will update this comment if/when I've tested it.

Update: I see @synthead Has a branch based on 0.5.0 that should work. Based on version 0.5.0. So should most likely be preferred. Still has the redundant threads variable though. See: https://github.com/synthead/rpi_gpio/tree/use-externs-in-common.h

PhilipBotha avatar Feb 17 '23 09:02 PhilipBotha