• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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.

Module MMM-Hover dosn't work with the new MM 2.7

Scheduled Pinned Locked Moved Unsolved Troubleshooting
9 Posts 2 Posters 2.1k Views 2 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.
  • S Offline
    Skorpionbird @sdetweil
    last edited by Skorpionbird Jun 10, 2019, 8:59 PM Jun 10, 2019, 8:56 PM

    @sdetweil hello yes i did mm is starting with this error:

    Whoops! There was an uncaught exception…
    TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
    at maybeCallback (fs.js:157:9)
    at Object.fs.write (fs.js:652:16)
    at Gpio.write (/home/pi/MagicMirror/modules/MMM-Hover/node_modules/onoff/onoff.js:202:6)
    at Timeout._onTimeout (/home/pi/MagicMirror/modules/MMM-Hover/node_modules/hover-nodejs/Hover.js:50:15)
    at ontimeout (timers.js:427:11)
    at tryOnTimeout (timers.js:289:5)
    at listOnTimeout (timers.js:252:5)
    at Timer.processTimers (timers.js:212:10)

    S 1 Reply Last reply Jun 10, 2019, 9:26 PM Reply Quote 0
    • S Offline
      sdetweil @Skorpionbird
      last edited by sdetweil Jun 11, 2019, 12:27 AM Jun 10, 2019, 9:26 PM

      @Skorpionbird looks like a breaking change in onoff.js module…

      latest fs has started enforcing callback on async operations.

      onoff write needs to be fixed like read

      Gpio.prototype.read = function (callback) {
        fs.read(this.valueFd, this.readBuffer, 0, 1, 0, function (err, bytes, buf) {
          if (typeof callback === 'function') {
            if (err) {
              return callback(err);
            }
      
            callback(null, buf[0] === ONE[0] ? 1 : 0);
          }
        });
      };
      

      current write

      Gpio.prototype.write = function (value, callback) {
        var writeBuffer = value === 1 ? ONE : ZERO;
        fs.write(this.valueFd, writeBuffer, 0, writeBuffer.length, 0, callback);
      };
      

      try editing MagicMirror/node_modules/onoff/onoff.js
      and changing the Gpio.prototype.write (line 200)
      to this

      Gpio.prototype.write = function (value, callback) {
        var writeBuffer = value === 1 ? ONE : ZERO;
        fs.write(this.valueFd, writeBuffer, 0, writeBuffer.length, 0, function (err, bytes, buf) {
          if (typeof callback === 'function') {
            if (err) {
              return callback(err);
            }
      
            callback(null, bytes, buf);
          }
        });
      };
      

      I have submitted issue 150 to the onoff module on github

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      1 Reply Last reply Reply Quote 0
      • S Offline
        Skorpionbird
        last edited by Jun 11, 2019, 7:02 AM

        Hi, thanks for the fast reply. I made the change, but I can only test it tonight when I’m home.

        S 1 Reply Last reply Jun 11, 2019, 10:16 AM Reply Quote 0
        • S Offline
          sdetweil @Skorpionbird
          last edited by sdetweil Jun 11, 2019, 10:16 AM Jun 11, 2019, 10:16 AM

          @Skorpionbird ok… on the issue I posted, the developer says latest onoff version should work too…

          4.1.1, hover-nodejs request 1.1.1 and got 1.2.0

          so another thing to try after this, is rename the node_modules/onoff folder to onoff-old
          then from MagicMirror folder do

          npm install onoff
          

          to get the latest

          and try running mirror again…

          there are some breaking changes in 4.1.0 and above, so its possible to cause more problems…

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          S 1 Reply Last reply Jun 11, 2019, 5:30 PM Reply Quote 0
          • S Offline
            Skorpionbird @sdetweil
            last edited by Jun 11, 2019, 5:30 PM

            @sdetweil thx for your help now it works fine. I have the old issue that the page change just on the rightslide. But this ok… when push the left button i can see that the MMM-page-indicator module change the page but it dosnt change the infos on the screen.

            S 1 Reply Last reply Jun 11, 2019, 9:03 PM Reply Quote 0
            • S Offline
              sdetweil @Skorpionbird
              last edited by Jun 11, 2019, 9:03 PM

              @Skorpionbird cool which solution did u use? Edit file or upgrade on off?

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              S 1 Reply Last reply Jun 12, 2019, 7:05 PM Reply Quote 0
              • S Offline
                Skorpionbird @sdetweil
                last edited by Jun 12, 2019, 7:05 PM

                @sdetweil i edit the file.

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                1 / 1
                • First post
                  7/9
                  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