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: Toothbrush integration

      Wow that was really fast!

      Testing your script brought me to 2 problems:

      testing brushTimer.js in the console worked for detecting the brush but did never stop, also not after 32 sec!

      including your module into the MM i got an error message upon activating the brush:

      “noble warning: unknown handle 64 disconnected!”
      “scanning was started. Everything is working fine.”

      this two message’s i get upon every activation, so the MM show always SEARCHING…

      any suggestions?

      posted in Requests
      D
      dfuerst
    • RE: Toothbrush integration

      maybe contacting oralB via the developer program homepage ( https://developer.oralb.com/ ) could be helpful. there might be a support team helping developers creating new apps for their brush

      posted in Requests
      D
      dfuerst
    • RE: Toothbrush integration

      should we go back to the “low level approach”?

      as i understand you can instantly determine if there is a certain brush(matching the macaddress via the config) within the bluetooth range upon activation of these.
      any interruption of brushing is detected, 20 sec or so too late of course i know, when the brush goes offline again.
      so can we start a stopwatch (let’s say at the center position) upon detection, stopping when not detecting the brush anymore and reseting to 00:00 after 2min followed by vanishing the stopwatch.
      i know that this wouldn’t be very accurate, but better then nothing. giving the user a feel for the time
      and for a pro like you i guess this would be very easy to develop.
      examples for start/stop/reset timers are quiet a lot available in the web.

      how do you think about

      posted in Requests
      D
      dfuerst
    • RE: Bluetooth connections with noble

      maybe using hcitool with the syntax for pairing a device before would solve this issue, have you tried that?
      as far as i understand the rpi3 bluetooth is on, at startup, but you have to pair the devices every startup, unless you use hcitool with the corresponding syntax for direct pairing within your .js

      posted in Development
      D
      dfuerst
    • RE: Toothbrush integration

      exciting.
      you get everything needed for a really high quality piece of module.

      battery level
      brushing mode
      brushing time
      pressure
      quadrant
      smiley

      i am a bit concerned about the user readout. (Do you think it might be possible to determine which of eg. 3 brushes is presently used?)

      posted in Requests
      D
      dfuerst
    • RE: Toothbrush integration

      not in the mmmbutton folder of course

      posted in Requests
      D
      dfuerst
    • RE: Toothbrush integration

      try :

      cd ~/MagicMirror/modules/MMM-Button
      sudo npm rebuild --runtime=electron --target=1.4.6 --disturl=https://atom.io/download/atom-shell --abi=50
      
      posted in Requests
      D
      dfuerst
    • RE: Toothbrush integration

      @SvenSommer
      hi. nice to know that someone else (with programming skills) is interested too.

      ohh yes . ‘hcitool con’ is not perfect, first activation of the toothbrush is very accurate but as you mentioned any interruption is detected unreliably, and late.

      your problem sounds like the “white screen” issue of mmm-button, so maybe rebuilding/downgrading your electron version might help. (see the forum for this issue)

      as you can see in the posts above there is an API by OralB. At the end using it would give the highest quality of input/output. as you can also read between the lines i dont know enough about coding stuff, so i went for the low level approach via mmm-networkscanner and to integrate thereafter a simple stopwatch.

      Any help is highly welcome.

      posted in Requests
      D
      dfuerst
    • RE: Toothbrush integration

      ok integrated “hcitool con”, because of the very fast response,
      had to alter the parsing of NetworkScanner.
      i think i got the parsing, but networkscanner says NO DEVICES
      when i “console.log(macAddresses)” , at the end of node_helper script i get during MM in console :

      MMM-NetworkScanner received SCAN_NETWORK
      MMM-NetworkScanner is scanning for mac addresses
      [ ‘E0:E5:CF:FC:4D:8C’ ]                             
      

      shouldn’t this “macAddresses parse” be understand by NetworkScanner? What am i missing here?

      nodehelper script is as follows:

       scanNetwork: function() {
              console.log(this.name + " is scanning for mac addresses");
      
              var self = this;
              var arp = sudo(['hcitool', 'con']);
              var buffer = '';
              var errstream = '';
      
              arp.stdout.on('data', function (data) {
                  buffer += data;
              });
      
              arp.stderr.on('data', function (data) {
                  errstream += data;
              });
      
              arp.on('error', function (err) {
                  errstream += err;
              });
      
              arp.on('close', function (code) {
                  if (code !== 0) {
                      console.log(self.name + " received an error running arp-scan: " + 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);
              });
      
          }
      

      Note from admin: Please use Markdown on code snippets for easier reading!

      posted in Requests
      D
      dfuerst
    • 1 / 1