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

    Posts

    Recent Best Controversial
    • RE: npm ERR! cb() never called! _ when trying to install MMM-RTSPStream

      It may be the downgrade or a bug in the post install script for my module. Backstory: My module tries to install a patch to the main electron.js file on older MM versions so it can safely close the streams when you shut down the mirror - this is now included in the core MM code and is not installed if the code already exists.

      The errors with npm upgrade: it should be sudo before that line, that’s why you have a bunch of permission errore, but the node update took care of the npm update too.

      To fix the mirror install, replace MagicMirror/js/electron.js with a fresh copy from github for your version of MM to undo whatever the patch broke when it failed.

      posted in Troubleshooting
      S
      shbatm
    • RE: npm ERR! cb() never called! _ when trying to install MMM-RTSPStream

      You may try and update node and npm then retry:

      Update npm:

      npm install -g npm
      

      Update node (should update npm too):

      sudo npm cache clean -f
      sudo npm install -g n
      sudo n stable
      
      posted in Troubleshooting
      S
      shbatm
    • RE: npm ERR! cb() never called! _ when trying to install MMM-RTSPStream

      What version of node/npm are you using? And is this on a Raspberry Pi? The commands below will tell you the versions.

      node -v
      npm -v
      
      posted in Troubleshooting
      S
      shbatm
    • RE: [MMM-RTSPStream] - Video Streaming from Live Feeds & Security Cameras

      @barnosch said in [MMM-RTSPStream] - Video Streaming from Live Feeds & Security Cameras:

      The whole mirror crashes for some reason (black screen) and only the stream is still showing.

      Is there anything that shows up in the server or console log? Can you run the mirror using npm start dev to monitor the electron console for logs and let me know what the error is?

      I had already upgraded my mirror to the new version, there may be a dependency or change that is effecting it that I missed.

      posted in Utilities
      S
      shbatm
    • RE: [MMM-RTSPStream] - Video Streaming from Live Feeds & Security Cameras

      @PCPAYN3 said in [MMM-RTSPStream] - Video Streaming from Live Feeds & Security Cameras:

      I have a 8 channel Annke DVR analogue cameras not IP

      You just need to find out if you can access an RTSP stream for the cameras through the DVR. Not sure which exact model you have but:

      First, check here: https://www.ispyconnect.com/man.aspx?n=Annke

      Second, I found this after a Quick google search:
      According to this thread here, you can access an RTSP stream for each of the cameras using the following:

      rtsp://[username]:[password]@[ip]:[port]/[codec]/[channel]/[subtype]/av_stream
      username such as admin
      password such as 12345
      ip: device IP, such as 192.0.0.64
      port: 554
      codec: h264, MPEG-4 or mpeg4
      channel: channel number, such as channel one is ch1
      subtype: type of steam. main stream is main and substeam is sub

      For example:
      main stream of channel 1
      rtsp://admin:12345@192.0.0.64:554/h264/ch1/main/av_stream

      substream of channel 1
      rtsp://admin:12345@192.0.0.64:554/h264/ch1/sub/av_stream

      posted in Utilities
      S
      shbatm
    • RE: [MMM-RTSPStream] - Video Streaming from Live Feeds & Security Cameras

      @Niggich said in [MMM-RTSPStream] - Video Streaming from Live Feeds & Security Cameras:

      The installation of the “Graceful Shutdown” fails.

      OK. It’s not required to get the streams to work, but is required to shutdown the streams if you exit/stop MM. This will be included automatically in the next MagicMirror release.

      If you’re comfortable making the changes manually, you can find them here f646360 – otherwise don’t worry about it for now, you’ll just have to stop the streams by hand if you exit MM (they will restart automatically if you restart MM).

      posted in Utilities
      S
      shbatm
    • RE: [MMM-RTSPStream] - Video Streaming from Live Feeds & Security Cameras

      @barnosch said in [MMM-RTSPStream] - Video Streaming from Live Feeds & Security Cameras:

      i updated the module from work, but did not start the server thing to get the server config page.
      Later at home i could not start the server anymore to reach the config page.

      The config page is not mandatory, it just helps create a valid config file and helps you eliminate settings you don’t need to mess with. If you had a working version before on the wip branch, nothing significant has changed. If you used ffmpeg or the main branch before, you must update the port setting to ffmpegPort.

      You should also still be able to get to the config page after install:

      cd ~/MagicMirror/modules/MMM-RTSPStream
      # Make sure http-server is installed:
      sudo npm i -g http-server
      # Start the server:
      http-server -p 9999
      # Navigate in browser to:
      http://magic-mirror-ip:9999/config.html
      
      posted in Utilities
      S
      shbatm
    • RE: [MMM-RTSPStream] - Video Streaming from Live Feeds & Security Cameras

      @Johans said in [MMM-RTSPStream] - Video Streaming from Live Feeds & Security Cameras:

      I’ve noticed that when video is out of the box window, the omxplayer is not stopped or killed. Video still remains visible even MM has stopped.

      This sounds like there is still a glitch in the starting of the stream. I will investigate on my end too. Are you using any other modules that hide or show this one? Scheduler, Carousel, or ProfileSwitcher?

      posted in Utilities
      S
      shbatm
    • RE: [MMM-RTSPStream] - Video Streaming from Live Feeds & Security Cameras

      @Niggich It appears it is installing correctly and the post-install is not working, please try to run the following commands and see which one fails:

      # Change directory
      cd ~/MagicMirror/modules/MMM-RTSPStream 
      # Install the "Graceful Shutdown" patch on MM core (Issue #1056)
      ./install_sd_patch.sh
      # Install the Node.js http-server module
      sudo npm i -g http-server
      
      posted in Utilities
      S
      shbatm
    • RE: [MMM-RTSPStream] - Video Streaming from Live Feeds & Security Cameras

      @Johans I just tried this on my mirror and was able to get the video feed to move without a problem. Did you try restarting the mirror & video feed after you made the change? You can also try making larger changes to make sure it’s actually moving : moduleOffset: { left -200, top: 200} or try just moduleOffset: 50 to make sure it works.

      An alternative is to watch the console log for the parameters used:

      Starting stream stream1 with args: [
          "--avdict",
          "rtsp_transport:tcp",
          "--win",
          "731, 439, 1259, 799",  # --- this is the position it tries to draw the video
          ...
      

      And then add the following inside the stream1: { section to specify the exact position you want the video to show using the numbers from the log and your desired offset:

      absPosition: { top: XX, right: XX, bottom: XX, left: XX },
      posted in Utilities
      S
      shbatm
    • RE: [MMM-RTSPStream] - Video Streaming from Live Feeds & Security Cameras

      Version 1.2.1 (Updated 15 Oct 2017) Now Available on ‘master’ branch

      • Now uses hardware-accelerated OMXPlayer as default player for local video
      • Resolved latency issues
      • Uses PM2 to control stream playback – automatically restarts streams when they close
      • Fullscreen, custom window and offset options now available.
      • Important - please update your configurations after updating this module. as some settings have changed. This new version includes a new configuration tool for building your configuration section.

      Fresh Install:

      See the installation instructions on the README.

      To switch back from the ‘wip’ branch:

      (Only necessary if you want to, the ‘wip’ and ‘master’ are the same currently, but I will update the ‘wip’ with new features and bug-fixes first for testing. If you want to beta test, stay on ‘wip’)

      cd ~/MagicMirror/modules/MMM-RSTPStream
      git checkout master
      git pull
      npm install
      http-server -p 9999
      # From a web browser, navigate to http://mirror-ip:9999/config.html
      # Once your config is made, press Ctrl+C to exit the config builder
      # Restart your mirror and test!
      
      posted in Utilities
      S
      shbatm
    • RE: Exit MM2 process gracefully?

      @j.e.f.f That could be, I wonder if when Electron starts it somehow removes any SIGINT listeners already created.

      With respect to running stop() during a MM crash – the main function in js/app.js is still attaching to process.on("SIGINT", ...) just upstream of the individual node_helper files. If MM crashes I think it should still call the stop() functions unless the node_helper array gets corrupted. An advantage to cycling through each node_helper would be that you don’t have multiple individual SIGINT listeners that are trying to call a process.exit before the other is done.

      posted in Bug Hunt
      S
      shbatm
    • RE: Exit MM2 process gracefully?

      @j-e-f-f, very strange. Mine was in the node-helper file as well, called inside the start function and I also tried it in the core js/app.js file with the same result. As I mentioned, it worked fine for server only and I was pulling my hair out trying to get it to work when running MM normally… Ctrl+C when running npm start and pm2 stop mm with pm2 would exit without even writing the console line.

      Full code that wasn’t working here

      Working code based on the change request I described here

      Thank you for the help, I’m going to chalk it up to a fluke that I’ve spent too much time investigating and now have a work around. It’ll be nice to have a standard clean-up method incorporated in the main code anyways.

      posted in Bug Hunt
      S
      shbatm
    • RE: Exit MM2 process gracefully?

      @j.e.f.f Just curious, are you running MM as server-only or with Electron (npm start)? My problem is I used almost exactly the same snippet you have and it was completely ignored when using Electron; however, it worked fine when using server-only mode. I did some research and found that the Electron browser intercepts the exit commands and needs an app.on("before-quit"... command, but I couldn’t override this from a module.

      I ended up making a tweak to the core and a pull request to work around this:
      https://github.com/MichMich/MagicMirror/pull/1058

      If this gets incorporated then all you’d need in your node_helper.js is a stop() function:

      stop: function() { 
        console.log("[MMM-MyWink] Cleaning Up");
        self.pubnub.removeListener(self.pnListener);
        self.pubnub.unsubscribeAll();
      } 
      
      posted in Bug Hunt
      S
      shbatm
    • RE: Exit MM2 process gracefully?

      I ended up opening an issue related to this on GitHub here: #1056. I was trying to implement the method @j-e-f-f suggested, but when using Electron, it ignores the call to process.on('SIGINT'...).

      What I am suggesting, in case anyone else developing a module needs this: allow module developers to implement a stop: function() { } in their node_helper.js file that performs any cleanup required. When exiting, the MM app will call this function, if it exists, and each module can gracefully exit on it’s own.

      There is a working example of this here: shbatm/MagicMirror@9935d2f

      posted in Bug Hunt
      S
      shbatm
    • RE: [MMM-RTSPStream] - Video Streaming from Live Feeds & Security Cameras

      @Johans Which other modules are you using? It looks like you may be using something like MMM-ProfileSwitcher, there may be a conflict between these modules or it may be because of the % symbol in the password.

      Also, when you switched to the wip branch, did you remember to re-run npm install in that folder? There are some additional dependencies for the wip branch.

      posted in Utilities
      S
      shbatm
    • RE: [MMM-RTSPStream] - Video Streaming from Live Feeds & Security Cameras

      @kasperb - I have a suspicion – I think this is the same issue @Niggich was having where OMXPlayer doesn’t like non-integer window dimensions.

      Please try changing the moduleOffset: 0, setting to 0.5 and see if the video will work. If it works, you can change the offset back to 0 and try updating the module with the patch I just pushed:

      cd ~/MagicMirror/modules/MMM-RTSPStream
      git fetch --all
      git pull
      

      If you experience issues with the stream stopping after running for a few days, I am still finalizing work on another branch to resolve this: wip_patch which runs OMXPlayer through pm2 so it will automatically restart feed and hopefully be more stable.

      posted in Utilities
      S
      shbatm
    • RE: [MMM-RTSPStream] - Video Streaming from Live Feeds & Security Cameras

      @kasperb said in [MMM-RTSPStream] - Video Streaming from Live Feeds & Security Cameras:

      Is there a way to add the command to the config in order for the camera to work?

      Adding protocol: 'tcp' should have done the trick. You can also try just removing the protocol line completely since the default protocol is TCP. The default command for omxplayer is:

      omxplayer --avdict rtsp_transport:tcp --win 'x y w h' --live --video_queue 4 --fps 30 {{url}}
      

      The bit of code you referenced is to not include --avdict rtsp_transport:tcp when using a UDP stream.

      Also, check the console log to see what command was used to start OMXPlayer. It should print the list of arguments.

      posted in Utilities
      S
      shbatm
    • RE: [MMM-RTSPStream] - Video Streaming from Live Feeds & Security Cameras

      @Niggich could you please post your server log (console or PM2’s log file) when it does this? You should have several lines starting with:

      Starting stream stream1 with args: 
      

      Also, what are you using to show/hide the module? (via MMM-Remote-Control or another module?)

      This will help diagnose.

      posted in Utilities
      S
      shbatm
    • RE: [MMM-RTSPStream] - Video Streaming from Live Feeds & Security Cameras

      @barnosch said in [MMM-RTSPStream] - Video Streaming from Live Feeds & Security Cameras:

      added the pkill commands but it does not work. It does not kill the apps.
      From time to time, the feed disappears. Have not yet found when and why.
      Sometimes it runs 2 days without problems, the other day it only lasts for some hours.

      Issue #14 opened to track this problem to closure.

      posted in Utilities
      S
      shbatm
    • 1
    • 2
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 8 / 11