MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    MMM-OralB / Bluetooth equipped toothbrush integration

    Scheduled Pinned Locked Moved Development
    68 Posts 13 Posters 29.2k Views 20 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • SvenSommerS Offline
      SvenSommer @lavolp3
      last edited by

      @lavolp3 Thanks for your post. I will have a look into this, hopefully in the next week! I’m still convinced we should build this module.

      Looking for some building inspiration?
      Check out my large, thin and metal framed mirror on robstechlog.com.

      Modules released:
      MMM-GoogleAnalytics
      MMM-GrafanaChart
      MMM-GrafanaGauges

      lavolp3L 1 Reply Last reply Reply Quote 0
      • lavolp3L Offline
        lavolp3 Module Developer @SvenSommer
        last edited by

        @SvenSommer Thanks Sven and good you’re back on this :-)

        I have one question on noble I can’t figure out.
        with noble.on('discover') I can exchange information on discovery, so as soon as the brush sends a certain signal. All good.
        But how can I trigger the brush to send its manufacturedata, let’s say, every 2 seconds?
        Or is that not possible at all?

        How to troubleshoot modules
        MMM-soccer v2, MMM-AVStock

        lavolp3L 1 Reply Last reply Reply Quote 0
        • lavolp3L Offline
          lavolp3 Module Developer @lavolp3
          last edited by

          A small heads-up: Still not getting to terms with noble.

          But as I had some connection problems today, I used bluetoothctl again to connect to my brush.
          And found out that scanning with bluetoothctl gets a constant output of the manufacturerData of the brush.

          With bluetoothctl it would be able to get information on

          • running time
          • mode (on/off)
          • quadrant
            in an interval of like 10 seconds

          How to troubleshoot modules
          MMM-soccer v2, MMM-AVStock

          1 Reply Last reply Reply Quote 0
          • T Offline
            timodejong95
            last edited by

            Hey guys,

            I have tracked this topic for a while and I have created an own module for bluetooth devices based on (https://github.com/Hypfer/Cybele). Currently only Oral B toothbrush is supported: https://github.com/timodejong95/MMM-BluetoothDevices

            I am still testing it but it seems to work stable’ish. Although I cannot test it with an actual mirror because that is still work in progress. If you want to check it out and test be my guest. If you have any improvements or tips let me know!

            Hope this helps out.

            lavolp3L 1 Reply Last reply Reply Quote 1
            • lavolp3L Offline
              lavolp3 Module Developer @timodejong95
              last edited by

              @timodejong95 GREAT!!
              I’ll try it out now.
              One comment to the readme.
              You have given the config entry in JSON style (with hyphens around the keys).
              Config entries are in JS style.
              I guess devices should also be an array of JS objects?

              Then it should be like this:

                  {
                    module: "MMM-BluetoothDevices",
                    position: "bottom_bar",
                    config: {
                      devices: [
                        { type: "OralBToothbrush", name: "OralB", mac: "" }
                      ]
                    }
                  },
              
              

              How to troubleshoot modules
              MMM-soccer v2, MMM-AVStock

              lavolp3L 1 Reply Last reply Reply Quote 0
              • lavolp3L Offline
                lavolp3 Module Developer @lavolp3
                last edited by

                @lavolp3 Also mentioning in the Readme that npm install is necessary would be helpful

                How to troubleshoot modules
                MMM-soccer v2, MMM-AVStock

                1 Reply Last reply Reply Quote 0
                • lavolp3L Offline
                  lavolp3 Module Developer
                  last edited by lavolp3

                  OK I have a first error message

                  [15:04:46.174] [ERROR]  15:04:46 <error> (node:1454) UnhandledPromiseRejectionWarning: Error: No such interface found
                      at /home/pi/MagicMirror/modules/MMM-BluetoothDevices/node_modules/dbus-native/lib/introspect.js:31:23
                      at Parser.<anonymous> (/home/pi/MagicMirror/modules/MMM-BluetoothDevices/node_modules/xml2js/lib/parser.js:304:18)
                      at Parser.emit (events.js:182:13)
                      at SAXParser.onclosetag (/home/pi/MagicMirror/modules/MMM-BluetoothDevices/node_modules/xml2js/lib/parser.js:262:26)
                      at emit (/home/pi/MagicMirror/modules/MMM-BluetoothDevices/node_modules/sax/lib/sax.js:624:35)
                      at emitNode (/home/pi/MagicMirror/modules/MMM-BluetoothDevices/node_modules/sax/lib/sax.js:629:5)
                      at closeTag (/home/pi/MagicMirror/modules/MMM-BluetoothDevices/node_modules/sax/lib/sax.js:889:7)
                      at SAXParser.write (/home/pi/MagicMirror/modules/MMM-BluetoothDevices/node_modules/sax/lib/sax.js:1436:13)
                      at Parser.exports.Parser.Parser.parseString (/home/pi/MagicMirror/modules/MMM-BluetoothDevices/node_modules/xml2js/lib/parser.js:323:31)
                      at Parser.parseString (/home/pi/MagicMirror/modules/MMM-BluetoothDevices/node_modules/xml2js/lib/parser.js:5:59) (/home/pi/MagicMirror/internal/process/warning.js:18 writeOut)
                  

                  no Toothbrush activated yet. Only started the mirror with npm start dev.
                  Running on a RasPi 3b w/ on-board bluetooth

                  How to troubleshoot modules
                  MMM-soccer v2, MMM-AVStock

                  1 Reply Last reply Reply Quote 0
                  • T Offline
                    timodejong95
                    last edited by timodejong95

                    Ooh good one, I have some time tonight, will update the docs.

                    Hmm you running on raspberry pi do you got bluetooth enabled? Can you find the toothbrush if you use the GUI bluetooth?

                    If you got the time could we skype or call, it’s faster to tackle issueus, PM me about that.

                    lavolp3L 2 Replies Last reply Reply Quote 0
                    • lavolp3L Offline
                      lavolp3 Module Developer @timodejong95
                      last edited by lavolp3

                      @timodejong95 that’s rather difficult for me juggling with family, (home) office and several other things I have to say. Will think about this and let you know.

                      I have worked successfully with bluetoothctl and noble (npm).
                      Both were able to connect to the brush.
                      With bluetoothctl I got a constant stream of the manufacturer data that contains some info. (see above)
                      I used that straight from the console.

                      How to troubleshoot modules
                      MMM-soccer v2, MMM-AVStock

                      1 Reply Last reply Reply Quote 0
                      • lavolp3L Offline
                        lavolp3 Module Developer @timodejong95
                        last edited by lavolp3

                        @timodejong95 OK I have identified the source of the error.
                        It originated from the connectDevice function on Dongle.js
                        I had a wrong mac address for the brush which leads to an unresolved promise.
                        Good luck finding the promise :smiling_face_with_open_mouth_smiling_eyes:
                        (I love/hate promises…)

                        Correcting the mac address I get new unresolved rejection errors.

                        [11:54:35.940] [LOG]    11:54:35 <log> Retrying Dirks OralB 2/3 (/home/pi/MagicMirror/modules/MMM-BluetoothDevices/src/Device.js:42 Promise)
                        [11:54:35.964] [ERROR]  11:54:35 <error> (node:23373) UnhandledPromiseRejectionWarning: Software caused connection abort (/home/pi/MagicMirror/internal/process/warning.js:18 writeOut)
                        [11:54:35.970] [ERROR]  11:54:35 <error> (node:23373) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (/home/pi/MagicMirror/internal/process/warning.js:18 writeOut)
                        [11:54:35.975] [ERROR]  11:54:35 <error> (node:23373) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. (/home/pi/MagicMirror/internal/process/warning.js:18 writeOut)
                        [11:55:16.260] [LOG]    11:55:16 <log> Retrying Dirks OralB 3/3 (/home/pi/MagicMirror/modules/MMM-BluetoothDevices/src/Device.js:42 Promise)
                        [11:55:16.275] [ERROR]  11:55:16 <error> (node:23373) UnhandledPromiseRejectionWarning: Software caused connection abort (/home/pi/MagicMirror/internal/process/warning.js:18 writeOut)
                        [11:55:16.279] [ERROR]  11:55:16 <error> (node:23373) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2) (/home/pi/MagicMirror/internal/process/warning.js:18 writeOut)
                        [11:55:56.582] [ERROR]  11:55:56 <error> (node:23373) UnhandledPromiseRejectionWarning: Error: Couldn't connect to Dirks OralB after 4 tries.
                            at Promise (/home/pi/MagicMirror/modules/MMM-BluetoothDevices/src/Device.js:46:16)
                            at new Promise (<anonymous>)
                            at tryConnect (/home/pi/MagicMirror/modules/MMM-BluetoothDevices/src/Device.js:40:14)
                            at Object.iFace.Connect (/home/pi/MagicMirror/modules/MMM-BluetoothDevices/src/Device.js:56:13)
                            at EventEmitter.<anonymous> (/home/pi/MagicMirror/modules/MMM-BluetoothDevices/node_modules/dbus-native/lib/bus.js:140:19)
                            at EventEmitter.emit (events.js:187:15)
                            at /home/pi/MagicMirror/modules/MMM-BluetoothDevices/node_modules/dbus-native/index.js:106:14
                            at Socket.<anonymous> (/home/pi/MagicMirror/modules/MMM-BluetoothDevices/node_modules/dbus-native/lib/message.js:55:9)
                            at Socket.emit (events.js:182:13)
                            at emitReadable_ (_stream_readable.js:540:12) (/home/pi/MagicMirror/internal/process/warning.js:18 writeOut)
                        [11:55:56.588] [ERROR]  11:55:56 <error> (node:23373) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3) (/home/pi/MagicMirror/internal/process/warning.js:18 writeOut)
                        [11:55:56.593] [ERROR]  11:55:56 <error> (node:23373) UnhandledPromiseRejectionWarning: Software caused connection abort (/home/pi/MagicMirror/internal/process/warning.js:18 writeOut)
                        [11:55:56.599] [ERROR]  11:55:56 <error> (node:23373) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4) (/home/pi/MagicMirror/internal/process/warning.js:18 writeOut)
                        

                        So… Software caused connection abort. Don’t know what that means unfortunately. Guess I need to learn a bit more about the connection process. But I get the feeling that this module is a bit too complex for just using with my toothbrush.
                        Let me know if you know my problem.

                        How to troubleshoot modules
                        MMM-soccer v2, MMM-AVStock

                        T 1 Reply Last reply Reply Quote 0
                        • 1
                        • 2
                        • 3
                        • 4
                        • 5
                        • 6
                        • 7
                        • 5 / 7
                        • First post
                          Last post
                        Enjoying MagicMirror? Please consider a donation!
                        MagicMirror created by Michael Teeuw.
                        Forum managed by Sam, technical setup by Karsten.
                        This forum is using NodeBB as its core | Contributors
                        Contact | Privacy Policy