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

    Posts

    Recent Best Controversial
    • RE: Toothbrush integration

      @onetwankyfive
      Thanks four your help! Yes, please follow these instructions of the eight steps to get the testscript running.

      For clarification, please provide us with the output from the four scenarios:

      1. Start the Brush; wait like 10 seconds and stop.
      2. Start and stop within 3 seconds.
      3. Start, wait like 10 seconds and stop. Start again within the next 10 seconds for like 5 seconds.
      4. Start, wait like 10 seconds and stop. Start again after 40 seconds and stop whenever you like.

      And as @dfuerst mentioned the model seems to differ in their behavior. I’m using a a Braun Oral-B PRO 6000. Do you know yours?

      @dfuerst
      I don’t get your point in using hcitool.
      Do you get a reconnect after you have stopped your brush with hcitool?
      Or is your brush connected via hcitool as long as it’s running?

      To answer your question: If you want to use hcitool, its easier to adapt to MMM-Networkscanner by @ianperrin like you did in your first attempt.
      But as I already mentioned, I’m sure this is even more unreliable and unaccurate.
      But if you wanna try, I’m willing to help you.

      posted in Requests
      SvenSommerS
      SvenSommer
    • RE: Bluetooth connections with noble

      We were able to solve this issue by ruinning the MM² with sudo-right. See here for details.

      posted in Development
      SvenSommerS
      SvenSommer
    • RE: Toothbrush integration

      @dfuerst

      Behavior of brushTimer.js script

      According to results of the tested scenarios your brush has a different behavior than mine.
      I was expecting a reconnect when you power off your brush.
      This is very bad.

      Maybe we can find another person to test the characteristics of this behavior?
      @Shifty or @onetwankyfive: Are you able to give the testscript a run with the postet scenarios to help us out here?

      Behavior of the module within the MM-framework

      With th help of @aschulz90 I finally solved to run noble within the MM²-framework. See here for details.

      I noticed the noble warning: unknown handle 64 disconnected!- warning. It’s nothing that should bother.

      posted in Requests
      SvenSommerS
      SvenSommer
    • RE: unable to get noble package running

      @aschulz90
      Thanks for your effort and you for quick help. After using a totally new image and installing everything again. I finally started the MM² with sudo-rights without using a ssh-connection.
      This finally solved my issue.

      Via ssh-connection I’m unable to start the MM². I tried DISPLAY=:0 sudo npm start. This caused

      > magicmirror@2.1.0 start /home/pi/MagicMirror
      > electron js/electron.js
      
      No protocol specified
      
      npm ERR! Linux 4.4.45-v7+
      npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start"
      npm ERR! node v6.9.4
      npm ERR! npm  v3.10.10
      npm ERR! code ELIFECYCLE
      npm ERR! magicmirror@2.1.0 start: `electron js/electron.js`
      npm ERR! Exit status 1
      ...
      

      Is there a way to start the MM² via ssh with sudo rights?

      posted in Bug Hunt
      SvenSommerS
      SvenSommer
    • RE: Toothbrush integration

      For the Bug Hunt Post I reduced the code of the MM-scripts to a absolute minmum.
      That’s the reason the module is always showing ‘SEARCHING…’ right now.

      If the scripts would work as exspected the console output would show scanning was started. Everything is working fine. all the time the MM² is started.
      Thats all I’m hoping to see right now.

      posted in Requests
      SvenSommerS
      SvenSommer
    • RE: Toothbrush integration

      @dfuerst
      Module version mismatch-Error
      Just to summarize and for clarification:
      The Module version mismatch. Expected 48, got 50
      or
      NODE_MODULE_VERSION 50. This version of Node.js requires
      NODE_MODULE_VERSION 51. Please try re-compiling or re-installing
      is a known “bug”, which we were able to solve by the rebuilding of electron as you posted a few days ago.

      So if you want to use the module in MM you have to use this statement in the MMM-OralB-folder:

      sudo npm rebuild --runtime=electron --target=1.4.6 --disturl=https://atom.io/download/atom-shell --abi=50
      

      If you want to test brushtimer.js-script standalone in the console, you need to build the packeges in the MMM-OralB-folder with

      npm rebuild
      

      Behavior of brushTimer.js script
      So if I understood you correctly, you were able to start the timer, but it never stopped?
      For a better understanding I added some debug information in the brushtimer.js -script. Cut you please trigger an update by

      cd ~/MagicMirror/modules/MMM-OralB
      git pull
      

      and try the following scenarios and provide me with the console output text.

      1. Start the Brush; wait like 10 seconds and stop.
      2. Start and stop within 3 seconds.
      3. Start, wait like 10 seconds and stop. Start again within the next 10 seconds for like 5 seconds.
      4. Start, wait like 10 seconds and stop. Start again after 40 seconds and stop whenever you like.

      Behavior of the module within the MM-framework
      You wrote:

      “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…"
      

      Actually this behavior is the intended action right now. As I wrote in this Bug Hunt Post I have problems in bringing noble alive within MM²-framework.
      Surprisingly you aren’t suffering from this error, so could you please tell me:

      • Which platform (Rasperry Pi 2/3, etc.),
      • Node - version: node --version
      • npm - version: npm --version
      • MagicMirror: cd ~/MagicMirror/ and DISPLAY=:0 npm start

      you are using?

      posted in Requests
      SvenSommerS
      SvenSommer
    • unable to get noble package running

      Platform: Raspberry Pi 3

      Node Version: v7.4.0

      MagicMirror Version: v2.1.0

      Description: For bluetooth integration I would like to add noble to a MM²-module. Whith this package I was able to interact with bluetooth devices when I ran nodejs-scripts without the MM²-framework. When I try to integrate it within the node_helper.js. I’m not able to initialise the blueetoh device.
      This is simply done by

      var noble = require('noble');
      
      noble.on('stateChange', function(state) {
          if (state === 'poweredOn') {
              noble.startScanning([], true);
              console.log('scanning started...');
          }
          else  {
              noble.stopScanning();
              console.log('scanning stopped.');
          }
      });
      
      

      Within node_helper there is now response, no error message. Just nothing happens.

      If I run a script in the same folder, outside of MM²-Framework with

      sudo node testscript.js
      

      everytthing is working fine.

      Steps to Reproduce:

      1. To test the working testscript:
      • Enter your module-directory: cd ~/MagicMirror/modules
      • Clone repository : git clone https://github.com/SvenSommer/MMM-OralB
      • Enter new directory: cd ~/MagicMirror/modules/MMM-OralB
      • Install dependencies: sudo apt-get install bluetooth bluez libbluetooth-dev libudev-dev
      • Install noble module: npm install noble
      • Exceute testscript:sudo node testscript.js
      • This should lead to a output like
      scanning was started. Everything is working fine.
      
      1. To test the node_helper:
      • Excute first five steps from above.
      • For compatibility reasons run:
      cd ~/MagicMirror/modules/MMM-OralB
      sudo npm rebuild --runtime=electron --target=1.4.6 --disturl=https://atom.io/download/atom-shell --abi=50
      
      • Integrate module in config-file
      {
              module: 'MMM-OralB',
              position: 'bottom_left',
      },
      
      • Start MM², so the module gets loaded.

      Expected Results: Same console output: scanning was started. Everything is working fine.

      Actual Results: Nothing no output. No error. Pure deadly silence. :)

      Configuration: Here the config.js:

      var config = {
      	port: 8080,
      	ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1","::ffff:192.168.188.22"],
      
      	language: 'de',
      	timeFormat: 24,
      	units: 'metric',
      
      	modules: [
      		{
      			module: 'alert',
      		},
      		{
      			module: 'clock',
      			position: 'center'
      		},
      		{
      			module: 'MMM-OralB',
      			position: 'bottom_left',
      		},
      	]
      
      };
      
      /*************** DO NOT EDIT THE LINE BELOW ***************/
      if (typeof module !== 'undefined') {module.exports = config;}
      

      Additional Notes: Next to noble is a module to provide advertising Ble-Services its called bleno (from the same developer). This was successfully integrated in an module by @aschulz90. I tried to adapt to his code to find an error in my code. But this wasn’t helping either.
      https://github.com/aschulz90/ble_app_interface

      posted in Bug Hunt
      SvenSommerS
      SvenSommer
    • RE: Toothbrush integration

      Hey,
      guided by the idea of your simple approach I wrote a little script which tries to detect, if the brush is running or not.
      Caused by the bluetooth behavior of the brush it is very limited in guessing when the brush was stopped or resumed.
      Here are some details:

      • If the toothbrush is started bluetooth is activated for 3 Seconds.
      • If the brush is paused/stopped bluetooth is activated again for 32 Seconds.

      This leads to the following limited possiblities in tracking a brush session.

      • A start of a session is only trackable, if the programm/script has started with a (for 32 seconds) silent brush.
      • A stop is only trackable 3 seconds after start.
      • A stop/pause leads to a 32 Seconds “cooldown phase”, were no tracking is possible. This will reset the timer to 0:00.

      This is only helpfull if you do not interrupt you brushing session. :smile:

      If you wanna try the current setup you can run the script by:

      1. Enter your module-directory: cd ~/MagicMirror/modules
      2. Clone repository : git clone https://github.com/SvenSommer/MMM-OralB
      3. Enter new directory: cd ~/MagicMirror/modules/MMM-OralB
      4. Install dependencies: sudo apt-get install bluetooth bluez libbluetooth-dev libudev-dev
      5. Install noble module: npm install noble
      6. Exceute helper programm to find your brushID (this is not the mac-address): sudo node findBrushId.js
        This should lead to a output like
      Searching for OralB Toothbrushes with manufacturerData: "dc00010205030000000101"...
      changed state to:poweredOn
      Found OralB Tootbrush with ID: 544a1621209f
      
      
      1. Copy and paste your ID into the brushTimer.js file: sudo nano brushTimer.js
        (Save and exit with STRG + O and STRG + X )
      "use strict";
      
      var NodeHelper = require("node_helper");
      var noble = require('noble');
      
      //Copy Paste your ID here 
      var toothbrush_uuid = '544a1621209f';
      
      1. Run script with sudo node brushTimer.js
        This should lead to an output like:
      scanning started...
      Toothbrush is running
      0:1
      0:2
      0:3
      0:4
      0:5
      0:6
      0:7
      0:8
      0:9
      0:10
      0:11
      0:12
      0:13
      0:14
      0:15
      0:16
      0:17
      0:18
      Toothbrush stopped. "Cool down" for 32 seconds needed!
      
      
      posted in Requests
      SvenSommerS
      SvenSommer
    • RE: MMM-Globe

      @LukeCodewalker, @Burner911
      I just integrated the ‘centralAmericaDiscNat’ option and made a pull request.

      posted in Utilities
      SvenSommerS
      SvenSommer
    • 1 / 1