Hello, guys.
We have nRF9160DK and nRF Connect SDK v1.3.0. The version of the LTE modem firmware is the latest (v.1.2.0).
In our design, we are able to initially connect to AWS IoT and exchange the data with the Cloud by using cloud_client example as a starting point. However, the trouble comes when we want to re-connect:
modem_configure() function is throwing the following error:
E: Modem could not be configured, error: -120
Before trying to re-connect, we close the Cloud connection with the following function calls:
int iot_stop(void) { int ret; ret = cloud_disconnect(cloud_backend); printk("cloud_disconnect = %d\n", ret); return cloud_uninit(cloud_backend); }
cloud_disconnect() function executes properly but cloud_uninit(cloud_backend) is returning -134. Is that OK?
By the way, here is how the modem_configure() function looks like:
static int modem_configure(void) { int err = -1; err = lte_lc_init_and_connect_async(lte_handler); if (err) { LOG_ERR("Modem could not be configured, error: %d", err); } return err; }
Am I missing something here? What would be the clear way to disconnect and re-connect to the cloud? As far as I remember, there were some troubles with modem_configure() function in previous SDK versions if the function is called outside main() function context. Is that still the case?
Thanks in advance for your time and efforts.
Sincerely,
Bojan.