[luci] Unable to query uci via json-rpc

chris at martin.cc chris at martin.cc
Tue Nov 9 04:42:11 CET 2010


Hi Charlie

I have been doing a bit of json using a java library, against Openwrt
8.09.2, and I am getting the same results.  it works well for networking,
which is the config that I have been testing against.  but it doesn't work
for dhcp.

It turns out that I don't have dnsmasq installed in this build.  hence no
/etc/config/dns.  hence it doesn't work

The other place I would check is your schema.  I have found in 8.09 not all
the schema are complete.  you may want to look in to that.

Let me know what version of openwrt you are using and i will try against the
same here.

Cheers

----------------------------------------------------------
Chris Martin
m: 0419812371
----------------------------------------------------------


On Mon, Oct 25, 2010 at 4:54 AM, Charles Leclerc <charles at la-mouette.net>wrote:

>  Hi everyone,
>
> I'm trying to get an json-rpc working, but I'm stuck with the uci calls.
> Before submitting a ticket, I want ti be sure that I'm doing it right.
> The other modules work fine (iI've tried uvl, sys and ipkg with success).
>
> Here is the details of a successful exchange :
>
> url : http://welcome/cgi-bin/luci/rpc/auth
> query : {"method":"login","params":["root","xxx"]}
> answer :
> {"id":null,"result":"c67ed189864f5acccbb9c27300b1a1bc","error":null}
> url :
> http://welcome/cgi-bin/luci/rpc/ipkg?auth=c67ed189864f5acccbb9c27300b1a1bc
> query : {"method":"installed","params":["luci-admin-rpc"]}
> answer : {"id":null,"result":true,"error":null}
>
> So far so good.
>
> Next I tried to do a get_all on config dhcp :
>
> url : http://welcome/cgi-bin/luci/rpc/auth
> query : {"method":"login","params":["root","xxx"]}
> answer :
> {"id":null,"result":"584f6c3d7ae00ce7f25cf3bb262d1a38","error":null}
> url :
> http://welcome/cgi-bin/luci/rpc/uci?auth=584f6c3d7ae00ce7f25cf3bb262d1a38
> query : {"method":"get_all","params":["dhcp"]}
> answer : {"id":null,"result":null,"error":{"message":"Invalid
> params.","data":"invalid argument count","code":-32602}}
>
> No matter the form or the number of arguments (I've tried many
> combinations), the server always returns "invalid argument count". Maybe
> I get all mixed up between packages, configs, section or options, I
> don't know. I just want to change my firewall configuration from a
> client program ... Perhaps ther's a better way ?
>
> Thanks for your answers !
>
> Charlie
> _______________________________________________
> luci mailing list
> luci at lists.subsignal.org
> https://lists.subsignal.org/mailman/listinfo/luci
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.subsignal.org/pipermail/luci/attachments/20101109/474fa8be/attachment-0001.htm 


More information about the luci mailing list