-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat uci mqtt forwarder add commands and metadata #12
base: master
Are you sure you want to change the base?
Feat uci mqtt forwarder add commands and metadata #12
Conversation
I did not use the |
Thanks, in general I think this looks good! Before I merge this, let me look into if An example is how the timeservers are configured in
|
Hello, I was wondering about that. What worried me most was that to generate the configuration, the order of the options is, in this particular case, really important. This doesn't seem to be the case for other configurations, such as the For example, here the order is irrelevant:
If an external tool happens to sort the list, or an interface to display the list in the wrong order, this could break things. Another point being the display in the interface, I don't know how this works in detail so I may be wrong. But I don't think the display and configuration of But it could just be an implementation detail on LuCi and therefore not a problem. If the current method really isn't suitable, I can change it to use the |
Ah that is what you meant with:
Do you have a reference that confirms that the order is not preserved? When reading https://openwrt.org/docs/guide-user/base-system/uci#file_syntax, it says:
So it seems order is guaranteed?
I agree, but this is a limitation of the UI, not the config format. Even if the UI limits this, I think it is better to define the config format in the correct way. I don't think mixing TOML within UCI is a good idea. E.g. if we would like to parse this config and execute it within the LuCI (e.g. testing the command output), we would need to parse the TOML list first. Btw, it might actually be possible to make list elements editable once set (default is https://openwrt.github.io/luci/jsapi/LuCI.form.DynamicList.html#editable Could you allow me to push changes to this pull-request (there should be a setting that you can toggle in the PR)? Then I can look into the LuCI part. Maybe it is better merge this PR together with the LuCI changes, as the config format defines how it will be displayed in LuCI. |
8252a26
to
197cb04
Compare
Oh I didn't see that
I agree
I will modify the script to use UCI list rather than toml format. I can allow you to push, but On my fork the branch of this pull request is |
I update script. now UCI config file
generate this toml file [metadata]
[metadata.static]
serial_number=1234
[metadata.commands]
datetime=["date","-R",]
[commands]
reboot=["/usr/bin/reboot",]
shutdown=["/usr/bin/shutdown","now",] |
Implemente
Commands
andMetadata
ofchirpstack-mqtt-forwarder
with UCI inchirpstack-mqtt-forwarder.sh
for openWrt init.d service.UCI config file
generate