Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change to driver name() in code was ignored #93

Closed
landlessness opened this issue Oct 19, 2014 · 5 comments
Closed

change to driver name() in code was ignored #93

landlessness opened this issue Oct 19, 2014 · 5 comments
Labels

Comments

@landlessness
Copy link

In my LED driver code, I originally had:

    .name('led ' + this.pin)

then I changed it to upper case:

    .name('LED ' + this.pin)

But the names of the LEDs didn't change.

Because I was developing on the BeagleBone, I thought maybe I had opened the wrong file in the Cloud9 IDE or was doing something else wrong. After a while I gained confidence that I had changed the right file and that the new name was being ignored.

Eventually, I did rm -rf .peers .registry because it had worked for me in the past. And it did again. The new names worked after doing the rm.

@mdobson
Copy link
Contributor

mdobson commented Oct 23, 2014

Hey @landlessness what was the log message when the LED came online? Was it provisioned or discovered? This will help me track it down.

@landlessness
Copy link
Author

provisioned

Apr-23-2014 17:38:30 [scout] Device (led) 7009c6f1-d13b-44fd-9017-c7eeac9408d1 was provisioned from registry.
Apr-23-2014 17:38:30 [scout] Device (led) b6cdf059-5521-4fd2-9829-82dd0f38113b was provisioned from registry.
Apr-23-2014 17:38:30 [scout] Device (led) bc16e910-682a-41e0-aa3d-e28cf92deaf8 was provisioned from registry.
Apr-23-2014 17:38:30 [scout] Device (led) 93cba018-7701-4058-ad9b-e3d39fddfab8 was provisioned from registry.

the scout code:

LEDScout.prototype.init = function(next) {
  var self = this;

  this.pins.forEach(function(pin) {
    var query = self.server.where({type: 'led', pin: pin});
    self.server.find(query, function(err, results) {
      if (results[0]) {
        self.provision(results[0], LED, pin);
      } else {
        self.discover(LED, pin);
      }
    });
  });
  next();
};

@mdobson
Copy link
Contributor

mdobson commented Oct 23, 2014

thanks @landlessness

@mdobson
Copy link
Contributor

mdobson commented Oct 23, 2014

Will be fixed with the next platform release.

@mdobson mdobson closed this as completed Oct 23, 2014
@landlessness
Copy link
Author

thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants