<?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>Log data in thingy 52</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/41086/log-data-in-thingy-52</link><description>Hi, I&amp;#39;m new to thingy, I want to log the data received and viewed in mobile app / web app from thingy 52 development kit which contains nRF52832. Is it possible to log data? If yes, how to log data, else is there any alternative way to log the data received</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 03 Dec 2018 15:01:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/41086/log-data-in-thingy-52" /><item><title>RE: Log data in thingy 52</title><link>https://devzone.nordicsemi.com/thread/160015?ContentTypeID=1</link><pubDate>Mon, 03 Dec 2018 15:01:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca28c6bc-f9ad-498a-840a-b21a8e08d6ef</guid><dc:creator>Martin Lesund</dc:creator><description>&lt;p&gt;Hi Hemabas,&lt;/p&gt;
&lt;p&gt;Remember that the Thingy:52 is not a Development Kit, but a reference design. So to access the nrf52832 to flash/read you need a 10-pin connector and the debug-out from a &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52%2Fdita%2Fnrf52%2Fdevelopment%2Fnrf52_dev_kit.html&amp;amp;cp=2_1_4" rel="noopener noreferrer" target="_blank"&gt;nrf52 DK.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Add this in&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;em&gt;sdk_config.h.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define NRF_LOG_ENABLED 1

#define NRF_LOG_DEFAULT_LEVEL 4&lt;/pre&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Increase the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;NRF_LOG_DEFAULT_LEVEL&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/strong&gt;to&lt;strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;4&lt;/strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;to get out debug messages as you can see in &amp;quot;drv_motion.c&amp;quot;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#if NRF_LOG_ENABLED
    void print_sensor_status(void)
    {
        long acc_bias[NUM_AXES];
        long gyr_bias[NUM_AXES];
        long mag_bias[NUM_AXES];
        int acc_accuracy;
        int gyr_accuracy;
        int mag_accuracy;
        
        inv_get_accel_bias(acc_bias, NULL);
        inv_get_gyro_bias(gyr_bias, NULL);
        inv_get_compass_bias(mag_bias);
        
        acc_accuracy = inv_get_accel_accuracy();
        gyr_accuracy = inv_get_gyro_accuracy();
        mag_accuracy = inv_get_mag_accuracy();
        
        NRF_LOG_DEBUG(&amp;quot;Acc bias: &amp;quot;);
        NRF_LOG_DEBUG(&amp;quot;X: &amp;quot;NRF_LOG_FLOAT_MARKER&amp;quot; &amp;quot;,     NRF_LOG_FLOAT(acc_bias[0]));
        NRF_LOG_DEBUG(&amp;quot;Y: &amp;quot;NRF_LOG_FLOAT_MARKER&amp;quot; &amp;quot;,     NRF_LOG_FLOAT(acc_bias[1]));
        NRF_LOG_DEBUG(&amp;quot;Z: &amp;quot;NRF_LOG_FLOAT_MARKER&amp;quot; \r\n&amp;quot;, NRF_LOG_FLOAT(acc_bias[2]));
        
        NRF_LOG_DEBUG(&amp;quot;Gyr bias: &amp;quot;); 
        NRF_LOG_DEBUG(&amp;quot;X: &amp;quot;NRF_LOG_FLOAT_MARKER&amp;quot; &amp;quot;,     NRF_LOG_FLOAT(gyr_bias[0]));
        NRF_LOG_DEBUG(&amp;quot;Y: &amp;quot;NRF_LOG_FLOAT_MARKER&amp;quot; &amp;quot;,     NRF_LOG_FLOAT(gyr_bias[1]));
        NRF_LOG_DEBUG(&amp;quot;Z: &amp;quot;NRF_LOG_FLOAT_MARKER&amp;quot; \r\n&amp;quot;, NRF_LOG_FLOAT(gyr_bias[2]));

        NRF_LOG_DEBUG(&amp;quot;Mag bias: &amp;quot;);
        NRF_LOG_DEBUG(&amp;quot;X: &amp;quot;NRF_LOG_FLOAT_MARKER&amp;quot; &amp;quot;,     NRF_LOG_FLOAT(mag_bias[0]/(2^16)));
        NRF_LOG_DEBUG(&amp;quot;Y: &amp;quot;NRF_LOG_FLOAT_MARKER&amp;quot; &amp;quot;,     NRF_LOG_FLOAT(mag_bias[1]/(2^16)));
        NRF_LOG_DEBUG(&amp;quot;Z: &amp;quot;NRF_LOG_FLOAT_MARKER&amp;quot; \r\n&amp;quot;, NRF_LOG_FLOAT(mag_bias[2]/(2^16)));

        NRF_LOG_DEBUG(&amp;quot;Accur: Acc: %d, gyr: %d, mag: %d \r\n&amp;quot;, acc_accuracy, gyr_accuracy, mag_accuracy);
    }
#endif&lt;/pre&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;Ex.&lt;/p&gt;
&lt;p&gt;Download a fresh copy of the thingy SDK.&lt;/p&gt;
&lt;p&gt;1. Enable nrf_log and set the Log level to 4.&lt;/p&gt;
&lt;p&gt;2. Compile and flashe the application, and connect (BLE) to the Thingy with nrf connect mobile.&lt;/p&gt;
&lt;p&gt;3. Turn on the &amp;quot;Thingy Raw Data Characteristic&amp;quot; in the motion service and get out this from the RTT log:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-5702a2aadd6d40b4a491040e54449c03/pastedimage1543849043466v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;(added .hex file:)&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-3362f0c1d6274b5b8b058bd00aa4d713/app_5F00_thingy_5F00_s132.hex"&gt;app_thingy_s132.hex&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>