You are reading a single comment by @ColinP and its replies. Click here to read the full conversation.
  • I thought previously about flow control being set in Linux - I tried disabling it with screen but no change. Minicom was actually worse - I found it appeared to hang quite often and I had to kill -9 it. I decided to stick with hardware flow control and screen (that I knew worked previously rather than trying to debug problems with the hardware dongle/Linux serial). I'm actually using OS X with Linux in VMWare, so I might try native OS X serial sometime.

    The schematic for the Adafruit board shows it uses P0.9 and P0.11 for serial, which is already defined in the NRF51822DK.py file . As it has the 32k RAM variant of the chip I guess it should work with no changes.

    I had a look into the advertising, and it definitely stops advertising (or at least Nordic UART 2.0 does not see it to allow reconnecting after disconnection). I noticed that running "NRF.wake()" from the terminal allowed it to be seen again and reconnect.

    I made the following change:

    diff --git a/libs/bluetooth/jswrap_bluetooth.c b/libs/bluetooth/jswrap_blue
    index 6ecd36c..b8aec46 100644
    --- a/libs/bluetooth/jswrap_bluetooth.c
    +++ b/libs/bluetooth/jswrap_bluetooth.c
    @@ -261,6 +261,7 @@ static void on_ble_evt(ble_evt_t * p_ble_evt) {
           case BLE_GAP_EVT_DISCONNECTED:
             m_conn_handle = BLE_CONN_HANDLE_INVALID;
             jsiSetConsoleDevice( DEFAULT_CONSOLE_DEVICE );
    +        jswrap_nrf_bluetooth_startAdvertise();
             break;
    

    I'm not 100% sure if this is correct as I don't really understand the Nordic UART states enough. I had a look around, and the Nordic code at:

    https://github.com/NordicSemiconductor/n­rf51-UART-examples/blob/master/ble_app_u­art_low_power/ble_app_uart_low_power_sla­ve/main.c

    calls advertising_start() on handling BLE_GAP_EVT_DISCONNECTED...looks to be the same as my change.

About

Avatar for ColinP @ColinP started