How to design a Python parser for UCI?

Hey everyone,

I am trying to build a mobile app for configuring a new SSID on an OpenWrt router. I have some newbie questions regarding this. As per my understanding:

Unified Configuration Interface (UCI) is an API of OpenWrt which is also a utility to intend and to centralize the whole configuration of a device running on OpenWrt.

Now, my flow should be as follows:

  1. User connects to the default SSID and login to the shell via default CLI login credentials.
  2. User enters the new SSID name and password.
  3. Python backend (on the app) converts this configuration via a parser in the UCI format.
  4. Push this command to the router.

Now my questions are:

  1. Is my understanding correct for the flow? Is something missing?
  2. Is there a way to get a Python/C parser or will I have to write it on my own?

I am not from a Computer Science background. Kindly help me.

If you're developing a mobile app anyway it might make more sense to talk ubus over JSON-RPC in order to invoke uci operations.

1 Like