sandeepmistry / node-bleacon

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

Beacon is disconnecting after connecting with in few seconds #66

Closed panchalneel closed 7 years ago

panchalneel commented 7 years ago

Below i am attaching my sample code..

List of problems

1) estimote.on('disconnect') method is calling after few seconds (after approx 9 seconds) 2) Not getting proper Temprature 3) motionStateChange method is not called properly so unable to get beacon is moving or not

Note : my firmware version is A3.2.0

var Estimote = require('bleacon').Estimote; Estimote.discoverAll(function (estimote) {

estimote.connectAndSetUp(function (connectError) {
    if (!connectError) {
        estimote.readDeviceName(function (error, deviceName) {
            if (error) {
                console.log('Error occur while getting device name, Error : ' + error);
            } else {
                console.log("Device Name :" + estimote);
            }
        });

        estimote.readTemperature(function (error, temprature) {
            console.log("Temprature :" + temprature);
        });

        estimote.on('motionStateChange', function (isMoving) {
            console.log("Is Beacon Moving  :" + isMoving);
        });
        estimote.subscribeMotion(function (error) {
            if (error) {
                console.log("Error While Subscriing motion code");
            }
        });

        estimote.on('disconnect', function() {
            console.log('disconnected!');
        });
    }
});

});

sandeepmistry commented 7 years ago

This is the same issue as https://github.com/sandeepmistry/node-bleacon/issues/65#issuecomment-248772594.

I'm closing this as a duplicate.

panchalneel commented 7 years ago

@sandeepmistry Beacon is disconnecting after few seconds is it issue of firmware??

sandeepmistry commented 7 years ago

@panchalneel newer f/w is not compatible with this module. I've added a note in https://github.com/sandeepmistry/node-bleacon/commit/5dad64d8fe3dab6fe0e2641cc98fcaa47a82f5d2.