Menu

#1 Missing command "gpio" in WiringPi package.

2.0
accepted
irimi
2016-03-10
2015-02-16
kofec
No

Hi, the code of domoticz is using library of WiringPi but also the command "gpio" which is not included in the WiringPi package can you please add it.

// 1. List exports and parse the result
cmd = popen("gpio exports", "r");
while (fgets(buf, sizeof(buf), cmd) != 0) {
// Decode GPIO pin number from the output formatted as follows:
//
// GPIO Pins exported:
// 17: out 0 none
// 18: in 1 none
//
// 00000000001111111111
// 01234567890123456789

// 2. List the full pin set and parse the result
cmd = popen("gpio readall", "r");

Discussion

  • irimi

    irimi - 2015-02-17
    • status: open --> accepted
     
  • irimi

    irimi - 2015-02-17

    Confirmed.
    But gpio build depends on PiFace package, which is still unsupported

     
  • kofec

    kofec - 2015-02-17

    as a workaround I wrote simple bash script in location /usr/bin/gpio

    !/bin/bash

    if [ $1 = "exports" ]; then
    cat /root/gpio1.txt
    else
    cat /root/gpio.txt
    fi

    where this txt file are output from raspberry where gpio command was installed and GPIO pins where set in the same way.

     

    Last edit: kofec 2015-02-17

Log in to post a comment.