2

I have PCF8574 GPIO extender connected to RPi. I use GPIO Sysfs. It is possible to write/read to/from extender pins, using command like this:

gpio -x pcf8574:352:32 read 358

But i can not export such pin. What is the correct syntax to export pin like this above? Any idea?

  • 1
    Is the PCF8574 known to sysfs? The wiringPi gpio command has nothing to do with sysfs. – joan Apr 2 '18 at 19:55
  • Of course, WiringPi has nothing to SysFS. But Domoticz app use build-in own interface to sysfs bo control GPIO pins. But first such pin must be export using gpio command. Thats my problem because it is possible to export on-board pins but can not export expander pins. But it is possible to fully control it. – mackowiakp Apr 4 '18 at 6:16
1

I am reasonably certain that wiringPi's gpio command can't be used to interface with the expander in this way from the command line.

You'll likely want to interface it by writing your own binary. Please see this document on Gordon's site for further details.

Said GPIO expander is an i2c device, and must be treated as such.

  • This may and possibly should be a comment. Please flag it up if you agree and I will remove this post, as I'm unsure if OP is focusing more on wiringPi's gpio, or sysfs. – stevieb Apr 2 '18 at 22:23
  • I can not flag answer because of my "reputation". But I flag it down. It is possinle to set direction, read and write from/to expander using GPIO command. See example in the first post. in this example if I short pin 6 to ground, I get result "0". If I leave it open the result is "1". And more. If I connect relay via transistor, it is possible tu turn it on and off using command gpio -x pcf8574:352:32 write 358 1 (or 0). But I can not export such pin (syntax error). – mackowiakp Apr 4 '18 at 5:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.