This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ble_app_uart packet not sent more than 278 packets

Hello, Help me, please.

I am testing ble_app_uart. Softdevice is S130 and SDK is nRF5_SDK_12.2.0_f012efa.

My development board is Waveshare's NRF51822 Eval Kit.

When I test the ble_app_uart firmware, I cannot send more than 278 packets to BLE device.

After sending 278 packets(278 char-write-cmd command), there is nothing sent to device.

I tested on Raspberry PI, and on PC Ubuntu 16.04 LTS also, using gatttool and python.

#Following is the python source code.

    \#Run gatttool interactively.

    gatt = pexpect.spawn('gatttool -t random -b ED:B6:62:99:18:11 -I')

    \# Connect to the device.

    gatt.sendline('connect')

    gatt.expect('Connection successful')


    \# Enter main loop.

    print 'Press Ctrl-C to quit.'

    counter = 0

    while True:

            # make string with counter value <###>

            counter += 1

            s = '{0:d}'.format(counter)

            ss = ''

            for i in range(len(s)):

                    ss += '3' + s[i]

            gatt.sendline('char-write-cmd 0x000e 3c'+ss+'3e')

            # Wait a short period of time and setup for the next loop iteration.

            time.sleep(1)

            print (counter)
  • Hi,

    You mean all 277 packets before was sent to ble_app_uart via BLE and then forward to UART properly ?

    Could you check if nus_data_handler() is called when you send packet #278 ?

    Could you capture a sniffer trace and check when happens over BLE when you send packet 278 ?

  • Thank you for your comments. I found that, the communication between python pexpect and gatttool's GLib is the reason. I guess that gatttool's g_io_ matters cannot read python's input any more at sometime. I will modify gatttool. Thank you so much.

Related