<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Provisioning Certificates Kills GNSS in the asset tracker v2</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/92701/provisioning-certificates-kills-gnss-in-the-asset-tracker-v2</link><description>Hi There. 
 
 I&amp;#39;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] &amp;lt;err&amp;gt; i2c_nrfx_twim</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 22 Dec 2022 08:21:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/92701/provisioning-certificates-kills-gnss-in-the-asset-tracker-v2" /><item><title>RE: Provisioning Certificates Kills GNSS in the asset tracker v2</title><link>https://devzone.nordicsemi.com/thread/401848?ContentTypeID=1</link><pubDate>Thu, 22 Dec 2022 08:21:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7ad7a1ea-18ad-4e73-9015-9627d5de9a53</guid><dc:creator>Marshall</dc:creator><description>&lt;p&gt;I think I sorted it; it pays to express the problem sometimes.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I subscribed to the modems events and hooked out - MODEM_EVT_INITIALIZED&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/applications/asset_tracker_v2/doc/modem_module.html"&gt;Modem module &amp;mdash; nRF Connect SDK 2.2.99 documentation (nordicsemi.com)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When I see this, we simply check the certificates, I&amp;#39;m not sure if there are any timing issues, associated with this, i.e what if the certficate doesn&amp;#39;t exist and we have to write it, will the modem carry on with it&amp;#39;s connect events?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Anyway good to get it sorted finally.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/* Message handler for all states. */
static void on_all_states(struct opito_msg_data *msg)
{
	if (IS_EVENT(msg, util, UTIL_EVT_SHUTDOWN_REQUEST)) {
		/* The module doesn&amp;#39;t have anything to shut down and can
		 * report back immediately.
		 */
		SEND_SHUTDOWN_ACK(opito, OPITO_EVT_SHUTDOWN_READY, self.id);
		state_set(STATE_SHUTDOWN);
	}


	if (IS_EVENT(msg, modem, MODEM_EVT_INITIALIZED)){
		opito_check_certificates();
	}

}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Regards&amp;nbsp;&lt;br /&gt;Marshall&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Provisioning Certificates Kills GNSS in the asset tracker v2</title><link>https://devzone.nordicsemi.com/thread/401835?ContentTypeID=1</link><pubDate>Thu, 22 Dec 2022 06:42:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:030c7d39-e4c8-490e-a93e-75ce9d1d72d5</guid><dc:creator>Marshall</dc:creator><description>&lt;p&gt;I know this thread a couple of months old, however the problem persists.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m now a (little) bit more familiar with AT2 and I think I know what the issue is, just not how to resolve it.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The nrf9160 manual states that the modem needs to have the &amp;quot;&lt;span class="keyword cmdname"&gt;%XCOEX0&lt;/span&gt;&lt;span&gt;&amp;nbsp;command needs to be sent before any modem activity occurs&amp;quot; (&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fref_at_commands%2FREF%2Fat_commands%2Fsip_pin_configuration%2Fxcoex0.html&amp;amp;cp=2_1_5_0"&gt;Nordic Semiconductor Infocenter&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;I was sending the modem the certificate checks first thing, so this of course violates the condition for writing the COEX0 command first.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;However the certificate check must be done (&lt;span&gt;write and delete operations) are allowed only when the modem is not activated.&amp;nbsp;&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fref_at_commands%2FREF%2Fat_commands%2Fsip_pin_configuration%2Fxcoex0.html&amp;amp;cp=2_1_5_0"&gt;Nordic Semiconductor Infocenter&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So....&amp;nbsp;&lt;/p&gt;
&lt;p&gt;How to I trap a &amp;quot;location setup complete event&amp;quot; and insert another command before the &amp;quot;modem setup event&amp;quot;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;ie. The init flow needs to be sequenced like this.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;boot -&amp;gt; LED -&amp;gt; GNSS -&amp;gt; Certificate Check/write -&amp;gt; Modem -&amp;gt; etc&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This is the same in V2.1.0 and V2.2.0&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Marshall&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Provisioning Certificates Kills GNSS in the asset tracker v2</title><link>https://devzone.nordicsemi.com/thread/401124?ContentTypeID=1</link><pubDate>Fri, 16 Dec 2022 23:26:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a986b5df-8d53-4e30-a383-30f41fafca49</guid><dc:creator>Marshall</dc:creator><description>&lt;p&gt;%XMONITOR: 1,&amp;quot;One NZ&amp;quot;,&amp;quot;One NZ&amp;quot;,&amp;quot;53001&amp;quot;,&amp;quot;A680&amp;quot;,7,28,&amp;quot;00166103&amp;quot;,,,,,&amp;quot;&amp;quot;,&amp;quot;00001010&amp;quot;,&amp;quot;11000001&amp;quot;,&amp;quot;01001111&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Provisioning Certificates Kills GNSS in the asset tracker v2</title><link>https://devzone.nordicsemi.com/thread/390588?ContentTypeID=1</link><pubDate>Thu, 13 Oct 2022 09:14:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ec5c9ff-ee67-4a29-8c9c-9a4a4b336dfb</guid><dc:creator>Elfving</dc:creator><description>&lt;p&gt;Could you run &lt;a href="https://infocenter.nordicsemi.com/topic/ref_at_commands/REF/at_commands/nw_service/xmonitor_set.html"&gt;XMONITOR &lt;/a&gt;for me?&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Elfving&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Provisioning Certificates Kills GNSS in the asset tracker v2</title><link>https://devzone.nordicsemi.com/thread/390365?ContentTypeID=1</link><pubDate>Wed, 12 Oct 2022 07:28:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:938e6743-09f7-49d7-a368-0d48dc92ed0d</guid><dc:creator>Marshall</dc:creator><description>&lt;p&gt;Hi Elfving - here is the complete prj.conf&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;at+cereg? =&amp;nbsp;+CEREG: 0,1,&amp;quot;A680&amp;quot;,&amp;quot;00054B02&amp;quot;,7&lt;/p&gt;
&lt;p&gt;at+cereg=? =&amp;nbsp;+CEREG: (0,1,2)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I also have the aws.conf and the debug.conf as fragments in the build (these are unchanged)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#
# Copyright (c) 2021 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

