MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord
    MagicMirror² v2.24.0 is available! For more information about this release, check out this topic.

    IP-Cam/Simple-Logo mod for WebCam JPEG

    Troubleshooting
    1
    2
    2489
    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.
    • R
      Reotch2 last edited by

      After purchasing a FOSCAM R2, I dug further into the forum and discovered it’s not supported by the IP-Cam module. Even though I’m unable to stream realtime video, I’ve discovered I can use a “Snap” static link to get a realtime JPEG.

      http://ip address:port/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=admin&pwd=xxx

      With a static link and interval updates, Simple-Logo is the perfect module for the job. Unfortunately, after the initial load, the SimpleLogo code returns a broken image link icon. After placing an “self.updateDom()” command in the start function section and removing the timestamp code, I’ve gotten the SimpleLogo code to work, but only when viewing it remotely through the (Remote) module. In other words, the picture updates at the appropriate interval on my phone. BUT, not on the mirror running MM through electron. On the mirror, the image is static and doesn’t update.

      ANY help would be greatly appreciated. The modified SimpleLogo Start: Function() is below.

      start: function() {
      if (this.config.refreshInterval > 0) {
      var self = this;
      setInterval(function() {
      var img = document.querySelector(‘.simple-logo__container’);
      img.setAttribute(‘src’, this.config.fileUrl);
      self.updateDom();
      }, this.config.refreshInterval);

          }
      },
      

      Thanks ahead of time.

      R 1 Reply Last reply Reply Quote 1
      • R
        Reotch2 @Reotch2 last edited by

        @Reotch2 So… I’m an idiot. The static link for SimpleLogo worked fantastic… AFTER… I mod’d the SetInterval function to have a “&” instead of the “?”. now the camera works perfectly. Put simply… use SimpleLogo… use the Foscam static link above to pull a JPEG… update the MMM-SimpleLogo.js Start Function as follows.

        start: function() {
        if (this.config.refreshInterval > 0) {
        var self = this;
        setInterval(function() {
        img = document.querySelector(‘.simple-logo__container img’);
        img.setAttribute(‘src’, self.config.fileUrl + ‘&’ + Date.now());
        }, this.config.refreshInterval);
        }
        },

        1 Reply Last reply Reply Quote 1
        • 1 / 1
        • First post
          Last post
        Enjoying MagicMirror? Please consider a donation!
        MagicMirror created by Michael Teeuw.
        Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
        This forum is using NodeBB as its core | Contributors
        Contact | Privacy Policy