Newbie having trouble with GPIO on Raspberry Pi

I’m new to OpenHAB and using the GPIO pins on the Raspberry Pi. I set up a simple page up to do an LED on/off test. The page comes up as expected but the LED doesn’t turn on when I select to turn it on. Here are all the steps I took while installing OpenHAB on a fresh install of Raspbian

  1. sudo apt-get update

  2. sudo apt-get upgrade

  3. java -version
    *(java version 1.8.0_65 was installed)

  4. wget -qO - ‘https://bintray.com/user/downloadSubjectPublicKey?username=openhab’ | sudo apt-key add -

  5. echo “deb http://dl.bintray.com/openhab/apt-repo stable main” | sudo tee /etc/apt/sources.list.d/openhab.list

  6. sudo apt-get update

  7. sudo apt-get install openhab-runtime

  8. sudo /etc/init.d/openhab start
    Returned message "[ ok ] Starting openhab (via systemctl): openhab.service."

  9. sudo echo 4 > /sys/class/gpio/export

  10. sudo cp /etc/openhab/configurations/openhab_default.cfg /etc/openhab/configurations/openhab.cfg

  11. sudo leafpad /etc/openhab/configurations/openhab.cfg
    uncommented “gpio:sysfs=/sys” and "gpio:debounce=10"

  12. sudo apt-get install libjna-java
    version 4.1.0-1 was installed

  13. sudo apt-get install openhab-addon-binding-gpio

  14. sudo leafpad /etc/default/openhab
    changed USER_AND_GROUP=openhab:openhab to USER_AND_GROUP=root:root)
    changed JAVA_ARGS= to JAVA_ARGS=-Djna.boot.library.path=/usr/lib/jni

  15. sudo leafpad /usr/lib/systemd/system/openhab.service
    changed User and Group from openhab to root

  16. sudo touch /etc/openhab/configurations/sitemaps/home.sitemap

  17. sudo touch /etc/openhab/configurations/items/home.items

  18. sudo leafpad /etc/openhab/configurations/items/home.items
    inserted the following text
    //------------------------------------------------------------------------
    // Raspberry Pi
    // GPIO
    //------------------------------------------------------------------------
    Switch LED{ gpio=“pin:4” }

  19. sudo leafpad /etc/openhab/configurations/sitemaps/home.sitemap
    inserted the following text

sitemap home label=“Home”
{
//------------------------------------------------------------------------
// Raspberry Pi
// GPIO
//------------------------------------------------------------------------
Frame label=“Rasperry Pi GPIO”
{
Switch item=LED
}
}

As I stated the page opened as expected but when I try to turn the LED on nothing happens. The following error can be found in the log file
"[ERROR] [.o.b.gpio.internal.GPIOBinding] - Error occured while creating backend object for item LED, exception: /sys/class/gpio/export"
To make sure the LED was wired up correctly I ran “echo high > /sys/class/gpio/gpio4/direction” and it fired right up

Can anyone tell where I went wrong?

install the gpio binding…

That’s what I did in step 13 as far as I know

Finally got it working. After combing through some forums again after a night of sleep I figured out where I went wrong. I guess since I am running OpenHAB as root I don’t need to export the GPIO pins. I just stoped OpenHAB, unexported the pin, started OpenHAB back up, and it worked.