MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord
    1. Home
    2. CurlyQ12391
    3. Posts
    C
    • Profile
    • Following 0
    • Followers 0
    • Topics 3
    • Posts 8
    • Best 2
    • Controversial 0
    • Groups 0

    Posts made by CurlyQ12391

    • RE: Need help MMM-touch MMM-pages MMM-page indicator

      @crown,
      Did you end up getting anywhere with this? I have MMM-Touch and MMM-page-indicator but it seems to only work intermittently or upon first restarting MM. After that it just ignore any taps or swipes.

      I’ve tried calling “MMM-pages”, “MMM-page-indicator”, and also just “default” without luck.

      Just trying to figure out where I may have gone wrong.

      { 
      module: "MMM-Touch", 
      position: "bottom_bar", 
      config:{
      gestureCommands: {     
              "MMM-pages": {
                      "TAP": (commander) => { commander.sendNotification("PAGE_CHANGE")}
                       "SWIPE_RIGHT": (commander) => { commander.sendNotification("PAGE_INCREMENT")}
                        ,"SWIPE_LEFT": (commander) => { commander.sendNotification("PAGE_DECREMENT")}     
                                                 } 
                                }
                  }
      },
      
      posted in Development
      C
      CurlyQ12391
    • RE: Default Calendar Troubleshooting - "No Upcoming Events"

      @sdetweil omg you are amazing!

      I increassed the maximumEntries value to “1000000” and viola everything populated into MMM-CalendarExt3. I had previously increased it to “10000”, but apparently I just had too many old events.

      After the fix is rolled out should I decrease the maximumEntries value to a smaller number or can I leave it as is? I dont want to break mine after you fix it (haha).

      posted in Troubleshooting
      C
      CurlyQ12391
    • Default Calendar Troubleshooting - "No Upcoming Events"

      Hello,

      I am having some trouble with the default calendar module. I have the config set up I believe correctly and the secret iCal link downloads a file so I know that is working.

      Config:

      		{
      			module: "calendar",
      			header: "Skaggs Family Calendar",
      			position: "bottom_right", // This can be any of the regions. Best results in left or right regions.
      			config: {
      				maximumEntries: 365, // Total Maximum Entries
      				maximumNumberOfDays: 365,
      				fetchInterval: 5 * 60 * 1000, // Update every 5 minutes.
      				getRelative: 6,
      				fadePoint: 0.25, // Start on 1/4th of the list.
      				colored: true,
      				coloredSymbolOnly: false,
      				customEvents: [], // Array of {keyword: "", symbol: "", color: ""} where Keyword is a regexp and symbol/color are to be applied for matched
      				tableClass: "small",
      				calendars: [
      					{
      					symbol: "calendar-alt",
      					url: "https://calendar.google.com/calendar/ical/curlyq12391%40gmail.com/private-**xxxxxxxxx**/basic.ics",
      					}
      				],
      
      				broadcastEvents: true,
      				sliceMultiDayEvents: false,
      				broadcastPastEvents: true,
      				nextDaysRelative: false,
      				selfSignedCert: false
      			}
      		},
      

      I am able to see that the calendar IS broadcasting events through the log, so I assume that is functioning correctly…

      Logs:

      0|mm     | > magicmirror@2.20.0 start
      0|mm     | > DISPLAY="${DISPLAY:=:0}" ./node_modules/.bin/electron js/electron.js
      0|mm     | [28.09.2022 07:29.56.841] [LOG]   
      0|mm     | Starting MagicMirror: v2.20.0
      0|mm     | [28.09.2022 07:29.56.850] [LOG]   
      0|mm     | Loading config ...
      0|mm     | [28.09.2022 07:29.56.858] [LOG]   
      0|mm     | Loading module helpers ...
      0|mm     | [28.09.2022 07:29.56.863] [LOG]   
      0|mm     | No helper found for module: MMM-pages.
      0|mm     | [28.09.2022 07:29.56.867] [LOG]   
      0|mm     | No helper found for module: MMM-page-indicator.
      0|mm     | [28.09.2022 07:29.56.871] [LOG]   
      0|mm     | No helper found for module: alert.
      0|mm     | [28.09.2022 07:29.56.891] [LOG]   
      0|mm     | Initializing new module helper ...
      0|mm     | [28.09.2022 07:29.56.894] [LOG]   
      0|mm     | Module helper loaded: updatenotification
      0|mm     | [28.09.2022 07:29.56.898] [LOG]   
      0|mm     | No helper found for module: clock.
      0|mm     | [28.09.2022 07:29.57.195] [LOG]   Initializing new module helper ...
      0|mm     | [28.09.2022 07:29.57.197] [LOG]   Module helper loaded: calendar
      0|mm     | [28.09.2022 07:29.57.198] [LOG]   
      0|mm     | No helper found for module: MMM-CalendarExt3.
      0|mm     | [28.09.2022 07:29.57.232] [LOG]   
      0|mm     | Initializing new module helper ...
      0|mm     | [28.09.2022 07:29.57.234] [LOG]   
      0|mm     | Module helper loaded: newsfeed
      0|mm     | [28.09.2022 07:29.57.334] [LOG]   
      0|mm     | Initializing new module helper ...
      0|mm     | [28.09.2022 07:29.57.335] [LOG]   
      0|mm     | Module helper loaded: MMM-OpenWeatherForecast
      0|mm     | [28.09.2022 07:29.59.336] [LOG]   
      0|mm     | Initializing new module helper ...
      0|mm     | [28.09.2022 07:29.59.337] [LOG]   Module helper loaded: MMM-RemoteCompliments
      0|mm     | [28.09.2022 07:29.59.339] [LOG]   
      0|mm     | No helper found for module: MMM-Cursor.
      0|mm     | [28.09.2022 07:29.59.342] [LOG]   
      0|mm     | Initializing new module helper ...
      0|mm     | [28.09.2022 07:29.59.342] [LOG]   Module helper loaded: MMM-Touch
      0|mm     | [28.09.2022 07:29.59.343] [LOG]   All module helpers loaded.
      0|mm     | [28.09.2022 07:29.59.468] [LOG]   
      0|mm     | Starting server on port 8080 ... 
      0|mm     | [28.09.2022 07:29.59.483] [LOG]   
      0|mm     | Server started ...
      0|mm     | [28.09.2022 07:29.59.485] [LOG]   Connecting socket for: updatenotification
      0|mm     | [28.09.2022 07:29.59.486] [LOG]   
      0|mm     | Starting module helper: updatenotification
      0|mm     | [28.09.2022 07:29.59.487] [LOG]   Connecting socket for: calendar
      0|mm     | [28.09.2022 07:29.59.488] [LOG]   Starting node helper for: calendar
      0|mm     | [28.09.2022 07:29.59.489] [LOG]   Connecting socket for: newsfeed
      0|mm     | [28.09.2022 07:29.59.490] [LOG]   Starting node helper for: newsfeed
      0|mm     | [28.09.2022 07:29.59.491] [LOG]   Connecting socket for: MMM-OpenWeatherForecast
      0|mm     | [28.09.2022 07:29.59.493] [LOG]   ====================== Starting node_helper for module [MMM-OpenWeatherForecast]
      0|mm     | [28.09.2022 07:29.59.494] [LOG]   Connecting socket for: MMM-RemoteCompliments
      0|mm     | [28.09.2022 07:29.59.497] [LOG]   Starting node helper for: MMM-RemoteCompliments
      0|mm     | [28.09.2022 07:29.59.497] [LOG]   Connecting socket for: MMM-Touch
      0|mm     | [28.09.2022 07:29.59.498] [LOG]   Starting module helper: MMM-Touch
      0|mm     | [28.09.2022 07:29.59.498] [LOG]   Sockets connected & modules started ...
      0|mm     | [28.09.2022 07:29.59.855] [LOG]   
      0|mm     | Launching application.
      0|mm     | MESA-LOADER: failed to retrieve device information
      0|mm     | MESA-LOADER: failed to retrieve device information
      0|mm     | MESA-LOADER: failed to retrieve device information
      0|mm     | MESA-LOADER: failed to open kms_swrast: /usr/lib/dri/kms_swrast_dri.so: cannot open shared object file: Permission denied (search paths /usr/lib/arm-linux-gnueabihf/dri:\$${ORIGIN}/dri:/usr/lib/dri)
      0|mm     | failed to load driver: kms_swrast
      0|mm     | MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: Permission denied (search paths /usr/lib/arm-linux-gnueabihf/dri:\$${ORIGIN}/dri:/usr/lib/dri)
      0|mm     | failed to load swrast driver
      0|mm     | [28.09.2022 07:30.03.015] [LOG]   
      0|mm     | Create new calendarfetcher for url: https://calendar.google.com/calendar/ical/curlyq12391%40gmail.com/private-**xxxxxxxxx**/basic.ics - Interval: 300000
      0|mm     | [28.09.2022 07:30.03.112] [LOG]   
      0|mm     | Create new newsfetcher for url: https://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml - Interval: 300000
      0|mm     | [28.09.2022 07:30.03.147] [INFO]  
      0|mm     | Checking git for module: MMM-pages
      0|mm     | [28.09.2022 07:30.03.210] [INFO]  
      0|mm     | Checking git for module: MMM-page-indicator
      0|mm     | [28.09.2022 07:30.03.243] [INFO]  
      0|mm     | Checking git for module: MMM-CalendarExt3
      0|mm     | [28.09.2022 07:30.03.301] [INFO]  
      0|mm     | Checking git for module: MMM-OpenWeatherForecast
      0|mm     | [28.09.2022 07:30.03.331] [INFO]  
      0|mm     | Checking git for module: MMM-RemoteCompliments
      0|mm     | [28.09.2022 07:30.03.362] [INFO]  
      0|mm     | Checking git for module: MMM-Cursor
      0|mm     | [28.09.2022 07:30.03.400] [INFO]  
      0|mm     | Checking git for module: MMM-Touch
      0|mm     | [28.09.2022 07:30.03.432] [INFO]  
      0|mm     | Checking git for module: default
      0|mm     | [28.09.2022 07:30.03.760] [INFO]  
      0|mm     | Newsfeed-Fetcher: Broadcasting 38 items.
      0|mm     | [28.09.2022 07:30.08.243] [INFO]  
      0|mm     | Calendar-Fetcher: Broadcasting 365 events.
      
      

      However, when MM renders the module just says “No Upcoming Events”.

      is there anything that I seem to be missing or something I can try? I can get the calendar to load with MMM-GoogleCalendar, but that module doesn’t broadcast past events so it makes MMM-CalendarExt3 pointless…which is why I was trying to use the default calendar module instead.

      posted in Troubleshooting
      C
      CurlyQ12391
    • RE: IR Frame not responding while using MM

      @sdetweil, I was able to find some older posts to enable the mouse so thats functioning at least 🙂

      I just find it so odd that MM responded to the IR Frame before re-doing everything and now it doesn’t want to cooperate.

      Do you think that MMM-Touch or MMM-touchgestures could integrate the IR Frame into MM?

      posted in Troubleshooting
      C
      CurlyQ12391
    • IR Frame not responding while using MM

      Hello!

      I am running MM on a Roku TV with a pretty basic IR Frame that is very much “plug and play”. I initially had no problem with it responding while MM was running but after having to re-flash rasbian and re-configure MM it doesn’t seem to work.

      The screen DOES respond to touch from the main Pi screen, so I know that it is functional. It just doesn’t respond when MM runs.

      Does anyone know if there is something I should be adding to the MM config or somewhere else to enable the functionality? I don’t remember having to do this previously, but I may have do so and just not remembered.

      Your suggestions/help is much appreciated.

      posted in Troubleshooting
      C
      CurlyQ12391
    • RE: Requesting assistance with GroceryApp module

      @sdetweil my apologies.

      The code within the node_helper is mostly from the Kroger Developer documentation. However, I am very new to all this and there is a very good chance that I transferred the documentation over incorrectly or in a way that wont work. I may have incorrectly assumed that by using the Kroger Docs/code it would result in getting similar data to what I’d see upon logging into the mobile/desktop site.

      posted in Development
      C
      CurlyQ12391
    • RE: Requesting assistance with GroceryApp module

      @sdetweil, firstly I’d like to apologize for the gap in my response! I broke my main config shortly after posting this and ended up having to re-flashing my SD card and rebuilding my mirror back up the way I had it from scratch.

      I really appreciate you taking the time to answer my question.

      My intent with this module was to basically house my grocery cart, similar to the interface I have on my phone or visiting the website. I think that an easier approach might be to use an iFrame module for the website, but I was really wanting to utilize the authorization token process to prevent having to login each time - since the end goal is to have the Mirror up on the wall without a keyboard/mouse.

      posted in Development
      C
      CurlyQ12391
    • Requesting assistance with GroceryApp module

      Hello!

      I am still pretty new to MagicMirror and coding, but decided it’d be worth it to attempt to build a custom module since I couldn’t find exactly what I was looking for elsewhere. Which brings me to MMM-GroceryApp; which has been built (to the best of my ability) using Kroger Developer documentation.

      I am at the point where I have the main module config.js, node_helper_js, authorize,js, and the CSS file functioning in a way that doesn’t break the MagicMirror. Unfortunately, thats all that is happening - I can’t see this module at all when MagicMirror runs, the location I put it remains blank. So obviously I am missing something, and because of that I can’t login to authorize the application.

      I changed my repository to public so the code can be viewed there, but I will also post the main and node_helper code below. My MagicMirror config.js for this module is pretty basic:

      {
        module: "MMM-GroceryApp",
        position: "bottom_right" 
      },
      

      NOTE: The app is set to be on the bottom_right of my 3rd page.

      MMM-Kroger.js

      Module.register("MMM-GroceryApp", {
      	defaults: {
      		refreshInterval: 1000 * 60 * 5, // refresh every 5 minutes
      		updateInterval: 1000 * 60 * 5 // update every 5 minutes
      	},
      
      	requiresVersion: "2.1.0", // Required version of MagicMirror
      
      	start: function() {
      		var self = this;
      		Log.info("Starting module: " + this.name);
      
      		//Flag for check if module is loaded
      		this.loaded = false;
      
      		this.sendSocketNotification("CONFIG", this.config);
      	},
      
      	getStyles: function () {
      		return [
      			"MMM-GroceryApp.css"
      		];
      	},
      
      	getScripts: function () {
      		return [
      			"moment.js"
      		];
      	},
      
        getStats: function () {
          this.sendSocketNotification("UPDATE", this.config);
        },
      
      	processData: function(data) {
      		var self = this;
      		this.dataRequest = data;
      		if (this.loaded === false) { self.updateDom(self.config.animationSpeed) ; }
      		this.loaded = true;
      
      		// the data if load
      		// send notification to node_helper.js
      		this.sendSocketNotification("MMM-GroceryApp-NOTIFICATION_TEST", data);
      	},
      
      	// socketNotificationReceived from node_helper.js
       	socketNotificationReceived: function(notification, payload) {
      		 console.log("socketNotificationReceived");
      		if (notification === "STARTED") {
      			this.updateDom();
      		}
      		else if (notification === "CART_DATA") {
      			this.loaded = true;
      			this.processChargeData(JSON.parse(payload).response);
      			this.updateDom();
      		}
      		else if (notification === "PRODUCT_SEARCH") {
      			this.loaded = true;
      			this.processDrivestateData(JSON.parse(payload).response);
      			this.updateDom();
      		}
      		else if (notification === "PRODUCT_DETAILS") {
      			this.loaded = true;
      			this.processVehicleData(JSON.parse(payload).response);
      			this.updateDom();
      		}
      		else if (notification === "LOCATION_DATA") {
      			this.loaded = true;
      			this.processVehicleData(JSON.parse(payload).response);
      			this.updateDom();
      		}
      	},
      
      	getDom: function() {
      		// create element wrapper for show into the module
      		var self = this;
      
      		// create element wrapper for show into the module
      		var wrapper = document.createElement("div");
      		wrapper.style.cssText = "float: right;";
      
      		// Data from helper
      		if (this.dataNotification) {
      			var wrapperDataNotification = document.createElement("div");
      			// translations  + datanotification
      			wrapperDataNotification.innerHTML =  this.translate("UPDATE") + ": " + this.dataNotification.date;
      
      			wrapper.appendChild(wrapperDataNotification);
      		}
      		return wrapper;
      }
      });
      

      node_helper.js

      const NodeHelper = require("node_helper");
      var request = require("request");
      
      module.exports = NodeHelper.create({
      	start() {
      		console.log("Starting node helper for: " + this.name);
      	},
      
      getToken(config) {
      	try {
      		const token = getTokenInternal(config);
      		return token;
          } catch (err) {
      		console.log(err);
      		return "abc";
      	}
      },
      
      getTokenInternal(config) {
      
      	// Set the configuration settings
      	const credentials = {
      		client: {
      			id: config.client_id,
      			secret: config.client_secret
      		},
      		auth: {
      			tokenHost: "https://api.kroger.com",
      			tokenPath: "/v1/connect/oauth2/token"
      		  },
      		  http: {
      			headers: { "User-Agent": "MMM-GroceryApp" }
      		}
      	};
      
      const oauth2 = require("Basic").create(credentials);
      
      	const tokenConfig = {
      		grant_type: config.client_credentials,
      		client_secret: config.client_secret,
      		client_id: config.client_id
      	};
      
      	try {
      		var tokenObject = oauth2.client_secret.getToken(tokenConfig);
      		return tokenObject.access_token;
      	} catch (error) {
      		console.log("Access Token Error", error.message);
      }
      },
      
      	
      getData: function() {
      		var self = this;
      
      function getCartData(token) {
      			request.get({
      				url: baseUrl + "/v1/cart/add",
      				headers: {
      					"Accept": "application/json",
      					"Authorization": "Bearer {{TOKEN}}"
      					  },
      				"processData": false,
      				"data": "{\n  \"items\": [\n     {\n       \"upc\": \"0001200016268\",\n       \"quantity\": \2\\n      }\n    ]\n }"
      				},
      			function (error, response) {
      				if (!error && response.statusCode == 400) {
      					self.sendSocketNotification("CART_DATA", response);
      				}
      			});
      		}
      		function getProductSearch(token) {
      			request.get({
      				url: baseUrl + "/v1/products?filter.brand={{BRAND}}&filter.term={{TERM}}&filter.locationId={{LOCATION_ID}}",
      				headers: {
      					"Accept": "application/json",
      					"Authorization": "Bearer {{TOKEN}}"
      					  },
      			function (error, response) {
      				if (!error && response.statusCode == 400) {
      					self.sendSocketNotification("PRODUCT_SEARCH", response);
      				}
      			}}
      		);
      	}
      		function getProductDetails(token) {
      			request.get({
      				url: baseUrl + "/v1/products/{{ID}}?filter.locationId={{LOCATION_ID}}",
      				headers: {
      					"Accept": "application/json",
      					"Authorization": "Bearer {{TOKEN}}"
      					  },
      			function (error, response) {
      				if (!error && response.statusCode == 400) {
      					self.sendSocketNotification("PRODUCT_DETAILS", response);
      				}
      			}}
      		);
      	}
      		function getLocationData(token) {
      			request.get({
      				url: baseUrl + "/v1/locations",
      				headers: {
      					"Accept": "application/json",
      					"Authorization": "Bearer {{TOKEN}}"
      					  },
      			function (error, response) {
      				if (!error && response.statusCode == 400) {
      					self.sendSocketNotification("LOCATION_DATA", response);
      				}
      			}}
      	);
      	}
      	if (accessToken === null ) {
      			var tempToken = getToken(this.config);
      			var localToken = tempToken.then(function(accessToken){
      				return accessToken;
      			});
      
      			localToken.then(function(token) {
      				accessToken = token;
      				getCartData(token);
      				getProductSearch(token);
      				getProductDetails(token);
      				getLocationData(token);
      		});
      	}
      		else {
      			getCartData(accessToken);
      			getProductSearch(accessToken);
      			getProductDetails(accessToken);
      			getLocationData(token);
      	}
      	},
      
      		socketNotificationReceived: function(notification, payload) {
      		if (notification === "MMM-GroceryApp") {
      			this.sendSocketNotification("MMM-GroceryApp");
      			self.config = payload;
      			self.sendSocketNotification("STARTED", true);
      			self.getData();
      			self.started = true;
      		} else if (notification == "CONFIG") {
      			self.sendSocketNotification("CART_DATA", self.cart_data);
      			self.sendSocketNotification("PRODUCT_SEARCH", self.product_search);
      			self.sendSocketNotification("PRODUCT_DETAILS", self.product_details);
      			self.sendSocketNotification("LOCATION_DATA", self.location_data);
      	    }
      	}
      });
      

      I really appreciate any assistance and/or tips you are able to provide 🙂

      posted in Development
      C
      CurlyQ12391
    • 1 / 1