Small bug with OUTPUT-GPIO-1-Dimmer

Posted on
Sat Jul 23, 2016 11:16 am
Hackencrash offline
User avatar
Posts: 246
Joined: Dec 16, 2015
Location: UK

Re: Small bug with OUTPUT-GPIO-1-Dimmer

Great! I've just downloaded 1.22.6 and now I see the correct input type assignment for pin 18

Code: Select all
pi@bluepi:~/wiringPi $ gpio -g readall
 +-----+-----+---------+------+---+---Pi 2---+---+------+---------+-----+-----+
 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 |     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |
 |   2 |   8 |   SDA.1 | ALT0 | 1 |  3 || 4  |   |      | 5V      |     |     |
 |   3 |   9 |   SCL.1 | ALT0 | 1 |  5 || 6  |   |      | 0v      |     |     |
 |   4 |   7 | GPIO. 7 |   IN | 1 |  7 || 8  | 1 | ALT0 | TxD     | 15  | 14  |
 |     |     |      0v |      |   |  9 || 10 | 1 | ALT0 | RxD     | 16  | 15  |
 |  17 |   0 | GPIO. 0 |   IN | 0 | 11 || 12 | 1 | OUT  | GPIO. 1 | 1   | 18  |
 |  27 |   2 | GPIO. 2 |  OUT | 1 | 13 || 14 |   |      | 0v      |     |     |
 |  22 |   3 | GPIO. 3 |   IN | 0 | 15 || 16 | 0 | IN   | GPIO. 4 | 4   | 23  |
 |     |     |    3.3v |      |   | 17 || 18 | 1 | IN   | GPIO. 5 | 5   | 24  |
 |  10 |  12 |    MOSI | ALT0 | 0 | 19 || 20 |   |      | 0v      |     |     |
 |   9 |  13 |    MISO | ALT0 | 0 | 21 || 22 | 0 | IN   | GPIO. 6 | 6   | 25  |
 |  11 |  14 |    SCLK | ALT0 | 0 | 23 || 24 | 1 | OUT  | CE0     | 10  | 8   |
 |     |     |      0v |      |   | 25 || 26 | 1 | OUT  | CE1     | 11  | 7   |
 |   0 |  30 |   SDA.0 |   IN | 1 | 27 || 28 | 1 | IN   | SCL.0   | 31  | 1   |
 |   5 |  21 | GPIO.21 |  OUT | 0 | 29 || 30 |   |      | 0v      |     |     |
 |   6 |  22 | GPIO.22 |   IN | 1 | 31 || 32 | 0 | IN   | GPIO.26 | 26  | 12  |
 |  13 |  23 | GPIO.23 |   IN | 0 | 33 || 34 |   |      | 0v      |     |     |
 |  19 |  24 | GPIO.24 |   IN | 0 | 35 || 36 | 0 | IN   | GPIO.27 | 27  | 16  |
 |  26 |  25 | GPIO.25 |   IN | 0 | 37 || 38 | 0 | IN   | GPIO.28 | 28  | 20  |
 |     |     |      0v |      |   | 39 || 40 | 0 | IN   | GPIO.29 | 29  | 21  |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
 +-----+-----+---------+------+---+---Pi 2---+---+------+---------+-----+-----+

