• I managed to get it to work by cleaning out all code and using the button press examples from Music Controller. And then just add the advertising code bit. It might have been a problem with the broadcast message being to long.

    function setBleBroadcastingDistress(){
      clearTimeout();
      NRF.setServices({
        'b2fb58a0-8452-402a-8435-eedf397464a9' : {
          0x5AFE : {
            value : true,
            readable : true
          }
        }
      }, { advertise: [ 'b2fb58a0-8452-402a-8435-eedf397464a9' ], uart: false });
    
      NRF.setAdvertising(
        {
          0x1815 : pressIdentifier
        }
        ,
        {
          name: 'ALERT!',
          showName: true
      });
      digitalWrite(LED1, 1);
      setTimeout(function(){
        digitalWrite(LED1,0 );
        setBleBroadcastingNormal();
      }, 10000);
    }
    

    Then advertise another UUID when everything is normal.

    For IDE mode this was enough.

    function ideConnect(){
        NRF.setServices(undefined, { uart: true });
        NRF.setAdvertising({},{
          name: 'IDE',
          showName: true
      });
    }
    

    I will add the connectable:true as you suggested.
    Thanks!

About

Avatar for user93296 @user93296 started