WebThingsIO / gpio-adapter

GPIO adapter add-on for WebThings Gateway
Mozilla Public License 2.0
5 stars 12 forks source link

Pin Naming for GPIO Adapter #12

Closed mrstegeman closed 6 years ago

mrstegeman commented 6 years ago

Originally from: https://github.com/mozilla-iot/gateway/issues/681

The example at Configuring GPIO for use with the gpio adapter uses pin 18.

{
  "pins": {
    "18": {
      "direction": "out",
      "name": "led",
      "value": 0
    }
  }
}

However, there are two ways of numbering the pins:

See Appendix 1. A note on pin numbering.

Wouldn't GPIOs instead on Pins be more adequate?

{
  "gpios": {
    "18": {
      "direction": "out",
      "name": "led",
      "value": 0
    }
  }
}
dhylands commented 6 years ago

I'd be happy to rename this as gpios. We'd probably want the code to look for both (preferring gpio, but allowing pins for backwards compatability)

We use the numbering scheme used by the gpio subsystem of the linux kernel, which isn't related to the numbering on the connector, but rather related to the GPIO numbering on the CPU chip.

Geoff46 commented 4 years ago

I've just started using the Mozilla-iot gateway to control the GPIOs on a Raspberry Pi. I've successfully set it up to turn a pin on and off. However I want to change the name I originally gave the button when setting it up. I have changed the name in the GPIO configuration screen but when I go back to the control screen it still has the old name. I've tried re-scanning but it still doesn't update to the new name. What am I missing? Grateful for any pointers. Thanks

Geoff46 commented 4 years ago

As an addition to my previous post: I tried adding another button in the GPIO configuration with the new name but it doesn't appear in the control screen. I deleted the original button from the GPIO configuration but it still appears. I will try removing the GPIO addon completely and then re-installing it.

Geoff46 commented 4 years ago

Well, I'm getting nowhere - whatever I do the interface has permanently set itself on what I originally added. I can't change it, delete the old, or add any new, button to control the GPIO. I'm stumped!

Geoff46 commented 4 years ago

Just notice this thread is closed - I will start a new one.