However, after a reboot, pin 18 changes back to an output type again:
Code: Select all
pi@bluepi:~ $ gpio -g readall
 +-----+-----+---------+------+---+---Pi 2---+---+------+---------+-----+-----+
 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 |     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |
 |   2 |   8 |   SDA.1 | ALT0 | 1 |  3 || 4  |   |      | 5V      |     |     |
 |   3 |   9 |   SCL.1 | ALT0 | 1 |  5 || 6  |   |      | 0v      |     |     |
 |   4 |   7 | GPIO. 7 |   IN | 1 |  7 || 8  | 1 | ALT0 | TxD     | 15  | 14  |
 |     |     |      0v |      |   |  9 || 10 | 1 | ALT0 | RxD     | 16  | 15  |
 |  17 |   0 | GPIO. 0 |   IN | 0 | 11 || 12 | 1 | IN   | GPIO. 1 | 1   | 18  |
 |  27 |   2 | GPIO. 2 |   IN | 1 | 13 || 14 |   |      | 0v      |     |     |
 |  22 |   3 | GPIO. 3 |   IN | 0 | 15 || 16 | 0 | IN   | GPIO. 4 | 4   | 23  |
 |     |     |    3.3v |      |   | 17 || 18 | 1 | OUT  | GPIO. 5 | 5   | 24  |
 |  10 |  12 |    MOSI | ALT0 | 0 | 19 || 20 |   |      | 0v      |     |     |
 |   9 |  13 |    MISO | ALT0 | 0 | 21 || 22 | 0 | IN   | GPIO. 6 | 6   | 25  |
 |  11 |  14 |    SCLK | ALT0 | 0 | 23 || 24 | 1 | OUT  | CE0     | 10  | 8   |
 |     |     |      0v |      |   | 25 || 26 | 1 | OUT  | CE1     | 11  | 7   |
 |   0 |  30 |   SDA.0 |   IN | 1 | 27 || 28 | 1 | IN   | SCL.0   | 31  | 1   |
 |   5 |  21 | GPIO.21 |  OUT | 0 | 29 || 30 |   |      | 0v      |     |     |
 |   6 |  22 | GPIO.22 |   IN | 1 | 31 || 32 | 0 | IN   | GPIO.26 | 26  | 12  |
 |  13 |  23 | GPIO.23 |   IN | 0 | 33 || 34 |   |      | 0v      |     |     |
 |  19 |  24 | GPIO.24 |   IN | 0 | 35 || 36 | 0 | IN   | GPIO.27 | 27  | 16  |
 |  26 |  25 | GPIO.25 |   IN | 0 | 37 || 38 | 0 | IN   | GPIO.28 | 28  | 20  |
 |     |     |      0v |      |   | 39 || 40 | 0 | IN   | GPIO.29 | 29  | 21  |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
 +-----+-----+---------+------+---+---Pi 2---+---+------+---------+-----+-----+

Posted on
Sat Jul 23, 2016 12:13 pm
Hackencrash offline
User avatar
Posts: 246
Joined: Dec 16, 2015
Location: UK

Re: Small bug with OUTPUT-GPIO-1-Dimmer

As you suggested, I've used another pin for now to get around the issue :)

Posted on
Sat Jul 23, 2016 1:05 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Small bug with OUTPUT-GPIO-1-Dimmer

You will need to edit the device and reselect the pin.


Sent from my iPhone using Tapatalk

Posted on
Sat Jul 23, 2016 1:10 pm
Hackencrash offline
User avatar
Posts: 246
Joined: Dec 16, 2015
Location: UK

Re: Small bug with OUTPUT-GPIO-1-Dimmer

I chose a pin that, by default, appears to be an input GPIO pin after a reboot and everything is working as expected. Not sure what's up with GPIO24 setting and staying as an output port post reboot!


Sent from my iPhone using Tapatalk

Posted on
Sat Jul 23, 2016 3:40 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Small bug with OUTPUT-GPIO-1-Dimmer

gpio24 is a general pin, has no other function by default like RX/TX pins.

normally those pins should be undefined when not explicitly configured. could you check if you have an output device where gpio24 is still use?

here my listing:
Code: Select all
gpio -g readall
 +-----+-----+---------+------+---+---Pi 3---+---+------+---------+-----+-----+
 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 |     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |
 |   2 |   8 |   SDA.1 | ALT0 | 1 |  3 || 4  |   |      | 5V      |     |     |
 |   3 |   9 |   SCL.1 | ALT0 | 1 |  5 || 6  |   |      | 0v      |     |     |
 |   4 |   7 | GPIO. 7 |   IN | 0 |  7 || 8  | 1 | OUT  | TxD     | 15  | 14  |
 |     |     |      0v |      |   |  9 || 10 | 1 | IN   | RxD     | 16  | 15  |
 |  17 |   0 | GPIO. 0 |   IN | 0 | 11 || 12 | 0 | IN   | GPIO. 1 | 1   | 18  |
 |  27 |   2 | GPIO. 2 |   IN | 0 | 13 || 14 |   |      | 0v      |     |     |
 |  22 |   3 | GPIO. 3 |   IN | 0 | 15 || 16 | 0 | IN   | GPIO. 4 | 4   | 23  |
 |     |     |    3.3v |      |   | 17 || 18 | 0 | IN   | GPIO. 5 | 5   | 24  |
 |  10 |  12 |    MOSI | ALT0 | 0 | 19 || 20 |   |      | 0v      |     |     |
 |   9 |  13 |    MISO | ALT0 | 0 | 21 || 22 | 0 | IN   | GPIO. 6 | 6   | 25  |
 |  11 |  14 |    SCLK | ALT0 | 0 | 23 || 24 | 1 | OUT  | CE0     | 10  | 8   |
 |     |     |      0v |      |   | 25 || 26 | 1 | OUT  | CE1     | 11  | 7   |
 |   0 |  30 |   SDA.0 |   IN | 1 | 27 || 28 | 1 | IN   | SCL.0   | 31  | 1   |
 |   5 |  21 | GPIO.21 |   IN | 1 | 29 || 30 |   |      | 0v      |     |     |
 |   6 |  22 | GPIO.22 |   IN | 1 | 31 || 32 | 0 | IN   | GPIO.26 | 26  | 12  |
 |  13 |  23 | GPIO.23 |   IN | 0 | 33 || 34 |   |      | 0v      |     |     |
 |  19 |  24 | GPIO.24 |   IN | 0 | 35 || 36 | 0 | IN   | GPIO.27 | 27  | 16  |
 |  26 |  25 | GPIO.25 |   IN | 0 | 37 || 38 | 0 | IN   | GPIO.28 | 28  | 20  |
 |     |     |      0v |      |   | 39 || 40 | 0 | IN   | GPIO.29 | 29  | 21  |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
 +-----+-----+---------+------+---+---Pi 3---+---+------+---------+-----+-----+


