OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) Python Interval Program update Oct. 1 2013

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #22658

    Dan in CA

    The October 1 2013 update to the Python Interval Program is now available on GitHub.

    This update will not affect most users.

    If you have added hardware or made changes to the program code that reference the GPIO pins on the Raspberry Pi Please take note.

    The pin numbering option in the RPi.GPIO Python module has been changed from BCM to BOARD. This means that references to pins on the P1 pin header now use the simpler numbering system based on physical pin locations rather than references to the pins on the processor chip.

    Here’s what the RPi.GPIO documentation has to say:

    There are two ways of numbering the IO pins on a Raspberry Pi within RPi.GPIO. The first is using the BOARD numbering system. This refers to the pin numbers on the P1 header of the Raspberry Pi board. The advantage of using this numbering system is that your hardware will always work, regardless of the board revision of the RPi. You will not need to rewire your connector or change your code.

    The second numbering system is the BCM numbers. This is a lower level way of working – it refers to the channel numbers on the Broadcom SOC. You have to always work with a diagram of which channel number goes to which pin on the RPi board. Your script could break between revisions of Raspberry Pi boards.

    I don’t like to make changes like this so far along in the project but the advantages going forward include more reliable program code, elimination of hardware differences between board revs, and simplification of the code. It eliminates the need for the board rev checking function which I added to keep users from having to edit the code in order to use a rev 1 board.

    I have made a pin numbering diagram to hopefully ease the transition for anyone who has added connections to the GPIO pins or modified the code.
    [attachment=0:1gk19wjt]P1 pin numbers.jpg[/attachment:1gk19wjt]
    To make your modifications work, you just need to change the pin numbers in the program code.

    From the README:
    1. Changed the pin numbering option in the RPi.GPIO module from BCM to BOARD.

    Files that were changed in this update:

    See the Wiki for update instructions:




    Hi Dan,

    Did a git pull, then fixed up the conflict with my pin number additions for the rain sensing, door sensing, and door control. Merged my changes.
    Git status says
    # On branch master
    # Your branch is ahead of ‘origin/master’ by 5 commits.
    nothing to commit (working directory clean)

    Everything seems to be running fine. Rain is being sensed (it’s been raining here), and I can toggle the door up and down.

    Thanks for the update.



    Dan in CA

    Hi Denny,

    I’m glad the update went OK for you.

    There are some cool changes in the pipeline and you will be set to take advantage of them.


Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) Python Interval Program update Oct. 1 2013