[luci] How to communicate with the Json Rpc API

Clemens John clemens-john at gmx.de
Fri Aug 21 16:32:15 CEST 2009


One last question:

How do I call a function with a prefix?
For example the functions in sys.wifi?
http://luci.freifunk-halle.net/Documentation/JsonRpcHowTo#sys

Thank You
Clemens

On Friday 21 August 2009 15:29:42 Clemens John wrote:
> Sorry for this question. I didn´t knew that RPC is a protocoll that needs a 
> special client.
> Maybe you shold mention this in the howto for people who never worked with 
> such things.
> 
> Because I´m developing with Php I used the Client from 
http://jsonrpcphp.org/
> 
> My Code example to get the hostname of a router is:
> require_once './lib/classes/extern/jsonRPCClient.php';
> $auth = new jsonRPCClient('http://10.18.0.11/cgi-bin/luci/rpc/auth');
> $token = $auth->login('root', 'yourpassword');
> 
> $sys = new jsonRPCClient('http://10.18.0.11/cgi-bin/luci/rpc/sys?auth='.
> $token);
> echo $sys->hostname();
> 
> I hope this might be usefull for others who have this question.
> 
> Bye
> Clemens
> 
> On Wednesday 19 August 2009 13:13:00 Clemens John wrote:
> > Hi,
> > 
> > I read the Documentation on JsonRpc on http://luci.freifunk-
> > halle.net/Documentation/JsonRpcHowTo but I didn´t unterstand how to do it.
> > 
> > Basically I want to get the uptime of a machine.
> > How do I do that?
> > 
> > I tried "http://mymachiene/cgi-bin/luci/rpc/sys/uptime" in my browser but 
> that 
> > didn´t worked.
> > 
> > Thanks
> > Clemens
> _______________________________________________
> luci mailing list
> luci at lists.subsignal.org
> https://lists.subsignal.org/mailman/listinfo/luci


More information about the luci mailing list