I’m trying to write an RPC callback method that will allow users to refresh their configuration settings. I started using the sum_cb() example, and added both my config read method and a LOG, but it seems that neither of them are called, even though the callback executes and returns the result as expected.
Is there some reason I can’t call other methods from a callback?
Sure, it’s easy to reproduce. I took the example C language application, added the mgos_rpc.h include, the sample RPC sum_cb() and was able to reproduce it. Calling RPC.List shows that Sum is there, and calling Sum displays the result. The logged text never appears. Code below.
Ahhh, I see.
You can’t see the log message when you are not running mos console.
You can’t use the serial console and mos call over UART in the same time.
You will need to add, e.g. the wifi and rpc-ws libraries, configure wifi and run mos console over UART and mos --port ws://IP/rpc call Sum '{"a": 7, "b": 8}'