root@kndrt31r27:~# ubus Usage: ubus [<options>] <command> [arguments...] Options: -s <socket>: Set the unix domain socket to connect to -t <timeout>: Set the timeout (in seconds) for a command to complete -S: Use simplified output (for scripts) -v: More verbose output -m <type>: (for monitor): include a specific message type (can be used more than once) -M <r|t> (for monitor): only capture received or transmitted traffic Commands: - list [<path>] List objects - call <path> <method> [<message>] Call an object method - listen [<path>...] Listen for events - send <type> [<message>] Send an event - wait_for <object> [<object>...] Wait for multiple objects to appear on ubus - monitor Monitor ubus traffic
root@kndrt31r27:~# ubus list dhcp dnsmasq file hostapd.wlan0 iwinfo kroks.dev.modem kroks.dev.modem.modem1 kroks.dev.modem.modem1.simcard kroks.dev.modem.modem1.simcard.modem1sim1 kroks.dev.modem.modem1.simcard.modem1sim2 kroks.dev.modem.modem1.sms kroks.net.check log luci luci-rpc mwan3 network network.device network.interface network.interface.lan network.interface.loopback network.interface.modem1 network.interface.wan network.interface.wan6 network.rrdns network.wireless service session system uci
root@kndrt31r27:~# ubus call kroks.dev.modem.modem1 bands { "egsm": true, "utran-8": true, "eutran-3": true, "eutran-20": true, "eutran-40": true, "eutran-1": false, "eutran-41": false, "eutran-28": false, "eutran-38": true, "eutran-7": true, "utran-1": true, "dcs": true, "eutran-8": true }
Рассмотрим на примере примера выше с bands.
Как видно, включены все частоты, кроме band-1, band-41, band-28. Включим их, но выключим band-20.
root@kndrt31r27:~# ubus call kroks.dev.modem.modem1 bands '{"eutran-1": true, "eutran-41": true, "eutran-28": true, "eutran-20": false}' { "eutran-1": true, "utran-8": true, "utran-1": true, "eutran-20": false, "eutran-40": true, "eutran-28": true, "eutran-41": true, "egsm": true, "eutran-3": true, "eutran-7": true, "eutran-38": true, "dcs": true, "eutran-8": true }
root@kndrt31r28:~# ubus -v list kroks.dev.modem.modem1* 'kroks.dev.modem.modem1' @827e6f0c "object":{"folder":"String"} "simtoggle":{} "simcard":{} "power":{} "modes":{} "state":{} "capabilities":{} "bands":{} 'kroks.dev.modem.modem1.simcard' @e7744e76 "object":{} 'kroks.dev.modem.modem1.simcard.modem1sim1' @119a2c80 "object":{"folder":"String"} 'kroks.dev.modem.modem1.sms' @8a46f205 "object":{"folder":"String"} "cleanup":{"timestamp":"Integer","commit":"Boolean"} "send":{"number":"String","smsc":"String","storage":"String","class":"Integer","validity":"String","delivery-report-request":"Boolean","text":"String"}