<?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>Serial Mesh</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/67396/serial-mesh</link><description>Hi, 
 I have been working with mesh and I&amp;#39;m using the version 4.2 Mesh SDK.As I understand it I should use nrf_mesh_serial_tx() api to send serial message.When I use this api to send message there is 2 unknown characters come up before the message. I</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 28 Oct 2020 10:27:21 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/67396/serial-mesh" /><item><title>RE: Serial Mesh</title><link>https://devzone.nordicsemi.com/thread/277343?ContentTypeID=1</link><pubDate>Wed, 28 Oct 2020 10:27:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1aa112d9-5dc8-41cc-bc6a-23401c04667d</guid><dc:creator>Atra</dc:creator><description>&lt;p&gt;Thank you&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Serial Mesh</title><link>https://devzone.nordicsemi.com/thread/276834?ContentTypeID=1</link><pubDate>Mon, 26 Oct 2020 11:05:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af297e79-78fa-4ee7-a9b0-a12751ae2ebe</guid><dc:creator>Mttrinh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The unknown characters you are seeing is coming from these functions, serial_start() and nrf_mesh_serial_tx(). In the code snippet below I have commented on the parts&amp;nbsp;that printed those, its from opcodes that are being sent.&lt;/p&gt;
&lt;p&gt;Inside nrf_mesh_serial.c:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;uint32_t nrf_mesh_serial_tx(uint8_t* p_data, uint32_t length)
{
    if (serial_state_get() != NRF_MESH_SERIAL_STATE_RUNNING)
    {
        return NRF_ERROR_INVALID_STATE;
    }
    if (p_data == NULL)
    {
        return NRF_ERROR_NULL;
    }
    if (length == 0 || length &amp;gt; NRF_MESH_SERIAL_PAYLOAD_MAXLEN)
    {
        return NRF_ERROR_INVALID_LENGTH;
    }

    serial_packet_t * p_evt;
    uint32_t status = serial_packet_buffer_get(SERIAL_PACKET_LENGTH_OVERHEAD + length, &amp;amp;p_evt);
    if (status == NRF_SUCCESS)
    {
        //This part gives the &amp;quot;unknown characters&amp;quot; you see
        p_evt-&amp;gt;opcode = SERIAL_OPCODE_EVT_APPLICATION;
        memcpy(p_evt-&amp;gt;payload.evt.application.data, p_data, length);
        serial_tx(p_evt); 
    }

    return status;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Inside serial.c:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;uint32_t serial_start(void)
{
    if (m_state != NRF_MESH_SERIAL_STATE_INITIALIZED)
    {
        __LOG(LOG_SRC_SERIAL, LOG_LEVEL_WARN, &amp;quot;Not initialized.&amp;quot;);
        return NRF_ERROR_INVALID_STATE;
    }
    m_state = NRF_MESH_SERIAL_STATE_RUNNING;
    /* Send device started event. */
    serial_packet_t * p_start_packet;
    /* Should not fail: */
    uint32_t err_code = serial_packet_buffer_get(sizeof(serial_evt_device_started_t) + NRF_MESH_SERIAL_PACKET_OVERHEAD, &amp;amp;p_start_packet);
    if (NRF_SUCCESS != err_code)
    {
        __LOG(LOG_SRC_SERIAL, LOG_LEVEL_ERROR, &amp;quot;Unable to get a serial packet buffer, error_code: %u\n&amp;quot;, err_code);
        m_state = NRF_MESH_SERIAL_STATE_INITIALIZED;
    }
    else
    {
        //This part gives out the &amp;quot;unknown characters&amp;quot; you see
        p_start_packet-&amp;gt;opcode = SERIAL_OPCODE_EVT_DEVICE_STARTED;
        p_start_packet-&amp;gt;payload.evt.device.started.operating_mode = SERIAL_DEVICE_OPERATING_MODE_APPLICATION;
        p_start_packet-&amp;gt;payload.evt.device.started.hw_error = NRF_POWER-&amp;gt;RESETREAS &amp;amp; RESET_REASONS_HW_ERROR;
        p_start_packet-&amp;gt;payload.evt.device.started.data_credit_available = NRF_MESH_SERIAL_PAYLOAD_MAXLEN;
        serial_tx(p_start_packet);
    }
    return err_code;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Also be aware that it is not expected to have any user interface(human text) on serial in this example. Logging is printed out on RTT. So this is not the interface to print logs or send commands via terminal.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Serial Mesh</title><link>https://devzone.nordicsemi.com/thread/276830?ContentTypeID=1</link><pubDate>Mon, 26 Oct 2020 10:46:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f82f077-6abe-4606-9d45-7ae197d305c1</guid><dc:creator>Atra</dc:creator><description>&lt;p&gt;I got that unknown characters even there is no modification. Should I disable the nRF LOG to ensure a reliable serial connection? Could there be a link between the my serial problem and RTT?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Serial Mesh</title><link>https://devzone.nordicsemi.com/thread/276261?ContentTypeID=1</link><pubDate>Wed, 21 Oct 2020 14:31:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a1dc931e-cd6b-4835-b222-27f1f3385aa9</guid><dc:creator>Atra</dc:creator><description>&lt;p&gt;Hi Mttrinh,&lt;/p&gt;
&lt;p&gt;yes I&amp;nbsp; added only these 2 lines of code. Today&amp;nbsp;I asked a colleague at work to download&amp;nbsp;the SDKs and try this code in different machine. The result is same.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Serial Mesh</title><link>https://devzone.nordicsemi.com/thread/276245?ContentTypeID=1</link><pubDate>Wed, 21 Oct 2020 14:02:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33b16bc0-ca07-4a28-bc6a-03669547e3c4</guid><dc:creator>Mttrinh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Was this the only modifications you made to the serial example?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>