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

nRF52832 Transceiver Example?

Hi All,

Sorry if this is a simple question, but I can't seem to find an example where the device is programmed as both RX and TX.  (The examples have either one or the other.)

In my code I have "nrf_esb_config.mode" set to NRF_ESB_MODE_PRX  and it receives fine but doesn't transmit.   (If I switch this to NRF_ESB_MODE_PTX it will transmit but not receive.)

Basically I want to receive a message and send it back out (no changes, I am setting the transmit length before sending out.)

thanks for any pointers,

Bob

Parents
  • Hi Bob

    Sorry for the slow response. With the Easter holidays ongoing here in Norway we have been severely understaffed, but now we're back in business ;)

    Stupid question, but why would you want to send exactly the same message back?

    The idea of ESB is that the PRX will send an ACK automatically, which by default is only an empty packet sent back to the same address. 

    There is an ACK payload feature allowing you to embed a payload to the ACK, but you need to prepare the data before the packet is received on the PRX side, which means you can't prepare an ACK payload immediately after receiving a packet, and have it included in the ACK. 
    A workaround to this issue is to send two packets from the PTX, allowing you to prepare the ACK payload after the first packet, and have it sent back after the second packet. 

    It is possible to switch the entire library from PRX to PRX mode if you want to do a more manual ACK, but it requires a bit more work since you need to disable, reconfigure and enable the library for every switch. 

    For an example of this you could have a look at this example I wrote a while back, which implements a simple mesh like protocol where all nodes are in PRX mode most of the time, and only switch to PTX mode when they want to send something. 

    Best regards
    Torbjørn

Reply
  • Hi Bob

    Sorry for the slow response. With the Easter holidays ongoing here in Norway we have been severely understaffed, but now we're back in business ;)

    Stupid question, but why would you want to send exactly the same message back?

    The idea of ESB is that the PRX will send an ACK automatically, which by default is only an empty packet sent back to the same address. 

    There is an ACK payload feature allowing you to embed a payload to the ACK, but you need to prepare the data before the packet is received on the PRX side, which means you can't prepare an ACK payload immediately after receiving a packet, and have it included in the ACK. 
    A workaround to this issue is to send two packets from the PTX, allowing you to prepare the ACK payload after the first packet, and have it sent back after the second packet. 

    It is possible to switch the entire library from PRX to PRX mode if you want to do a more manual ACK, but it requires a bit more work since you need to disable, reconfigure and enable the library for every switch. 

    For an example of this you could have a look at this example I wrote a while back, which implements a simple mesh like protocol where all nodes are in PRX mode most of the time, and only switch to PTX mode when they want to send something. 

    Best regards
    Torbjørn

Children
Related