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

nrf51 does not respond to bluetooth message

I am using nrf51 running as a peripheral and an iphone app as central. It works OK when I first use the iphone app to connect to nrf51. Then I quit the iphone app and let the nrf51 run in an idle mode with ble.waitForEvent(); If I restart the iphone app within a short time period, e.g., 1min, it can connect to nrf51 and work correctly with it. However if I wait longer time, e.g., 5-10mins, to restart the iphone app and connect to the nrf51, it can only discover the nrft1 advertising. The nrf51 does not respond to any message sent from the iphone App.

It seems that waiting in a idle mode with ble.waitForEvent() works only for a rather short period of time. The system would not function properly if there is no central device connect to it in a while. What could be the problem? Thanks!

Parents
  • Thanks for the suggestion. I will buy a dongle or 51 DK to run the sniffer. The symptom here is that after a long wait, the iphone App is still able to discover the nRF51 BLE device as peripheral. So there is advertising RF activity by the nRF51. But the nRF51 will not respond to BLE write from iphone app. I have the following programming structure. The activeloop seems to work fine. But if the program run in the idle loop for some time, I cannot use BLE message from iphone App to switch it back to the active loop. If the program run in the idle loop for a short time period. I can use BLE message from Iphone to switch it back to the active loop. main{ while{ if(activeloop){ // active loop operation performactivefunction(); }else{ // idle power saving loop ble.waitForEvent(); } }

    }

Reply
  • Thanks for the suggestion. I will buy a dongle or 51 DK to run the sniffer. The symptom here is that after a long wait, the iphone App is still able to discover the nRF51 BLE device as peripheral. So there is advertising RF activity by the nRF51. But the nRF51 will not respond to BLE write from iphone app. I have the following programming structure. The activeloop seems to work fine. But if the program run in the idle loop for some time, I cannot use BLE message from iphone App to switch it back to the active loop. If the program run in the idle loop for a short time period. I can use BLE message from Iphone to switch it back to the active loop. main{ while{ if(activeloop){ // active loop operation performactivefunction(); }else{ // idle power saving loop ble.waitForEvent(); } }

    }

Children
No Data
Related