The "normal" procedure for controlling LEDs is not by changing the default configuration using "uci". All controllable LEDs should be accessible at "/sys/class/leds"; you can just read and write from those "files".
If you share your code others can have a look at it, and point where could be the issue.
If you are willing to enter the rabbit hole, search for these terms, and keep yourself entertained for an evening or two: HomeAssistan, Domoticz, Tasmota, ESPHome, OpenHAB, Arduino, ESP8266, ESP32, firmata, ...
In my google search i saw that everybody does this way (/sys/class/leds), but in my tests when the router reboot it always back to defaults set in the config files. I was thinking about that. if the router reboots, it returns in last state
From the list I only know 2 terms: arduino and Domoticz. I'll do my homework
I only have a static html page I tried to make it dynamic.. I did like the LuCI index.html
and called a script in /www/cgi-bin ... in what language should this script be? is it lua? everything I tryed I have failed. I've even copy/paste a Hello World and it didn't run (permissions 755)
I miss something like
Because of your resource constraints, best to have static HTML only.
LUA should also be possible to be used.
In case, you can drop LuCI completely, streamline your 18.06 (?) by removal of non-required stuff (PPP etc.), debug file system etc. and you are willing to build custom image, you might be able to install PHP.
actually... crelay supports raw gpio outputs... ( depending on your release... you may need to unload/uninstall a module or edit your dts to free up the gpio's )
Sorry, I have no expirience in using LUA on openwrt to serve and process web pages.
But I used PHP rather extensively on openwrt-devices having more resources.
However, the 4/32 might be sufficient enough for some old openwrt, which you need to use, anyway, and some streamlined PHP. Assuming, you give up LUCI, and some more.
Frankly speaking, interesting question, whether it will fit. Which version of openwrt do you use ?
OK, I will try to build a minimal image for your device, without LuCI, and some more streamlining. But having PHP. Lockdown is boring, anyway Will let you know, whether it is possible. 17.01.5 should be best, because of PHP5 (I hope).
Package removal does not release the space in flash.
Either to use imagebuilder, or, even better, build from src. Which I will do.
Should be ready tomorrow, latest.
Yes, that is expected behaviour. Bear in mind that each time you reconfigure the defaults, you are writing to your device's flash memory, which has a limited lifespan.
You are correct. I tried to build 18.06 image, but that is still too large.
But: I succeeded to build image for 15.05, incl. php5 and php5-cgi.
U R a brave man, and give it a try ?
I can also provide the build environment, ubuntu 16.04 in a Virtual-Box VM. So you can modify image yourself, as the PHP5 is without quite a few configurable/optional modules, which you might add, in case you need some.
No LuCI, of course. You need to SSH into the router.