sandeepmistry / node-bleacon

A Node.js library for creating, discovering, and configuring iBeacons
MIT License
497 stars 88 forks source link

startAdvertising sometimes fail #54

Closed benjaminhon closed 8 years ago

benjaminhon commented 8 years ago

Hi I am using bleacon on the intel edison.

Most of the time when i do startAdvertising it does. However, there are cases (as i am running the program for a long time) then the advertising stops, then if i restart the program it starts again.

is there any way to check if it is advertising? like a callback function? also is there anycases where you think this problem might happen? I am trying to debug this

this is the part of my code,

// start tcp
connect();

// start bluetooth scanning
Bleacon.startScanning(uuid);

// transmit ibeacon every 100ms
Bleacon.startAdvertising(uuid, major, minor, measuredPower);

// check battery every 60 seconds
setInterval(checkBattery, 60000);

// send status every 10 seconds
setInterval(sendStatus, 10000)

i also have a service file that restarts my program when the TCP connection is down, so expect that the program will be restarted many times over weeks. Im wondering if its because of unsafe exits that the bleacon library does not take into account?

just in case you are wondering, bluetooth is setup using

rfkill unblock bluetooth
hciconfig hci0 up

on systemctl status bluetooth i do get this

Refusing storage path for private addressed device /org/bluez/hci0/dev_60_01_6C_43_40_98

Thx

sandeepmistry commented 8 years ago

Hi @benjaminhon,

Please share the following:

sandeepmistry commented 8 years ago

@benjaminhon ping ...

sandeepmistry commented 8 years ago

I'm closing this due to lack of activity.

benjaminhon commented 8 years ago

Noted thanks, the solution was to kill the bluetoothctl process, something to do with the edison

Sent from my iPhone

On 29 Aug 2016, at 7:17 AM, Sandeep Mistry notifications@github.com wrote:

I'm closing this due to lack of activity.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.