• 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.

Adding suspend and resume functions into modules

Scheduled Pinned Locked Moved Troubleshooting
1 Posts 1 Posters 1.1k 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 Feb 4, 2017, 12:01 PM Feb 4, 2017, 11:58 AM

    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
    • 1 / 1
    1 / 1
    • First post
      1/1
      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