Private MQTT example in c

Currently I am using JS to perform the MQTT (private server) connection
it is working by using the setting in “mos.yml”


  • [“mqtt.server”, “”]
  • [“mqtt.enable”, true]
  • [“mqtt.max_queue_length”, 10]


Would like to know any example Application available for MQTT in C code ?
I am able to get WiFi connected by setting parameters in “config_schema”
Any specific code I need to call to start the MQTT server connection ?

If mqtt.enable is set to true, the mqtt library takes care of connecting with the MQTT broker specified by mqtt.server.

It works after I reboot the device again… not sure why not working before.
On a some what related subject.
I try to read back the “” from the config_schema,
the example in JS is simple :

Cfg.get('');        // returns a string

But how do I do the same in C API ?


Thanks for info.
Since I still new to the platform, in general how could I search for available API calls ? other than open
In this case, “mgos_sys_config_get_device_id()”

Configuration infrastructure

If I want to read real time setting of the WiFi, how should I do it ?

I tried the function below but it read back the setting in “config_schema:” only