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

nRF8001 No Available or Open Pipes

Hi Folks,

I'm running into a problem with the pipes on my nRF8001. After I issue a Connect (0x0F) command, I receive:

  1. CommandResponseEvent (0x84)
  2. ConnectedEvent (0x85)
  3. PipeStatusEvent (0x88)

And the last event is as follows: 0x01 (debug), 0x11 (length = 17), 0x88 (PipeStatusEvent ), 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 (first 8 bytes: PipesOpen), 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 (second 8 bytes: PipesClosed)

According to the datasheet, the 0x01 in the first 8 bytes (PipesOpen) indicates that the service discovery procedure has completed. Then how come all the pipes are unavailable? Should I wait a certain time or should I run a certain command? When I attempt to send data on any pipe number, I get ACI_STATUS_ERROR_PIPE_INVALID.

Thank you for your plumbing help, Soren

  • Hi,

    The availability of pipes depends on the on the pipe types. As an example set pipes will be available all the time, but TX (notifications) and TX_ACK (indications) pipes will only be available after the peer has enabled them by writing to the CCCD (the enable services button in the master control panel).

    Best regards, Runar

  • Perhaps you should post you nRF8001 XML file as well, so it is easy to see which pipes you are using.

  • Thank you for clarifying the use of pipes. My problem was that I didn't configure any GATT Services in nRFgo Studio, thinking that I would always get an open pipe automatically, so there wasn't any available pipes. Now I added a Heart Rate service with the following pipes:

    
    /* Service: Heart Rate - Characteristic: Heart Rate Measurement - Pipe: BROADCAST */
    #define PIPE_HEART_RATE_HEART_RATE_MEASUREMENT_BROADCAST          1
    #define PIPE_HEART_RATE_HEART_RATE_MEASUREMENT_BROADCAST_MAX_SIZE 19
    
    /* Service: Heart Rate - Characteristic: Heart Rate Measurement - Pipe: TX */
    #define PIPE_HEART_RATE_HEART_RATE_MEASUREMENT_TX          2
    #define PIPE_HEART_RATE_HEART_RATE_MEASUREMENT_TX_MAX_SIZE 19
    
    /* Service: Heart Rate - Characteristic: Heart Rate Measurement - Pipe: TX_ACK */
    #define PIPE_HEART_RATE_HEART_RATE_MEASUREMENT_TX_ACK          3
    #define PIPE_HEART_RATE_HEART_RATE_MEASUREMENT_TX_ACK_MAX_SIZE 19
    
    /* Service: Heart Rate - Characteristic: Heart Rate Measurement - Pipe: RX */
    #define PIPE_HEART_RATE_HEART_RATE_MEASUREMENT_RX          4
    #define PIPE_HEART_RATE_HEART_RATE_MEASUREMENT_RX_MAX_SIZE 19
    
    /* Service: Heart Rate - Characteristic: Heart Rate Measurement - Pipe: SET */
    #define PIPE_HEART_RATE_HEART_RATE_MEASUREMENT_SET          5
    #define PIPE_HEART_RATE_HEART_RATE_MEASUREMENT_SET_MAX_SIZE 19
    
    /* Service: Heart Rate - Characteristic: Heart Rate Measurement - Pipe: RX_ACK_AUTO */
    #define PIPE_HEART_RATE_HEART_RATE_MEASUREMENT_RX_ACK_AUTO          6
    #define PIPE_HEART_RATE_HEART_RATE_MEASUREMENT_RX_ACK_AUTO_MAX_SIZE 19
    
    

    When I connect to nRF8001 on my Ubuntu machine using the hcitool command in the terminal, I get the PipeStatusEvent (0x88) with 0x73 (0b01110011) for OpenPipes and all zeros for ClosedPipes. Then I attempt to use SendData with the pipes number 1,4,5, and 6, I get ACI_STATUS_ERROR_PIPE_TYPE_INVALID (0x95). I even tried pipes number 2 and 3 which returned ACI_STATUS_ERROR_PIPE_STATE_INVALID (0x96). Any other pipe returns ACI_STATUS_ERROR_PIPE_INVALID (0x90)... So I cannot send any data.

    I thought exchanging data over Set Pipes at least should work. What have I missed?

    Cheers, Soren

  • This problem was due to my misunderstanding of pipes and it is now resolved:

    As you can see in my pipe bitmap above, TX (pipe #2) and TX_ACK (pipe #3) are closed because I have not enabled them externally (e.g. from the nRF Master Control app or any other iOS/Android app). Once I enable the notification or indication externally, I can use the SendData command to stream data.

    The Set pipe does not work with SendData, and that's why I would get the above errors. The Set pipe is used for reading data from nRF8001 and the command for updating the local characteristics is SetLocalData and then you can read the characteristics values from your app.

Related