MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. dfuerst
    3. Posts
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    D
    Offline
    • Profile
    • Following 1
    • Followers 0
    • Topics 2
    • Posts 35
    • Groups 0

    Posts

    Recent Best Controversial
    • RE: MMM-OralB / Bluetooth equipped toothbrush integration

      hmmm, for my understanding.

      brushtimer.js is waiting till a connect and upon the reconnect after 3sec (of Oral 6500) not accepting further connect’s?
      would it help to integrate a , let’s say, 5 sec not looking for reconnect’s function. or is it noble that doesn’t allow this.

      At HCITOOL, yes you are so right Sir, this won’t recognize a brushing interruption.
      i don’t think that i am able to write anything like your brushtimer myself. i don’t even understand the code you have written.
      i have already tried to modify NetworkScanner and got the MACaddress parsed, but i didn#t manage to do anything with this payload. Just because i don’t understand the basics.

      my modified node_helper looked like this:

      /* global require, module /
      /
      Magic Mirror

      • Node Helper: MMM-NetworkScannermod
      • By Ian Perrin http://ianperrin.com modified by dfuerst
      • MIT Licensed.
        */

      var NodeHelper = require(“node_helper”);
      var sudo = require(“sudo”);

      module.exports = NodeHelper.create({
      start: function function_name () {
      console.log("Starting module: " + this.name);
      },

      // Override socketNotificationReceived method.
      socketNotificationReceived: function(notification, payload) {
          console.log(this.name + ' received ' + notification);
      
          if (notification === "SCAN_NETWORK") {
              this.config = payload;
              this.scanNetwork();
              return true;
          }
      },
      
      scanNetwork: function() {
          console.log(this.name + " is scanning for mac addresses");
      
          var self = this;
          var hci = sudo(['hcitool', 'con']);
          var buffer = '';
          var errstream = '';
      
          hci.stdout.on('data', function (data) {
              buffer += data;
          });
      
          hci.stderr.on('data', function (data) {
              errstream += data;
          });
      
          hci.on('error', function (err) {
              errstream += err;
          });
      
          hci.on('close', function (code) {
              if (code !== 0) {
                  console.log(self.name + " received an error running hcitool: " + code + " - " + errstream);
                  return;
              }
              //Parse the response
              var rows = buffer.split('\n');
              var macAddresses = [];
      
              // HCI-TOOL SCAN table
              for (var i = 1; i < rows.length; i++) {
                  var cells = rows[i].split(' ').filter(String);
                  if (cells[2] && macAddresses.indexOf(cells[2].toUpperCase()) === -1) {
                      macAddresses.push(cells[2].toUpperCase());
                  }
              }
      
              self.sendSocketNotification('MAC_ADDRESSES', macAddresses);
          console.log(macAddresses);
          });
      
      }
      

      });

      that gave me in the console.log:

      [ ‘E0:E5:CF:FC:4D:8C’ ]

      how can i integrate this node_helper macaddr.SCAN into your module?

      posted in Development
      D
      dfuerst
    • RE: Toothbrush integration

      @SvenSommer
      Ok, as proven during the scenarios:
      my brush does a connect followed by another reconnect after 3sec, which happens without user interaction.
      so i land again at ‘hcitool con’, can your script be modified easiely to operate as intended at the very beginning (scanning for BLE brush macaddrr. every few seconds and stopping upon not finding it anymore, vanishing+resetting after a defined time period) of this topic?

      btw i use the:
      Oral-B Pro 6500 Smart Series Electric Toothbrush with Bluetooth Technology Powered by Braun

      @onetwankyfive
      i appreciate your help testing the script, please provide us with the model no/type of your brush

      posted in Requests
      D
      dfuerst
    • not able to profileswitch/schedule LocalTransport module

      i am using CFenner’s LocalTransport module, which is perfectly what i need for displaying the train departures leaving the village i live in.

      i use MMM-Buttons with MMM-ProfileSwitcher to hide all modules by pressing a physical button.
      Unfortunately this doesn’t work with the LocalTransport module. Module is always shown!

      Is there anyone who can fix this for the LocalTransport modul or can recommend an other module showing the same and at which CLASSES can be used?

      posted in Troubleshooting
      D
      dfuerst
    • RE: Toothbrush integration

      in MM:
      scanning was started. Everything is working fine.
      noble warning: unknown handle 64 disconnected!
      , in MagicMirror

      posted in Requests
      D
      dfuerst
    • RE: Toothbrush integration

      scenario 1:

      scanning started…
      Toothbrush connection ALIVE atMon Jan 30 2017 17:12:15 GMT+0100 (CET)
      Toothbrush is running
      0:1
      0:2
      Toothbrush connection LOST at Mon Jan 30 2017 17:12:17 GMT+0100 (CET) was alive since Mon Jan 30 2017 17:12:15 GMT+0100 (CET)
      two input in less than 3 sec! (2 sec) => ignoring input!
      0:3
      0:4
      0:5
      endless counting

      scenario 2:

      scanning started…
      noble: unknown peripheral e0e5cffc4d8c connected!
      noble: unknown peripheral e0e5cffc4d8c disconnected!
      Toothbrush connection ALIVE atMon Jan 30 2017 17:14:25 GMT+0100 (CET)
      Toothbrush is running
      0:1
      0:2
      Toothbrush connection LOST at Mon Jan 30 2017 17:14:28 GMT+0100 (CET) was alive since Mon Jan 30 2017 17:14:25 GMT+0100 (CET)
      two input in less than 3 sec! (2 sec) => ignoring input!
      0:3
      0:4
      0:5
      0:6
      endless counting

      scenario 3:

      same result as in scenario1

      scenario 4:

      same result as in scenario1

      posted in Requests
      D
      dfuerst
    • RE: Toothbrush integration

      RPi3
      NODE : v6.9.2
      NPM: 3.10.9
      MagicMirror@2.0.0

      posted in Requests
      D
      dfuerst
    • RE: Toothbrush integration

      ok. i understand. full reply on monday

      posted in Requests
      D
      dfuerst
    • RE: Toothbrush integration

      of course, i used the electron downgrade. obviously i didn’t know that i have to enter " npm rebuild" to test the .js, sorry for that.

      you understood me correct. the timer never stopped, i will check that again after git pull

      as i 'm abroad till monday i will provide this infos to you on monday.
      you wrote the error is the xpected behaviour? as i mentioned MM showed just SEARCHING…

      many thanks for your effort

      posted in Requests
      D
      dfuerst
    • RE: Toothbrush integration

      Now i made a reinstall.

      brushtimer.js works until i rebuild electron!!!
      but without rebuilding MM just shows the white screen error.

      after rebuilding i get this upon sudo node brushTimer.js:

      pi@raspberrypi:~/MagicMirror/modules/MMM-OralB $ sudo node brushTimer.js
      module.js:597
        return process.dlopen(module, path._makeLong(filename));
                       ^
      
      Error: Module version mismatch. Expected 48, got 50.
          at Error (native)
          at Object.Module._extensions..node (module.js:597:18)
          at Module.load (module.js:487:32)
          at tryModuleLoad (module.js:446:12)
          at Function.Module._load (module.js:438:3)
          at Module.require (module.js:497:17)
          at require (internal/module.js:20:19)
          at Object. (/home/pi/MagicMirror/modules/MMM-OralB/node_modules/bluetooth-hci-socket/lib/native.js:3:15)
          at Module._compile (module.js:570:32)
          at Object.Module._extensions..js (module.js:579:10)
      

      so, after this rebuild i get the error of my previous post in MM

      posted in Requests
      D
      dfuerst
    • 1
    • 2
    • 3
    • 4
    • 2 / 4