you can use the menu to print all properties of a device. The output devices are not present in the parameters file

looks like:
Code: Select all
States : (dict)
     OUTPUT_00 :  (string)
     brightnessLevel : 0 (integer)
     onOffState : off (on/off bool)
     status :  (string)
16:37:42 RPI info:   -
{
  "enableRebootCheck": "restartLoop",
  "enableSPIpinsAsGpio": "0",
  "enableTXpinsAsGpio": "0",
  "enableiBeacons": "1",
  "input": {
    "BLEconnect": {
      "65802248": "54:9F:13:3F:95:26"
    },
    "DHTxx": {
      "961013608": ""
    },
    "INPUTgpio-1": {
      "332019181": [
        {
          "count": "off",
          "gpio": "24",
          "inpType": "low"
        }
      ],
      "573070377": [
        {
          "count": "off",
          "gpio": "21",
          "inpType": "low"
        }
      ]
    },
    "i2cBMExx": {
      "97310692": ""
    }
  },
  "ipNumberPi": "192.168.1.20",
  "ipNumberPiSendTo": "192.168.1.20",
  "output": {
    "OUTPUTgpio-1": {
      "588386865": [
        {
          "gpio": "24",
          "outType": "0"
        }
      ]
    }
  },
  "passwordPi": "xxx",
  "piDevId": 1422957889,
  "piMAC": "5C:F3:70:6D:DA:7A",
  "piNumberReceived": "0",
  "piOnOff": "1",
  "piUpToDate": 0,
  "rPiVersion": 0,
  "sensorList": "INPUTgpio-1*573070377,INPUTgpio-1*332019181,*118,BLEconnect*65802248,*17,",
  "sensorRefreshSecs": 90,
  "userIdPi": "xxx"
}
 


the GPIO pin only turns to an output pin the first it is used.

Posted on
Sun Jul 24, 2016 1:45 pm
Hackencrash offline
User avatar
Posts: 246
Joined: Dec 16, 2015
Location: UK

Re: Small bug with OUTPUT-GPIO-1-Dimmer

Sorry Karl this has baffled me how you get to print all properties for a device?

From the piBeacon Plugins menu, I see Print device lnfo to log file but nothing appears to happen after I select and EXECUTE my rPi machine. The Indigo Event Log does nothing and I don't see anything resembling this info in the home folder on the rPi or in /var/log. I've selected all options for debug level for plugin: but that doesn't seem to make a difference.

What am I doing wrong :?:

Posted on
Sun Jul 24, 2016 1:59 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Small bug with OUTPUT-GPIO-1-Dimmer

In documents/pibeacon/pibeacon.log
If you have enabled writing to log file in config


Sent from my iPhone using Tapatalk

Posted on
Sun Jul 24, 2016 2:43 pm
Hackencrash offline
User avatar
Posts: 246
Joined: Dec 16, 2015
Location: UK

Re: Small bug with OUTPUT-GPIO-1-Dimmer