# General config
CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
CONFIG_ASSERT=y
CONFIG_REBOOT=y
CONFIG_FPU=y

# Heap and stacks
CONFIG_HEAP_MEM_POOL_SIZE=47250
CONFIG_MAIN_STACK_SIZE=1408
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
CONFIG_HW_STACK_PROTECTION=y
# Increase AT monitor heap size to be able to fit both neighbor cell measurement
# and other AT notifications that may come in rapid succession.
CONFIG_AT_MONITOR_HEAP_SIZE=1024

# Logging
CONFIG_LOG=y
CONFIG_LOG_MODE_DEFERRED=y

# nRF modem library
CONFIG_NRF_MODEM_LIB=y

# AT Host library - Used to send AT commands directy from an UART terminal and to allow
#		    integration with nRF Connect for Desktop LTE Link monitor application.
CONFIG_AT_HOST_LIBRARY=y

# Network
CONFIG_NETWORKING=y
CONFIG_NET_NATIVE=n
CONFIG_NET_SOCKETS=y
CONFIG_NET_SOCKETS_OFFLOAD=y
CONFIG_NET_IPV6=y
CONFIG_NET_IPV4=y

# LTE link control
CONFIG_LTE_AUTO_INIT_AND_CONNECT=n
CONFIG_LTE_NETWORK_MODE_LTE_M_GPS=y
## Power saving timers.
### 320 hours PSM.
CONFIG_LTE_PSM_REQ_RPTAU=&amp;quot;11000001&amp;quot;
### 20 seconds active time.
CONFIG_LTE_PSM_REQ_RAT=&amp;quot;00001010&amp;quot;

# Settings - Used to store real-time device configuration to flash.
CONFIG_SETTINGS=y
CONFIG_SETTINGS_FCB=y
CONFIG_FCB=y

# FOTA
CONFIG_FOTA_DOWNLOAD=y
CONFIG_DFU_TARGET=y
CONFIG_DOWNLOAD_CLIENT=y
CONFIG_DOWNLOAD_CLIENT_HTTP_FRAG_SIZE_1024=y
CONFIG_DOWNLOAD_CLIENT_STACK_SIZE=4096
CONFIG_DOWNLOAD_CLIENT_BUF_SIZE=2300
CONFIG_DOWNLOAD_CLIENT_MAX_HOSTNAME_SIZE=128

