Hi everyone
and thanks to trouch for WebIOPi - its just fantastic how versatile it is !!
I am using 3x MCP23017 to monitor my house, so I need it for a few extra digital inputs.
There is a function to enable the onboard pull-up or pull-down resistors for the RPI's onboard GPIOs in the python script:
def setup():
mcp = webiopi.deviceInstance("mcp") # retrieve the device named "mcp" in the configuration
mcpI1 = webiopi.deviceInstance("mcpI1") # retrieve the device named "mcpI1" in the configuration
mcpI2 = webiopi.deviceInstance("mcpI2") # retrieve the device named "mcpI2" in the configuration
GPIO.setFunction(17,
GPIO.IN, GPIO.PUD_UP)
However, when I try to use it for the mcp:
mcpI2.setFunction(1,
GPIO.IN, GPIO.PUD_UP)
I get this error message, when starting up from the command line:
ERROR - setFunction() takes exactly 3 positional arguments (4 given)
Traceback (most recent call last):
File "/usr/local/lib/python3.2/dist-packages/WebIOPi-0.7.0-py3.2-linux-armv6l.egg/webiopi/__main__.py", line 75, in <module>
main(sys.argv)
File "/usr/local/lib/python3.2/dist-packages/WebIOPi-0.7.0-py3.2-linux-armv6l.egg/webiopi/__main__.py", line 69, in main
server = Server(port=port, configfile=configfile, scriptfile=scriptfile)
File "/usr/local/lib/python3.2/dist-packages/WebIOPi-0.7.0-py3.2-linux-armv6l.egg/webiopi/server/__init__.py", line 75, in __init__
loader.loadScript(name, source, self.restHandler)
File "/usr/local/lib/python3.2/dist-packages/WebIOPi-0.7.0-py3.2-linux-armv6l.egg/webiopi/utils/loader.py", line 12, in loadScript
script.setup()
File "/home/pi/Regeln/python/script.py", line 13, in setup
mcpI2.setFunction(1,
GPIO.IN, GPIO.PUD_UP)
TypeError: setFunction() takes exactly 3 positional arguments (4 given)
I am wondering, if I can use the internal Pull-Up resistors of the MCP23017,
or if I have to solder some pull-ups to the input channels. (quite a few ...)
Thanks for any help :-)
Julian