Thanks! I've moved from the original GPIO24 to GPIO25 which seems to work. Can't see the conflict on GPIO24 in this file though...
Code: Select all
21:37:17 printing dev info for-Porch Panel Relay Board/257300703 -------------------------------
21:37:17 props:      -
com.karlwachs.piBeacon : (dict)
     OUTPUTstate : 0 (string)
     SupportsBatteryLevel : true (bool)
     address : Pi-1 (string)
     description : (#,gpio,type)(0:18,1);(1:27,1);(2:22,1);(3:5,1); (string)
     deviceDefs : [{"gpio": "18", "outType": "1"}, {"gpio": "27", "outType": "1"}, {"gpio": "22", "outType": "1"}, {"gpio": "5", "outType": "1"}] (string)
     displayState : status (string)
     gpio : 18 (string)
     outType : 1 (string)
     piDone : false (bool)
     piServerNumber : 1 (string)
     pinMappings : 0:18,1|1:27,1|2:22,1|3:5,1| (string)
     stateDone : false (bool)
21:37:17 states:     -
States : (dict)
     OUTPUT_00 : down (string)
     OUTPUT_01 : down (string)
     OUTPUT_02 :  (string)
     OUTPUT_03 : up (string)
     batteryLevel : 0 (integer)
     status :  (string)
21:37:17 RPI info:   -
{
  "enableRebootCheck": "reboot",
  "enableTXpinsAsGpio": "0",
  "enableiBeacons": "1",
  "input": {
    "BLEconnect": {
      "1429868393": "DC:2B:2A:04:E7:A3",
      "314921500": "7C:01:91:BB:E1:13",
      "530206011": "E0:DB:10:60:72:3A"
    },
    "INPUTgpio-1": {
      "1527957909": [
        {
          "count": "off",
          "gpio": "12",
          "inpType": "high"
        }
      ],
      "1590875007": [
        {
          "count": "off",
          "gpio": "23",
          "inpType": "open"
        }
      ],
      "462826025": [
        {
          "count": "off",
          "gpio": "25",
          "inpType": "high"
        }
      ]
    },
    "Wire18B20": {
      "1592397868": ""
    }
  },
  "ipNumberPi": "192.168.1.121",
  "ipNumberPiSendTo": "192.168.1.121",
  "output": {
    "OUTPUTgpio-4": {
      "257300703": [
        {
          "gpio": "18",
          "outType": "1"
        },
        {
          "gpio": "27",
          "outType": "1"
        },
        {
          "gpio": "22",
          "outType": "1"
        },
        {
          "gpio": "5",
          "outType": "1"
        }
      ]
    }
  },
  "passwordPi": "",
  "piDevId": 20752057,
  "piMAC": "5C:F3:70:76:D2:FB",
  "piNumberReceived": "1",
  "piOnOff": "1",
  "piUpToDate": 0,
  "rPiVersion": 0,
  "sensorList": "INPUTgpio-1*1590875007,INPUTgpio-1*462826025,INPUTgpio-1*1527957909,Wire18B20*1592397868,BLEconnect*530206011,BLEconnect*314921500,BLEconnect*1429868393,",
  "sensorRefreshSecs": 90,
  "userIdPi": ""
}

Posted on
Sun Jul 24, 2016 3:26 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Small bug with OUTPUT-GPIO-1-Dimmer

Could you switch on debug output
Something is sending a command to the pin.


Sent from my iPhone using Tapatalk

Posted on
Sun Jul 24, 2016 4:22 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Small bug with OUTPUT-GPIO-1-Dimmer

I believe I found it.

the rPi remembers the last output settings if you set the output to be persistent. It sores it in the file
execcommands.current in home/pi/
delete that file and then either restart the rPi or do:
sudo python call beacon.py

that might fix it.

This is currently not covered: If you had an output pin defined and then delete that output device in indigo that. The rpi still remembers that. Deleting that file and rebooting will make it forget that- but also all other PERSISTENT (= restore after reboot option) output settings.

will add an option to delete that file in the menu.

Karl

the file look like:
Code: Select all
cat execcommands.current
{"24": {"restoreAfterBoot": "1", "pin": "24", "inverseGPIO": false, "command": "up", "device": "OUTPUTgpio-1", "delayStart": 0}, "20": {"restoreAfterBoot": "1", "pin": "20", "inverseGPIO": false, "command": "up", "device": "OUTPUTgpio-4", "delayStart": 0}, "16": {"restoreAfterBoot": "1", "pin": "16", "inverseGPIO": false, "command": "up", "device": "OUTPUTgpio-4", "delayStart": 0}}
~ $

you could just delete the pin24 data, everything with restore after reboot will be set once the output part starts on the rPI

Posted on
Mon Jul 25, 2016 1:25 am
Hackencrash offline
User avatar
Posts: 246
Joined: Dec 16, 2015
Location: UK

Re: Small bug with OUTPUT-GPIO-1-Dimmer

Code: Select all
pi@bluepi:~ $ ls e*
execcommands.current  execcommands.py
pi@bluepi:~ $ cat execcommands.current
{"24": {"restoreAfterBoot": "1", "pin": "24", "inverseGPIO": false, "command": "up", "device": "OUTPUTgpio", "delayStart": 0}}
pi@bluepi:~ $

:)

Who is online

Users browsing this forum: No registered users and 4 guests