OctoPi 0.16.0 issues, GPIO pins not working after bootup

I have a couple of devices (cooling fan, and LED lights) connected through GPIO pins on Rpi3. This setup used to work flawlessly in OctoPi 0.14.0. after re-imaging and restoring all OctoPrint settings the GPIO commands and shell scripts do not work.

The sh scripts are very simple:
gpio mode 0 out
gpio write 0 1

then I use System Command Editor plugin to add a menu item to OctoPrint.

However after a cold boot up or a reboot the sh script does not work at all (therefore the system command menue items do not work). There are no errors or messages. simply running sh pin11_on.sh will not turn on the gpio pin.

However if I ssh to server and just run "gpio mode 0 out" one time then everything works for as long as the machine is up. running the sh scrips can turn that pin on and off without issues. Everything also works via the webUI after that. I have to do this for every used GPIO pin, otherwise scrips won't work at all.

After every reboot the issue is back.

The permissions on the sh files are set to 755. The owner is pi. Running the sh file as sudo will not work either.

Am I missing something? I have another RPi 3 running Repetier Server on Raspian with exactly the same hardware setup and everything is working fine there. OctoPi is the only one giving me this problem so far. Additionally this was all working with the OctoPi 0.14.0 and nothing has changed hardware wise other than reimaging the SD to 0.16.0.

Sounds like you might need to run the gpio mode 0 out command in a script at bootup.

Why does this happen in the first place? what is the difference between running this command via sh and same user account just typing it at the terminal?
This doesn't make any sense.

well... I added it to /etc/rc.local and no dice. it still does not work when the RPi is rebooted.

Note that /etc/rc.local runs by root during bootup. You might need to give a full path to any scripts or whatever.

I just added these lines to the /etc/rc.local:
gpio mode 0 out
gpio mode 2 out

did I do something wrong?

Do a which gpio, determine the full path and then prepend that. The root user doesn't have the same path as the pi user.