Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misleading var names and log messages GPIO mode #27

Open
AsharLohmar opened this issue Apr 27, 2018 · 2 comments
Open

Misleading var names and log messages GPIO mode #27

AsharLohmar opened this issue Apr 27, 2018 · 2 comments

Comments

@AsharLohmar
Copy link

In various parts of the code the lib uses the label gpio

# rpi-rf_receive
logging.info("Listening for codes on GPIO " + str(args.gpio))
# rpi_rf.py
class RFDevice:
    def __init__(self, ...):
        #...
        _LOGGER.debug("Using GPIO " + str(gpio))

but actually in the code of RFDevice it sets the GPIO in mode BCM

GPIO.setmode(GPIO.BCM)

This is kind of misleading.

@palto42
Copy link

palto42 commented Apr 27, 2018

Hi @AsharLohmar
I think you mean that it's not clear which pin numbering is used:
parser.add_argument('-g', dest='gpio', type=int, default=27, help="GPIO pin (Default: 27)")
The term "pin" can be misinterpreted as BOARD/physical numbering, although it's using the GPIO/BCM numbering (too many different names and formats, there's also the wiringPi numbering).
GPIO 27 = BCM 27 = Board 13 = WiringPi 2 (on RPi1 rev.1 the Board 13 was GPIO 21)

Agree that it would be useful to update the help text to make it more clear the BCM numbering is used.
parser.add_argument('-g', dest='gpio', type=int, default=27, help="GPIO BCM number (Default: 27)")

@AsharLohmar
Copy link
Author

Yes, that's exactly what I intended to say. Adding the BCM label here&there would be helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants