Further testing. I managed to get control over the GPIO states from within the container. There is a huge number of different tools to get/set those: gpio-utils, raspi-gpio, gpiod, pigpio-tools, pigpio … all show the correct state of my pins and I’m able to toggle them as well. However, the Python library should work without any of those CLI tools.
Since from console I can check and control all pins without issues, but the WebIOPi interface fails to even get the states, I suspect a Python version incompatibility. I’ll retest on Stretch with a lower Python version. Btw as it runs as root, permissions are not the issue. Another thing we might want to change away from the installer, if we ever (want to) get this working.
The debug flag btw does not reveal anything interesting. It shows the client requests which get a 200 response code, while the issue with empty responses are not visible.
EDIT: Same issue on Stretch. Now testing the other forks.
EDIT2: As additional test I installed WiringPi, as most guides around WebIOPi use the gpio command (which is WiringPi). It works fine, but doesn’t solve the issue with WebIOPi, which still fails to show any GPIO states.
EDIT3: Okay, and it IS related to the container. The newest fork provides a better error message (or maybe Python 3 is it, which is able to run it):
No access to /dev/mem. Try running as root!
I bind-mounted it into the container, but I think it has limited write access to that generic tunable.
EDIT4: Granted CAP_SYS_RAWIO to the container, BINGO, WebIOPi works flawlessly now on my RPi2 with Python 3.7. Will check again the original version.
EDIT5: Old version still fails, to there it is not an permission issue. Installed the newer fork with Python 3 on to of it and it works fine. PR up: DietPi-Software | WebIOPi: RPi 3/4 support + Python 3 by MichaIng · Pull Request #4310 · MichaIng/DietPi · GitHub