I'm trying to change the value of GPIO port manually.
To change the value of gpio18 (physical port 12), I did as follow:
# gpio unexportall
# echo 18 > /sys/class/gpio/export
# echo out > /sys/class/gpio/gpio18/direction
# cat /sys/class/gpio/gpio18/value #output is 0
# echo 1 > /sys/class/gpio/gpio18/value
# cat /sys/class/gpio/gpio18/value #output is 1
For gpio7 (physical port 26) I perform the exact commands as above. But the value remains 0:
# echo 7 > /sys/class/gpio/export
# echo out > /sys/class/gpio/gpio7/direction
# cat /sys/class/gpio/gpio7/value #output is 0
# echo 1 > /sys/class/gpio/gpio7/value
# cat /sys/class/gpio/gpio7/value #output is 0 again
I've tried with all other gpio ports. All ports function properly except gpio7 and gpio11 (the value is always 0).
By the way before using this raspberry pi, I was working with another raspberry pi2. Strangely the gpio7 in the previous raspberry pi had the same problem too. Is it a hardware problem or I am doing something wrong?
Edit: Only Ethernet cable and power bank are connected to raspberry pi. By the way this is the first time that I'm using this raspberry pi.
sudo raspi-gpio get
to see if the pin is set to any unusual mode. It appears that you may have damaged the pin, which is usually the case when you can't change.