I'm trying to automate below actions using uci-defaults so that i don't have todo these commands manually every time i try a new image.
I'm currently keep building images to make a very cheap openwrt domoticz solution and i am even creating a new circuit board which will include 433,92 Mhz sender and receiver, and if it all works out i'm gonna try to expand it with zwave, zigbee and other hardware solutions that can directly be inserted in this openwrt router.
Todo all this i'm currently adding usb support to the router and then copy the overlay to the usb mount it reboot the router then install the domoticz package etc etc etc.
To simplify this process would it be possible to;
Copy the overlay to the usb using uci-default commands?
If not, what is the easiest way todo this automaticly during first boot?
copy domoticz package from any location during first boot and install it.
What is the easiest way todo this automaticly during first boot?
And last question for now.
which packages are best to add support for 433,92 Mhz transmitter/receiver connected to GPIO pin ( 1 datapin is used for transmitter and 1 for receiver).
using normall scripts in uci-default seems to work fine.
I did run into another thing and that is a reboot after the files in uci-default have run.
calling another sh file that removes the uci-default file and reboots openwrt doesn't seem to work and turns out to create a loop on rebooting.
Note that only /overlay has grown but not the /
Reboot the device
Verify that the partitions were mounted properly:
System - Software should show free space of overlay partition
System - Mount Points should show USB partition mounted as overlay
mount should show USB partition mounted as /overlay
Simply put the reboot script in a detached shell and prepend the reboot command with a sleep command. Then the calling script does not wait for the reboot script to complete (which it naturally never does, as the router reboots immeaditely before the script reaches its end...)
in the calling script
( /some/path/to/rebootscript )&
In the reboot script
I have no extroot experience, and I just wonder how well the "create extroot from uci-defaults" actually goes. You need to ensure that the extroot overlay's /etc/uci-defaults does not contain the extroot creation & this reboot uci-defaults scripts. You may need to delete them in the overlay file-copy script (which you probably run before you run the reboot script).
then reboot with appropriate /usb/etc/config/fstab in place
so 99-romcopy-genextrootfstabreboot - possibly not even as a uci-default... if further initialisation needs to take place.... first boot is a DOTHIS or don't.... once.... i'd kinda like to have more leeway with re-initialising / fault handling.
Sorry for the late reply, but since the default downloadable domoticz package didnt update in the download section because of boost update.....
There is a patch in github for 8 days now for it but that isn't applied yet.
I had to learn how to compile the package with openwrt.
I got that covered now...
Creating the extroot using uci-default actually works pretty well
Althoug the wiki containing the explanation did change several times since my initial post and this reply and not everything in there is correct as i had to make some changes to make it work well.
If anyone is interested i can post a complete howto in here after i got everything working and well tested.
As of now i'm struggling on 1 part and that is adding a 433,92 Mhz receiver and transmitter using gpio. Since there isn't much user lvl documentation on this part for making that work under openwrt that is my last puzzle to make everything work.
What i got now is;
~10 dollar equipment (excluding usb drive)
Openwrt running stable under latest version build with all patches on 3-5-2019
Domoticz running stable with motherboad sensors and weatherstation.
I got 2 gpio's left on the router but somehow i can't make the receiver and/or transmitter been seen by either openwrt or domoticz.
If anyone has any clues on this i would be thankfull