# Flash - Used in FOTA, settings and storage for P-GPS.
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_STREAM_FLASH=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y

# MCUBOOT
CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_IMG_MANAGER=y
CONFIG_MCUBOOT_IMG_MANAGER=y
CONFIG_IMG_ERASE_PROGRESSIVELY=y

# Watchdog
CONFIG_WATCHDOG_APPLICATION=y

# Application Event Manager
CONFIG_APP_EVENT_MANAGER=y
CONFIG_APP_EVENT_MANAGER_LOG_EVENT_TYPE=n

# cJSON - Used in cloud data encoding.
CONFIG_CJSON_LIB=y

# CAF - Common Application Framework
CONFIG_CAF=y
CONFIG_LED=y
CONFIG_CAF_LEDS=y
CONFIG_CAF_INIT_LOG_LED_READY_EVENTS=n
CONFIG_CAF_INIT_LOG_LED_EVENTS=n
CONFIG_CAF_INIT_LOG_MODULE_STATE_EVENTS=n

# Default cloud transport service
CONFIG_NRF_CLOUD_AGPS=n
CONFIG_MODEM_ANTENNA_AT_MAGPIO=&amp;quot;AT%XMAGPIO=1,1,1,7,1,746,803,2,698,748,2,1710,2200,3,824,894,4,880,960,5,791,849,7,1565,1586&amp;quot;
CONFIG_MODEM_ANTENNA_AT_COEX0=&amp;quot;AT%XCOEX0=1,1,1565,1586&amp;quot;
CONFIG_NRFX_PWM1=y
CONFIG_NRFX_PWM2=y
CONFIG_NEWLIB_LIBC_MIN_REQUIRED_HEAP_SIZE=2048


#MKB Additions Oct 22
#for key loading automatically.
CONFIG_MODEM_KEY_MGMT=y
CONFIG_MAIN_STACK_SIZE=4096 


#for Flash



#for LED WS2812.
CONFIG_LED_STRIP=y
CONFIG_WS2812_STRIP=y
#CONFIG_TFM_KEY_FILE_S=&amp;quot;C:/ncs/v2.1.0/modules/tee/tf-m/trusted-firmware-m/bl2/ext/mcuboot/root-RSA-3072.pem&amp;quot;
#CONFIG_TFM_KEY_FILE_NS=&amp;quot;C:/ncs/v2.1.0/modules/tee/tf-m/trusted-firmware-m/bl2/ext/mcuboot/root-RSA-3072_1.pem&amp;quot;
CONFIG_NRFX_SPIM1=y
CONFIG_NRFX_TWIM2=y

CONFIG_SPI_NOR=y
CONFIG_SPI_NOR_IDLE_IN_DPD=y


CONFIG_LIS2DH=y
CONFIG_LIS2DH_TRIGGER_GLOBAL_THREAD=y
CONFIG_LIS2DH_ACCEL_RANGE_2G=y
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Provisioning Certificates Kills GNSS in the asset tracker v2</title><link>https://devzone.nordicsemi.com/thread/390270?ContentTypeID=1</link><pubDate>Tue, 11 Oct 2022 12:51:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64ecc45a-ca96-492b-a132-bfe5e7e7fcd9</guid><dc:creator>Elfving</dc:creator><description>&lt;p&gt;Hello Marshall,&lt;/p&gt;
&lt;p&gt;Could you provide me the .conf file your are using? And could you run &lt;a href="https://infocenter.nordicsemi.com/topic/ref_at_commands/REF/at_commands/nw_service/cereg_read.html"&gt;CEREG &lt;/a&gt;for me?&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Elfving&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Provisioning Certificates Kills GNSS in the asset tracker v2</title><link>https://devzone.nordicsemi.com/thread/390022?ContentTypeID=1</link><pubDate>Mon, 10 Oct 2022 12:57:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:99c61f31-e319-490c-aa30-448b9dd27949</guid><dc:creator>Elfving</dc:creator><description>&lt;p&gt;Hello Marshall,&lt;/p&gt;
&lt;p&gt;I will get back to you on this.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Elfving&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>