Using nrf9160-DK and nrfCloud - Control GPIO from the nrfCloud

There are many examples available where nrf9160 is reporting data to nrfcloud or some other service. However I cannot find an example where an external application over MQTT or nrfcloud REST API would perform an activity. I am using nrf9160DK as my dev board, I will port the code to Feather later on.

I guess I found a piece of code where this kind of connection is handled(multi service mqtt example), connection.c -> cloud_event_handler function -> case NRF_CLOUD_EVT_RX_DATA_GENERAL.

Somehow I got lost where to continue next. I guess I would know how to create another sensor(just recreate temperature example), however I would like to turn on/off a GPIO pin. I know how to any retrieve data from nrfcloud with Insomnia by using GET method. But I dont know how would I handle POST command in this case. 

It seems that legacy version of asset tracker had one example with Thingy:91, but it is not available anymore(or at least I cannot find it).

Thanks,

Robert

Parents Reply
  • Great, thanks. FYI, I have been looking more into existing setup I have. I noticed that NRF_CLOUD_EVT_RX_DATA_GENERAL case is not triggered if I send message over NRFcloud console. I managed to push a data into shadow data by sending REST API (Patch) into desired/config. I am still missing the detail how can I use those fields in my application. Nevertheless, it would be good to have an example that covers the basis. 

Children
Related