Hi There.
I'm using the Asset Trackerv2 as a base for my application.
If I provision certificates at boot pior to enabling the LTE connection. the GNSS is never enabled.
*** Booting Zephyr OS build v3.1.99-ncs1 ***
[00:00:00.483,428] <err> i2c_nrfx_twim: Error 0x0BAE0001 occurred for message 0
[00:00:00.483,489] <err> board_secure: Could not set buck to 1.8 V, error: -5
[00:00:00.483,489] <err> board_secure: power_mgmt_init failed with error: -5
[00:00:00.491,180] <err> ADXL362: wrong part_id: 255
[00:00:00.491,333] <err> ADXL372: failed to read id (0xFF:0xFF)
[00:00:00.491,455] <err> i2c_nrfx_twim: Error 0x0BAE0001 occurred for message 0
[00:00:00.492,919] <inf> lis2dh: fs=2, odr=0x4 lp_en=0x0 scale=9576
[00:00:00.497,131] <inf> at_host: UART check failed: 12. Dropping buffer and retrying.
[00:00:00.507,324] <dbg> watchdog: watchdog_timeout_install: Watchdog timeout installed. Timeout: 60
[00:00:00.507,354] <dbg> watchdog: watchdog_start: Watchdog started
[00:00:00.507,385] <dbg> watchdog: watchdog_feed_enable: Watchdog feed enabled. Timeout: 30000
[00:00:00.507,568] <inf> opito: Provisioning certificates <-----------------HERE
[00:00:00.599,884] <dbg> cloud_module: state_set: State: STATE_LTE_INIT
[00:00:00.599,914] <dbg> cloud_module: sub_state_set: Sub state: SUB_STATE_CLOUD_DISCONNECTED
[00:00:00.600,006] <dbg> data_module: state_set: State: STATE_CLOUD_DISCONNECTED
[00:00:00.600,433] <dbg> data_module: config_settings_handler: Device configuration loaded from flash
[00:00:00.600,463] <dbg> settings: settings_call_set_handler: set-value OK. key: data_module/config
[00:00:00.600,555] <dbg> date_time: date_time_core_register_handler: Registering handler 0x44737
[00:00:00.600,646] <dbg> modem_module: state_set: State transition STATE_INIT --> STATE_DISCONNECTED
[00:00:00.601,226] <dbg> gnss_module: state_set: State transition STATE_INIT --> STATE_RUNNING <------------------------HERE
[00:00:00.601,470] <dbg> sensor_module: state_set: State: STATE_INIT
[00:00:00.601,501] <err> ext_sensors: Temperature sensor device is not ready
[00:00:00.601,501] <err> sensor_module: EXT_SENSOR_EVT_TEMPERATURE_ERROR
[00:00:00.601,531] <err> ext_sensors: Humidity sensor device is not ready
[00:00:00.601,562] <err> sensor_module: EXT_SENSOR_EVT_HUMIDITY_ERROR
[00:00:00.601,562] <err> ext_sensors: Pressure sensor device is not ready
[00:00:00.601,593] <err> sensor_module: EXT_SENSOR_EVT_PRESSURE_ERROR
[00:00:00.601,593] <err> ext_sensors: Low-power accelerometer device is not ready
[00:00:00.601,623] <err> sensor_module: EXT_SENSOR_EVT_ACCELEROMETER_ERROR
[00:00:00.601,715] <dbg> cloud_module: state_set: State transition STATE_LTE_INIT --> STATE_LTE_DISCONNECTED
[00:00:00.764,343] <inf> app_event_manager: APP_EVT_START
[00:00:00.764,434] <dbg> gnss_module: state_set: State transition STATE_RUNNING --> STATE_INIT <-------------------DEFINITELY HERE
[00:00:00.764,526] <dbg> ui_module: state_set: State transition STATE_INIT --> STATE_RUNNING
[00:00:00.764,556] <dbg> ui_module: sub_state_set: Sub state: SUB_STATE_ACTIVE
[00:00:00.764,556] <dbg> ui_module: sub_sub_state_set: Sub state: SUB_SUB_STATE_GNSS_INACTIVE
I've definitely tracked it to provisioning certificates - after hours of work.
The function call is standard
#if defined(CONFIG_MQTT_LIB_TLS)
static int certificates_provision(void){
int err = 0;
LOG_INF("Provisioning certificates");
#if defined(CONFIG_NRF_MODEM_LIB) && defined(CONFIG_MODEM_KEY_MGMT)
//err = modem_key_mgmt_write(CONFIG_MQTT_TLS_SEC_TAG,
err = modem_key_mgmt_write(24,
MODEM_KEY_MGMT_CRED_TYPE_CA_CHAIN,
ca_certificate,
strlen(ca_certificate));
if (err) {
LOG_ERR("Failed to provision CA certificate: %d", err);
return err;
}
#endif
return err;
}
#endif /* defined(CONFIG_MQTT_LIB_TLS) */
Any ideas?
Thanks
Marshall