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.

    Adding suspend and resume functions into modules

    Scheduled Pinned Locked Moved Troubleshooting
    1 Posts 1 Posters 1.2k Views 1 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.
    • L Offline
      Labzz
      last edited by Labzz

      Hi everyone,

      Im using the facial recognition and added multiple modules into different classes.
      All the modules works fine together but my CPU load spikes up to ~90-100% at the startup.

      This made me stopping adding new awesome personal modules for each person. I found out the “Suspend and Resume” functions in the Development Documentation. I want to implement it into my Mirror to suspend unused modules.

      The point is if Person1 is recognized, the Default and the Person 2 modules should be suspended and Person 1 should be resumed etc etc.

      I made a short example of my config.js using the clock module and 2 persons.
      If you can help me further with 1 module, the location and the way of using it, i can use the code to add it for the other modules.

      var config = {
      port: 8080,
          
      
      language: 'nl',
      timeFormat: 24,
      units: 'metric',
      
      
      modules: [ 
              	{
              		module: 'clock',
              		position: 'top_left',
              		classes: 'default'
              	},
                      {
                          module: 'currentweather',
                          position: 'top_right',
                          classes: 'Person1',
      			config: {
                              location: 'location',
                              appid: 'APPID'
                              }
                      },
                      {
                          module: 'weatherforecast',
                          position: 'top_right',
      			classes: 'Person2',
                              header: 'Weather Forecast',
                              config: {
                              location: 'location',
                              appid: 'APPID'
                          }
                      },  
                      {
      			module: 'MMM-Facial-Recognition',
      				config: {
      					recognitionAlgorithm: 1,		
      					lbphThreshold: 50,			
      					fisherThreshold: 250,			
      					eigenThreshold: 3000,			
      					useUSBCam: true,			
      					trainingFile: '/home/pi/MagicMirror/modules/MMM-Facial-Recognition/training.xml',	
      					interval: 1,				
      					logoutDelay: 15,			
      					users: ['Person1', 'Person2'],			
      					defaultClass: "default",		
      					everyoneClass: "everyone"		
      				}
      			},		
      //-------------------------------------------------
      	]
      };
      
      /*************** DO NOT EDIT THE LINE BELOW ***************/
      if (typeof module !== 'undefined') {module.exports = config;}
      
      
      
      1 Reply Last reply Reply Quote 0

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      • 1 / 1
      • 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