This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Odd Proprietary Radio TX / RX

Hello,

I tried to send data through the proprietary radio. My devices are NRF52832. The data I would like to send is an uint8_t array:

uint8_t radioTxBuffer[10];
// and
radioTxBuffer[0] = 6;
radioTxBuffer[1] = 11;
radioTxBuffer[2] = 2;
radioTxBuffer[3] = 2;
radioTxBuffer[4] = 2;
radioTxBuffer[5] = 2;
radioTxBuffer[6] = 2;
radioTxBuffer[7] = 2;
radioTxBuffer[8] = 2;
radioTxBuffer[9] = 2;

Right before I send it out, I copied it to another variable, then print it (on the next cycle, to ensure printing won't affect everything).

This is the output I received from the transmitter:

copied[0]: 6
copied[1]: 11
copied[2]: 2
copied[3]: 2
copied[4]: 2
copied[5]: 2
copied[6]: 2
copied[7]: 2
copied[8]: 2
copied[9]: 2

Otherwise, the data received is a little bit different - the last 3 items of the array are 0

Here's the output:

copied[0]: 6
copied[1]: 11
copied[2]: 2
copied[3]: 2
copied[4]: 2
copied[5]: 2
copied[6]: 2
copied[7]: 0
copied[8]: 0
copied[9]: 0

I also made a sniffer (which I believe works perfectly fine), and its output looks like:

<info> app: Packet was received
<info> app: The contents of the package is 6
<info> app: The contents of the package is B
<info> app: The contents of the package is 2
<info> app: The contents of the package is 2
<info> app: The contents of the package is 2
<info> app: The contents of the package is 2
<info> app: The contents of the package is 2
<info> app: The contents of the package is 0
<info> app: The contents of the package is 0
<info> app: The contents of the package is 0

*p.s: nevermind about the B, I used %x there.

I followed the example of Radio -> Transmitter and Radio -> Receiver as a reference for my code. I tried to edit it and it works fine as I expected (change the packet buffer to an uint8_t 10-elements array)

Any suggestion on this?

Thanks in advance

Parents
  • Hi 

    Did you change the PACKET_STATIC_LENGTH define in radio_config.h?

    The radio example uses a static payload length configuration, and the only way to change the length of the packet is to change this define. 

    Also, if you are going to use the radio for proprietary communication I would strongly recommend using the nrf_esb library, rather than starting out with the radio example. Then you get a more fully fledged RF protocol that does things like packet buffering, data acknowledgement and data retransmission automatically.

    Best regards
    Torbjørn 

Reply
  • Hi 

    Did you change the PACKET_STATIC_LENGTH define in radio_config.h?

    The radio example uses a static payload length configuration, and the only way to change the length of the packet is to change this define. 

    Also, if you are going to use the radio for proprietary communication I would strongly recommend using the nrf_esb library, rather than starting out with the radio example. Then you get a more fully fledged RF protocol that does things like packet buffering, data acknowledgement and data retransmission automatically.

    Best regards
    Torbjørn 

Children
No Data
Related