OpenSprinkler Forums Third-Party Software I2C for MCP23017 on OSPI

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #75831


    Hello, I have been trying to implement i2c support for an MCP23017 using the wiringPi library. I have a short piece of code which does the initialization and then toggles successfully through the 16 channels of the 23017 when is part of an independent program. If I use the same code inside the OpenSprinkler::begin(), then nothing happens. I have commented everything out of the ::Begin api, left in just my code, and still don’t see any activity on the i2c bus. I looked through the code to see if there is anything else that could interfere with the i2c, like different pin configuration, but I couldn’t see anything taking place before the ::begin(). Is OS using GPIO2(SDA) and GPIO3(SCL) on Pi 3B+ for something else? I don’t see these 2 pins defined as anything in the defines.h but neither available in the PIN_FREE_LIST.
    What am I missing? It just doesn’t make any sense that the same code works fine outside the OpenSprinkler but not when part of the begin() api.
    Thanks in advance for any suggestions.



    The OpenSprinkler firmware currently does not use I2C for OSPi at all. There is no hardware conflict — the I2C pins are free to use by any I2C device. You may want to write a small and separate program just to test the I2C functionality, such as using wiringPi to detect MCP23017 to make sure the wiringPi I2C functions are working properly. I have no experience with using wiringPi for I2C so I don’t have any advice. Also, make sure I2C is enabled in your RPi configuration.

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

OpenSprinkler Forums Third-Party Software I2C for MCP23017 on OSPI