Basically all you need to do is change NRF.setAdvertising(data); to NRF.setAdvertising(data,{interval:100});
It's actually possible that your Mac's WiFi is causing slightly intermittent reception - could you have been downloading anything in the background? WiFi and BLE usually use the same aerial I think, so when WiFi is sending data it's unlikely BLE will be able to receive anything.
If you're on a Pi 3 with Ethernet (or at least very rare WiFi comms) the situation will be miles better.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Ahh great, I didn't realise that's basically what knolleary was doing already :)
Have a look at http://www.espruino.com/Reference#l_NRF_setAdvertising
Basically all you need to do is change
NRF.setAdvertising(data);
toNRF.setAdvertising(data,{interval:100});
It's actually possible that your Mac's WiFi is causing slightly intermittent reception - could you have been downloading anything in the background? WiFi and BLE usually use the same aerial I think, so when WiFi is sending data it's unlikely BLE will be able to receive anything.
If you're on a Pi 3 with Ethernet (or at least very rare WiFi comms) the situation will be miles better.