Re: [OpenWrt-Devel] Can we configure OpenWrt by 'curl' ?

2012-05-29 Thread Xiangfu Liu
Hi My problem is after 'curl_easy_perform' , the connection always close. The output like: http://pastebin.com/U5Yyx5Mn Why the connection always close after each 'curl_easy_perform' the 192.168.42.1 is OpenWrt with luci-mod-rpc installed Is the problem on my code? (code is here:

Re: [OpenWrt-Devel] Can we configure OpenWrt by 'curl' ?

2012-05-29 Thread Xiangfu Liu
Hi By remove the line 38,39 of http://luci.subsignal.org/trac/browser/luci/trunk/modules/rpc/luasrc/controller/rpc.lua I can call those exported libraries. but how to set this params. from the lua code, it has to be 'table'. curl -v -H Accept: application/json -H Content-type:

Re: [OpenWrt-Devel] Can we configure OpenWrt by 'curl' ?

2012-05-13 Thread Xiangfu Liu
Thanks Mirko Since I don't have much experience on json-rpc. can you give me some example? I have tried curl http://192.168.1.1/cgi-bin/luci/rpc/net/devices it give me nothing. I have installed those two packages: CONFIG_PACKAGE_luci-mod-rpc=m CONFIG_PACKAGE_luci-lib-json=m Thanks again

Re: [OpenWrt-Devel] Can we configure OpenWrt by 'curl' ?

2012-05-13 Thread Xiangfu Liu
Hi ok, I have to create a JSON request. this one is working: curl -v -H Accept: application/json -H Content-type: application/json -X POST -d '{jsonrpc:1.0,method: login, params: {username:root, password:x}, id:0}' http://192.168.1.1/cgi-bin/luci/rpc/auth Will look into more. then report

[OpenWrt-Devel] Can we configure OpenWrt by 'curl' ?

2012-04-27 Thread Xiangfu Liu
Hi I am think use only curl to configure OpenWrt. like: for get wireless list curl http://192.168.0.1/cgi-bin/luci/admin/network/wireless/ for connect to one of them: curl http://192.168.0.1/cgi-bin/luci/admin/network/wireless/SSID=ssid;PW=passwd I don't know much about 'lua', please

Re: [OpenWrt-Devel] Can we configure OpenWrt by 'curl' ?

2012-04-27 Thread Mirko Vogt
As part of LuCI there is a JSON-RPC interface which can be used to configure OpenWrt. With the uci-package you can easily read/write/apply/commit uci related things. http://luci.subsignal.org/trac/wiki/Documentation/JsonRpcHowTo On 04/27/2012 11:41 AM, Xiangfu Liu wrote: Hi I am think use

Re: [OpenWrt-Devel] Can we configure OpenWrt by 'curl' ?

2012-04-27 Thread Christian Gagneraud
On 27/04/12 12:11, Mirko Vogt wrote: As part of LuCI there is a JSON-RPC interface which can be used to configure OpenWrt. With the uci-package you can easily read/write/apply/commit uci related things. http://luci.subsignal.org/trac/wiki/Documentation/JsonRpcHowTo BTW, the links in the UVL

Re: [OpenWrt-Devel] Can we configure OpenWrt by 'curl' ?

2012-04-27 Thread Mirko Vogt
As far as I know UVL is unmaintained and got obsoleted. This still doesn't fix the broken links however :) On 04/27/2012 01:15 PM, Christian Gagneraud wrote: On 27/04/12 12:11, Mirko Vogt wrote: As part of LuCI there is a JSON-RPC interface which can be used to configure OpenWrt. With the