rpc-service-config
RPC Service - Config
This service provides an ability to manage device configuration remotely.
It is required by the and commands.
If this library is not included in the app, those commands won't work.
It is possible to call this service programmatically via serial, HTTP/RESTful,
Websocket, MQTT or other transports
(see RPC section) or use tool.
Below is a list of exported RPC methods and arguments:
Config.Get
Get device configuration subtree. Arguments:
Example usage:
mos call Config.Get
{
"http": {
"enable": true,
"listen_addr": "80",
...
mos call Config.Get '{"key": "wifi.sta.enable"}'
true
This RPC command has a shortcut: :
mos config-get
{
"http": {
"enable": true,
"listen_addr": "80",
...
mos config-get wifi.sta.enable
true
Config.Set
Set device configuration parameters. Arguments, either:
or
{
"key": "debug.level", // Config key in dotted notation
"value": 3, // Config value, as JSON.
}
Example usage - set to :
mos call Config.Set '{"config": {"debug": {"level": 3}}}'
This RPC command has a shortcut: which sets the config
option, saves it, and reboots the device (since some config options take
effect only after reboot):
mos config-set debug.level=3
Getting configuration...
Setting new configuration...
Saving and rebooting...
Config.Save
Writes an existing device confuguration on flash, as a sequence of
files
(see description). This makes
configuration permament, preserved after device reboot. Arguments:
Example usage:
mos call Config.Save '{"reboot": true}'