<?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>Transmit power with OpenThread.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/59589/transmit-power-with-openthread</link><description>Hi, I tested &amp;quot;Simple_coap_client&amp;quot; and &amp;quot;simple_coap_server&amp;quot; on NRF52840 using Threading SDK. 
 I want to change the transmit power, so I used &amp;quot;otPlatRadioSetTransmitPower ()&amp;quot;. 
 The power consumption and communication distance were measured, but there</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 30 Mar 2020 09:22:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/59589/transmit-power-with-openthread" /><item><title>RE: Transmit power with OpenThread.</title><link>https://devzone.nordicsemi.com/thread/242338?ContentTypeID=1</link><pubDate>Mon, 30 Mar 2020 09:22:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28c0c5b7-3210-4dfc-8f73-a09c3e30ddbb</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Ok, the pointer is probably null initialized.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;int8_t get_TX_power = 0;&lt;/p&gt;
&lt;p&gt;error = otPlatRadioGetTransmitPower(p_instance, &amp;amp;get_TX_power);&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Try that&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Transmit power with OpenThread.</title><link>https://devzone.nordicsemi.com/thread/242297?ContentTypeID=1</link><pubDate>Mon, 30 Mar 2020 07:31:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50e1e5af-ae27-4218-b4a9-c4b3d91dae32</guid><dc:creator>inari</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I tried &amp;#39;&lt;span&gt;int8_t&amp;nbsp; * get_TX_power;&lt;/span&gt;&amp;#39;, but&amp;nbsp;it returns the same error.&lt;/p&gt;
&lt;p&gt;Is there any other cause?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Transmit power with OpenThread.</title><link>https://devzone.nordicsemi.com/thread/242289?ContentTypeID=1</link><pubDate>Mon, 30 Mar 2020 07:03:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2aa5d3ce-df41-4643-a510-987a55fba1ef</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Look at the implementation for&amp;nbsp;otPlatRadioGetTransmitPower() here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/openthread/openthread/blob/master/examples/platforms/nrf528xx/src/radio.c#L571"&gt;https://github.com/openthread/openthread/blob/master/examples/platforms/nrf528xx/src/radio.c#L571&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You can&amp;#39;t set the pointer to get_TX_power to 0 (NULL)&lt;/p&gt;
&lt;p&gt;That will return OT_ERROR_INVALID_ARGS.&lt;/p&gt;
&lt;p&gt;Try this instead:&lt;/p&gt;
&lt;p&gt;int8_t&amp;nbsp; * get_TX_power;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Transmit power with OpenThread.</title><link>https://devzone.nordicsemi.com/thread/242284?ContentTypeID=1</link><pubDate>Mon, 30 Mar 2020 06:32:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:26bf518e-e3ba-4588-999a-349fa851a2d4</guid><dc:creator>inari</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;The error after calling otPlatRadioSetTransmitPower is 0. So it may be successful.&lt;/p&gt;
&lt;p&gt;I tried&amp;nbsp;&lt;span&gt;otPlatRadioGetTransmitPower()&lt;/span&gt; as per your advice.&lt;/p&gt;
&lt;p&gt;However, an error (7) is output.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This error seems to mean OT_ERROR_INVALID_ARGS, but I don&amp;#39;t know how to deal with it.&lt;/p&gt;
&lt;p&gt;This is my code.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span&gt;I&amp;#39;m sorry in poor English.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void thread_coap_utils_multicast_light_request_send(uint8_t                         command,
                                                    thread_coap_utils_multicast_scope_t scope)
{
    NRF_LOG_INFO(&amp;quot;thread_coap_utils_multicast_light_request_send&amp;quot;);

    otError       error = OT_ERROR_NONE;
    otMessage   * p_request;
    otMessageInfo message_info;
    const char  * p_scope = NULL;
    otInstance  * p_instance = thread_ot_instance_get();

    int8_t  TX_power = 8;
    int8_t  *get_TX_power = 0;

    char *send_data = &amp;quot;hello world&amp;quot;;

    do
    {
        p_request = otCoapNewMessage(p_instance, NULL);
        if (p_request == NULL)
        {
            NRF_LOG_INFO(&amp;quot;Failed to allocate message for CoAP Request\r\n&amp;quot;);
            break;
        }

        otCoapMessageInit(p_request, OT_COAP_TYPE_NON_CONFIRMABLE, OT_COAP_CODE_PUT);

        error = otCoapMessageAppendUriPathOptions(p_request, &amp;quot;light&amp;quot;);
        ASSERT(error == OT_ERROR_NONE);

        error = otCoapMessageSetPayloadMarker(p_request);
        ASSERT(error == OT_ERROR_NONE);

        error = otMessageAppend(p_request, send_data, 12);
        //NRF_LOG_INFO(&amp;quot;send_data : %s&amp;quot;, send_data);
       

        if (error != OT_ERROR_NONE)
        {
            break;
        }

        switch (scope)
        {
        case THREAD_COAP_UTILS_MULTICAST_LINK_LOCAL:
            p_scope = &amp;quot;ff02::1&amp;quot;;
            break;

        case THREAD_COAP_UTILS_MULTICAST_REALM_LOCAL:
            p_scope = &amp;quot;ff03::1&amp;quot;;
            break;

        default:
            ASSERT(false);
        }

        memset(&amp;amp;message_info, 0, sizeof(message_info));
        message_info.mPeerPort = OT_DEFAULT_COAP_PORT;

        error = otIp6AddressFromString(p_scope, &amp;amp;message_info.mPeerAddr);
        ASSERT(error == OT_ERROR_NONE);
       
        error = otPlatRadioSetTransmitPower(p_instance, TX_power);
        NRF_LOG_INFO(&amp;quot;error: %d&amp;quot;, error);
        NRF_LOG_INFO(&amp;quot;TX_power: %d&amp;quot;, TX_power);

        error = otPlatRadioGetTransmitPower(p_instance, get_TX_power);
        NRF_LOG_INFO(&amp;quot;error: %d&amp;quot;, error);
        NRF_LOG_INFO(&amp;quot;get_TX_power: %d&amp;quot;, get_TX_power);
        
        
        error = otCoapSendRequest(p_instance, p_request, &amp;amp;message_info, NULL, NULL);
    } while (false);

    if (error != OT_ERROR_NONE &amp;amp;&amp;amp; p_request != NULL)
    {
        NRF_LOG_INFO(&amp;quot;Failed to send CoAP Request: %d\r\n&amp;quot;, error);
        otMessageFree(p_request);
    }
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Transmit power with OpenThread.</title><link>https://devzone.nordicsemi.com/thread/242127?ContentTypeID=1</link><pubDate>Fri, 27 Mar 2020 14:14:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d74b1f6-6fd1-4b08-b030-a91142f442e1</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;What is the error after the call to&amp;nbsp;otPlatRadioSetTransmitPower?&lt;/p&gt;
&lt;p&gt;Can you try to call&amp;nbsp;&lt;span&gt;otPlatRadioGetTransmitPower() a while after calling otPlatRadioSetTransmitPower? Does it read out the same as you set it to?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Perhaps the TX power was alreadu 8 before you set it to 8?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Remember that the TX power is only affecting the radio when you transmit, and that the nRF use the radio in 99+% of the time, so I don&amp;#39;t think you will be able to see the increase in the current consumption, depending on how you measure it.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I believe the&amp;nbsp;otPlatRadioGetTransmitPower() is a better way to see whether the TX power was changed or not.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Edvin&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>