Redbear ble is not advertaising after arduino soft reset


#1

Hi Team,

Problem statement: When REDBEAR BLE shield disconnects from arduino, Arduino sketch(code) has to restart from the beginning(i.e., like freshly uploaded code) and Bluetooth shield has to advertise.
What is the function to advertaise redbear ble?

I have tried below.

if (ble_connected() == 1 && flagC  == false )
{
     flagC = true;
     Serial.println("connected");
}

if ( ble_connected() == 0  &&  flagC == true)
{
    flagC = false;
    Serial.println("Disconnected");
   
    asm volatile ("  jmp 0"); 

    // or 
    wdt_enable(WDTO_8S);
    while(1)
    {
    }
}

Expected Output: Rebbear BLE has to advertaise.

Evt link connection interval changed
Evt Pipe Status
Evt link connection interval changed
Evt Disconnected/Advertising timed out
Advertising started

Actual output: Redbear BLE is not advertaising.

Can we just restart the program than reset?

Please kindly help me to fix it.


#2

Please make sure that the RDYN and REQN pins are correctly connected to the Arduino board.


#3

I have attached the image, Please confirm


#4

Could you please attach the whole sketch for addressing the issue. Also there are some examples for reference: https://github.com/RedBearLab/nRF8001/blob/master/examples/SimpleChat/SimpleChat.ino.