Hi,Jow
I do following action on my side but still met the problem .
1. touch /tmp/wifi.log
2. chmod 777 /tmp/wifi.log
3. echo error > /tmp/wifi.log
4. change the mywifi.lua as your suggestion .
function o.write(self, section, value)
luci.sys.exec("iwconfig wlan0 channel %d 2>&1 1>/tmp/wifi.log" % value)
Value.write(self, section, value)
end
5. run 'iwconfig wlan0 channel 11' by manual and got foloowing error
, this mean the command can't run correctly as i expected .
Error for wireless request "Set Frequency" (8B04) :
SET failed on device wlan0 ; No such device.
6. Change the channel number by web page .
7. /tmp/wifi.log see nothing
8. run 'iwconfig wlan0 channel 11 2>&1 1>/tmp/wifi.log' on console
but see nothing too
root@OpenWrt:/usr/lib/lua/luci/model/cbi# iwconfig wlan0 channel 11
2>&1 1>/tmp/wifi.log
Error for wireless request "Set Frequency" (8B04) :
SET failed on device wlan0 ; No such device.
root@OpenWrt:/usr/lib/lua/luci/model/cbi# cat /tmp/wifi.log
root@OpenWrt:/usr/lib/lua/luci/model/cbi#
Seems the redirect output(error/out) to file didn't works .
Do i miss something with openwrt ?
Thanks a lot
Best Regards
Peter Meng
On Tue, Feb 28, 2012 at 11:44 PM, Jo-Philipp Wich <[email protected]> wrote:
> You can't just print to the browser from there.
> Use syslog or let the command write to a file, e.g.
>
> luci.sys.exec("iwxxx wlan0 channel %d 2>&1 1>/tmp/debug.log" % value)
>
> ~ Jow
> _______________________________________________
> openwrt-users mailing list
> [email protected]
> https://lists.openwrt.org/mailman/listinfo/openwrt-users
_______________________________________________
openwrt-users mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-users