<?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>asset tracker v2 custom event</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/102890/asset-tracker-v2-custom-event</link><description>Hi All! 
 I am using asset tracker v2, NCS 2.4.0, and vs code studio. The application code is working fine. 
 Now the requirement is to add the uart event. For this, i tried the following 
 
 uart_1_module.c 
 
 
 uart_1_event.h 
 
 
 uart_1_event.c </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 29 Aug 2023 20:34:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/102890/asset-tracker-v2-custom-event" /><item><title>RE: asset tracker v2 custom event</title><link>https://devzone.nordicsemi.com/thread/443617?ContentTypeID=1</link><pubDate>Tue, 29 Aug 2023 20:34:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b66f7ea8-9dd1-4c88-b225-530a1da7f421</guid><dc:creator>justin</dc:creator><description>&lt;p&gt;as you have noticed asset tracker v2 uses the bulk send option for nrf cloud data.&amp;nbsp; this can be more efficient than sending the data in multiple messages.&lt;br /&gt;if you want to implement sending a single message, you just need to implement cloud_wrap_data_send in nrf_cloud_integration.c.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;int cloud_wrap_data_send(char *buf, size_t len, bool ack, uint32_t id,
			 const struct lwm2m_obj_path path_list[])
{
	ARG_UNUSED(path_list);

	int err;
	struct nrf_cloud_tx_data msg = {
		.data.ptr = buf,
		.data.len = len,
		.topic_type = NRF_CLOUD_TOPIC_MESSAGE,
		.id = id,
		.qos = ack ? MQTT_QOS_1_AT_LEAST_ONCE : MQTT_QOS_0_AT_MOST_ONCE,
	};

	err = nrf_cloud_send(&amp;amp;msg);
	if (err) {
		LOG_ERR(&amp;quot;nrf_cloud_send failed, error: %d&amp;quot;, err);
	}

	return err;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;NOTE: nrf cloud expects the data to be in JSON format. so when calling&amp;nbsp;cloud_wrap_data_send, the buf parameter should be a valid JSON string.&lt;br /&gt;example:&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define HELLO_WORLD &amp;quot;{\&amp;quot;hello\&amp;quot; : \&amp;quot;world\&amp;quot;}&amp;quot;
int ret = cloud_wrap_data_send(HELLO_WORLD, strlen(HELLO_WORLD), true, 0, NULL);&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: asset tracker v2 custom event</title><link>https://devzone.nordicsemi.com/thread/441830?ContentTypeID=1</link><pubDate>Thu, 17 Aug 2023 11:11:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad489772-cd6c-4a5d-a9a4-c95332f44146</guid><dc:creator>Hakon</dc:creator><description>&lt;p&gt;Maybe &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/b49221af11d6f28b63cb178ce7f8b05747a78645/applications/asset_tracker_v2/src/cloud/nrf_cloud_integration.c#L380"&gt;cloud_wrap_batch_send()&lt;/a&gt; will work better.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: asset tracker v2 custom event</title><link>https://devzone.nordicsemi.com/thread/441824?ContentTypeID=1</link><pubDate>Thu, 17 Aug 2023 10:56:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51035ca4-82d0-4b88-8ad4-116aff041215</guid><dc:creator>Muhammad Usman</dc:creator><description>&lt;p&gt;means, the issue is at nrf cloud end? is there any alternate solution for&amp;nbsp;this&amp;nbsp;&lt;/p&gt;
[quote userid="101087" url="~/f/nordic-q-a/102890/asset-tracker-v2-custom-event/441822"]to send a &amp;quot;hello world&amp;quot; message to &lt;strong&gt;nrf cloud&lt;/strong&gt; via &lt;strong&gt;asset tracker v2&lt;/strong&gt;.[/quote]
&lt;p&gt;Thanks&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: asset tracker v2 custom event</title><link>https://devzone.nordicsemi.com/thread/441823?ContentTypeID=1</link><pubDate>Thu, 17 Aug 2023 10:54:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eeacef14-b114-46d1-96d0-072cc82fb0c5</guid><dc:creator>Hakon</dc:creator><description>[quote user="Muhammad Usman"]but not able to see any data on nrf cloud .[/quote]
&lt;p&gt;Yes, I said in most cases, &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/b49221af11d6f28b63cb178ce7f8b05747a78645/applications/asset_tracker_v2/src/cloud/nrf_cloud_integration.c#L477"&gt;but not if you are using nrf cloud&lt;/a&gt; unfortunately.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: asset tracker v2 custom event</title><link>https://devzone.nordicsemi.com/thread/441822?ContentTypeID=1</link><pubDate>Thu, 17 Aug 2023 10:48:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb6aeede-1930-4890-bcae-211cbf731af6</guid><dc:creator>Muhammad Usman</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/hakon"&gt;Hakon&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you so much for the response!&lt;/p&gt;
&lt;p&gt;I tried this one&amp;nbsp;&lt;/p&gt;
&lt;p&gt;cloud_wrap_data_send(char *buf, size_t len, bool ack, uint32_t id,const struct lwm2m_obj_path path_list[]);&lt;/p&gt;
&lt;p&gt;as I am using ncs 2.4.0&lt;/p&gt;
&lt;p&gt;but not able to see any data on nrf cloud .&lt;/p&gt;
&lt;p&gt;Can you please help me to guide, me to send a &amp;quot;hello world&amp;quot; message to &lt;strong&gt;nrf cloud&lt;/strong&gt; via &lt;strong&gt;asset tracker v2&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks &amp;amp; regards,&lt;/p&gt;
&lt;p&gt;Muhammad Usman&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: asset tracker v2 custom event</title><link>https://devzone.nordicsemi.com/thread/441816?ContentTypeID=1</link><pubDate>Thu, 17 Aug 2023 10:37:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:588cf799-0791-4be4-835a-8393bfa97e5b</guid><dc:creator>Hakon</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;have you tried sending the data using &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v1.9.1/applications/asset_tracker_v2/src/cloud/cloud_wrapper.h#L143"&gt;cloud_wrap_data_send()&lt;/a&gt;? That will work in most cases I believe.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>