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

    Posts

    Recent Best Controversial
    • RE: MMM-GooglePhotos

      @Sean I appreciate you trying. I’ll see if I can figure out more detail. It’s weird because it’ll work fine sometimes for days and then all of a sudden I can’t get it to do more than 1 or 2 photos before it stops. Nothing else on the pi has that issue, newsfeeds still update, weather updates, CalendarExt2 updates.

      I’m going to circumvent the pihole I have set up and point to GoogleDNS and see if that helps.

      I wasn’t seeing anything from the MagicMirror in the query logs for the pihole which was in itself odd.

      posted in Entertainment
      G
      gonzonia
    • RE: MMM-GooglePhotos

      @Sean I’ve been looking into this, because I’m really don’t think it’s my network (no other module has this issue and there’s no similar problems anywhere else on the network). The first error doesn’t seem to be fatal, but the second is.

      These are the errors I’m seeing in my Out.log

      [2020-04-27 17:33:15.365] [LOG]    2020-04-27T17:33:15 <log> [GPHOTOS:CORE] Error: socket hang up (/home/pi/MagicMirror/modules/MMM-GooglePhotos/GPhotos.js:124 GPhotos.log)
      

      and

      [2020-04-27 18:51:15.155] [LOG]    2020-04-27T18:51:15 <log> [GPHOTOS:CORE] Error: Client network socket disconnected before secure TLS connectionwas established (/home/pi/MagicMirror/modules/MMM-GooglePhotos/GPhotos.js:124 GPhotos.log)
      
      

      I came across this issue on gitub related to Google APIs. https://github.com/googleapis/nodejs-bigquery/issues/624
      Not sure it’s related.

      In Error.log I see

      2020-04-27 17:33:15.356] [ERROR]  2020-04-27T17:33:15 <error> Error: socket hang up
          at connResetException (internal/errors.js:559:14)
          at TLSSocket.socketOnEnd (_http_client.js:436:23)
          at TLSSocket.emit (events.js:205:15)
          at endReadableNT (_stream_readable.js:1154:12)
          at processTicksAndRejections (internal/process/task_queues.js:84:9) {
        code: 'ECONNRESET'
      } (/home/pi/MagicMirror/js/app.js:40 process.<anonymous>)
      [2020-04-27 17:33:15.361] [ERROR]  2020-04-27T17:33:15 <error> Error: socket hang up
          at connResetException (internal/errors.js:559:14)
          at TLSSocket.socketOnEnd (_http_client.js:436:23)
          at TLSSocket.emit (events.js:205:15)
          at endReadableNT (_stream_readable.js:1154:12)
          at processTicksAndRejections (internal/process/task_queues.js:84:9) {
        code: 'ECONNRESET'
      } (/home/pi/MagicMirror/js/app.js:40 process.<anonymous>)
      [2020-04-27 17:33:15.367] [ERROR]  2020-04-27T17:33:15 <error> (node:17589) UnhandledPromiseRejectionWarning: Error: socket hang up
          at connResetException (internal/errors.js:559:14)
          at TLSSocket.socketOnEnd (_http_client.js:436:23)
          at TLSSocket.emit (events.js:205:15)
          at endReadableNT (_stream_readable.js:1154:12)
          at processTicksAndRejections (internal/process/task_queues.js:84:9) (/home/pi/MagicMirror/internal/process/warning.js:27 writeOut)
      [2020-04-27 17:33:15.368] [ERROR]  2020-04-27T17:33:15 <error> (node:17589) UnhandledPromiseRejectionWarning: Error: socket hang up
          at connResetException (internal/errors.js:559:14)
          at TLSSocket.socketOnEnd (_http_client.js:436:23)
          at TLSSocket.emit (events.js:205:15)
          at endReadableNT (_stream_readable.js:1154:12)
          at processTicksAndRejections (internal/process/task_queues.js:84:9) (/home/pi/MagicMirror/internal/process/warning.js:27 writeOut)
      [2020-04-27 17:33:15.369] [ERROR]  2020-04-27T17:33:15 <error> (node:17589) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2) (/home/pi/MagicMirror/internal/process/warning.js:27 writeOut)
      [2020-04-27 17:33:15.369] [ERROR]  2020-04-27T17:33:15 <error> (node:17589) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2) (/home/pi/MagicMirror/internal/process/warning.js:27 writeOut)
      [2020-04-27 17:33:15.370] [ERROR]  2020-04-27T17:33:15 <error> (node:17589) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. (/home/pi/MagicMirror/internal/process/warning.js:27 writeOut)
      [2020-04-27 17:33:15.371] [ERROR]  2020-04-27T17:33:15 <error> (node:17589) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. (/home/pi/MagicMirror/internal/process/warning.js:27 writeOut)
      
      

      and

      [2020-04-27 18:51:15.161] [ERROR]  2020-04-27T18:51:15 <error> (node:17589) UnhandledPromiseRejectionWarning: Error: Client network socket disconnected before secure TLS connection was established
          at connResetException (internal/errors.js:559:14)
          at TLSSocket.onConnectEnd (_tls_wrap.js:1355:19)
          at Object.onceWrapper (events.js:288:20)
          at TLSSocket.emit (events.js:205:15)
          at endReadableNT (_stream_readable.js:1154:12)
          at processTicksAndRejections (internal/process/task_queues.js:84:9) (/home/pi/MagicMirror/internal/process/warning.js:27 writeOut)
      [2020-04-27 18:51:15.164] [ERROR]  2020-04-27T18:51:15 <error> (node:17589) UnhandledPromiseRejectionWarning: Error: Client network socket disconnected before secure TLS connection was established
          at connResetException (internal/errors.js:559:14)
          at TLSSocket.onConnectEnd (_tls_wrap.js:1355:19)
          at Object.onceWrapper (events.js:288:20)
          at TLSSocket.emit (events.js:205:15)
          at endReadableNT (_stream_readable.js:1154:12)
          at processTicksAndRejections (internal/process/task_queues.js:84:9) (/home/pi/MagicMirror/internal/process/warning.js:27 writeOut)
      [2020-04-27 18:51:15.166] [ERROR]  2020-04-27T18:51:15 <error> (node:17589) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4) (/home/pi/MagicMirror/internal/process/warning.js:27 writeOut)
      [2020-04-27 18:51:15.168] [ERROR]  2020-04-27T18:51:15 <error> (node:17589) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4) (/home/pi/MagicMirror/internal/process/warning.js:27 writeOut)
      
      posted in Entertainment
      G
      gonzonia
    • RE: MMM-GooglePhotos

      @Sean Thanks. I think if you can gracefully handle the bad connection (no matter where it’s from) and reconnect once the connection works again, the image being stuck won’t be an issue. Right now once the connection breaks the module can’t recover.

      posted in Entertainment
      G
      gonzonia
    • RE: MMM-GooglePhotos

      @Sean I’m thinking it might be something on Google’s end. I’m having the same issue.

      [2020-04-23 18:54:25.134] [LOG] 2020-04-23T18:54:25 [GPHOTOS:CORE] Error: Client network socket disconnected before secure TLS connection was established (/home/pi/MagicMirror/modules/MMM-GooglePhotos/GPhotos.js:124 GPhotos.log)

      Is it possible to handle this error at all? Everything works fine for hours, then this error. Then it never recovers to try again but just stays on the last photo displayed.

      posted in Entertainment
      G
      gonzonia
    • RE: MMM-GooglePhotos

      @Sean Thanks. I think I have it working. Here’s what I used.

      autoInfoPosition: (album, photo)=> {
      					var boolRightLeft= Math.floor(Math.random() * 2);
      					if (boolRightLeft == 1) {
      						return ['none', '0', '0', 'none'] // This will show photo info bottom-left corner.
      					}else{
      						return ['none', 'none', '0', '0'] // This will show photo info bottom-right corner.
      					}
      			}
      	
      
      posted in Entertainment
      G
      gonzonia
    • RE: MMM-GooglePhotos

      @Sean Totally forgot the date formatting (took me a while to see the infobox and I’d forgotten that was in the config). Thanks for pointing that out.

      With the location of the infobox though I’d still like it to move around to prevent burn-in. If I set the position in CSS it’s static. That’s why I was looking at trying a different way. Can I use the callbackfunction to set multiple locations? I’d like it to go back and forth between bottom left and right. I tried modifying the Tip code you had so that the CSS would do that, but it doesn’t seem to be working. I can tweak JS a lot better than I can tweak CSS.

      posted in Entertainment
      G
      gonzonia
    • RE: MMM-GooglePhotos

      @Sean thanks. Will do.

      posted in Entertainment
      G
      gonzonia
    • RE: MMM-GooglePhotos

      I’m loving the Info Box addition now that it shows. I’ve hid the album cover and title because I’m not that organized.

      I like how autoInfoPosition allows it to move around to prevent burn-in.

      2 requests-

      1. A way to select which corners it shows in.
        I have other modules in top left and right that overlap with the info box. It would work better if it would just go back and forth on the bottom left and right.
        I don’t think it would be hard to implement, (but I’m not a JS expert). I think if you changed the autoInfoPosition property to be a list (top left, top right, bottom left, bottom right) instead of a boolean and then based on the list you could populate the array with the necessary locations.

      2. A way to control the format of the date (X years ago). I’d prefer to see the actual date of the photo.

      Sorry if I’m out of line. This is one of the favorite modules in my house.

      Thanks.

      posted in Entertainment
      G
      gonzonia
    • RE: MMM-GooglePhotos

      @Sean Any idea what’s going on with the info box?
      Just a note. I added

      #GPHOTO_INFO {
      margin:100px;
      }
      

      And the box shows now. The autoInfoPosition seems to be working now too. Don’t know what happened when I first tried it.
      Thanks.

      posted in Entertainment
      G
      gonzonia
    • RE: MMM-GooglePhotos

      @Sean Any idea what’s going on with the info box?

      posted in Entertainment
      G
      gonzonia
    • RE: MMM-GooglePhotos

      @Sean I commented out autoInfoPosition because it seemed to break when I turned that on. The showWidth/showHeight match the screen resolution showing on the dekstop.

      	{
        			module: "MMM-GooglePhotos",
      			position: "fullscreen_below",
      		  	config: {
      			albums: ["NixPlay","MM-Family2"], // Set your album name. like ["My wedding", "family share", "Travle to Paris"]
      			updateInterval: 1000 * 60, // minimum 10 seconds.
      			sort: "random", // "old", "random"
      			uploadAlbum: null, // Only album created by `create_uploadable_album.js`.
      			condition: {
      				fromDate: null, // Or "2018-03", RFC ... format available
      				toDate: null, // Or "2019-12-25",
      				minWidth: null, // Or 400
      				maxWidth: null, // Or 8000
      				minHeight: null, // Or 400
      				maxHeight: null, // Or 8000
      				minWHRatio: null,
      				maxWHRatio: null,
      				// WHRatio = Width/Height ratio ( ==1 : Squared Photo,   < 1 : Portraited Photo, > 1 : Landscaped Photo)
      			},
      			showWidth: 1680, // These values will be used for quality of downloaded photos to show. real size to show in your MagicMirror region is recommended.
      			showHeight: 1050,
      			timeFormat: "relative", //"YYYY/MM/DD HH:mm", // Or `relative` can be used.
      			//autoInfoPosition: true,
        		}
      	},
      
      
      posted in Entertainment
      G
      gonzonia
    • RE: MMM-GooglePhotos

      The new info box is not aligning correctly for me. It’s showing mostly off the screen.
      Screenshot

      posted in Entertainment
      G
      gonzonia
    • RE: MMM-GooglePhotos

      @Sean Awesome work! Loving the update!

      posted in Entertainment
      G
      gonzonia
    • RE: new update/upgrade script, ready for testing

      @sdetweil Thanks! I thought I’d tried that as well. Guess not. All good now!

      posted in General Discussion
      G
      gonzonia
    • RE: new update/upgrade script, ready for testing

      Test runs fine…This is the result when I try to apply the log will be ```
      code_text

      No LSB modules are available.
      doing test run = false
      update log will be in /home/pi/MagicMirror/installers/upgrade.log
      
      saving custom.css
      upgrading from version 2.9.0 to 2.10.0
      fetching latest revisions
      there were merge errors
      error: The following untracked working tree files would be overwritten by merge: 	installers/dumpactivemodules.js Please move or remove them before you merge. Aborting Updating 500147e..b595cdd
      you should examine and resolve them
      using the command git log --oneline --decorate
      500147e (grafted, HEAD -> master, tag: v2.9.0) Merge pull request #1776 from MichMich/develop
      restoring custom.css
      posted in General Discussion
      G
      gonzonia
    • RE: MMM-MealViewer

      Well, thanks to both of you! I can confirm it is finally working.

      Now to update github. Someday I should write some documentation too.

      posted in Development
      G
      gonzonia
    • RE: MMM-MealViewer

      @cowboysdude Thanks! I might switch to that. I’ve had to rework it a little because the URL wasn’t getting set except at the first call. I just moved setup for that into the getMenuData and I think it’s all working now. I’ll give it a day to run and see what happens tomorrow before I try messing with it again and update the file on github.

      -updated to fix grammar

      posted in Development
      G
      gonzonia
    • RE: MMM-MealViewer

      @sdetweil Thanks! I’ll make the change and see what happens when it should update mid-day tomorrow.

      posted in Development
      G
      gonzonia
    • RE: MMM-MealViewer

      Okay. I’ve identified the problem. In the code below, everything gets setup in the “start” function. Then it calls getMenuData. That function ends by setting up a timer to call itself but isn’t supplying the object necessary. This means it won’t work. If I add the _this object to pass it causes all sorts of problems.
      I’m not a js expert. I’m sure a way to re-factor this will eventually occur to me, but right now I’m just not seeing it.

      start:  function() {
          Log.log('Starting module: ' + this.name);
      
          // Set up the local values
          var today = moment();
          this.loaded = false;
          this.urls = [];
          this.results = [];
      
          // Uses now are today if before noon and tomorrow as today if after noon
          if (today.hour() >= 12) {
            var todayFormatted = today.add(1, 'day').format('MM-DD-YYYY');
          }
          else {
            var todayFormatted = today.format('MM-DD-YYYY');
          }
      
          // Currently set to only pull one day's data so endDayFormatted = todayFormatted
          //var endDay = today.add(config.showDays, 'days');
          //var endDayFormatted = endDay.format('MM-DD-YYYY');
          var endDayFormatted = todayFormatted;
      
          // Construct the url array for the schools
          for (var i in this.config.schools) {
      			this.urls.push({school: this.config.schools[i], url: 'https://api.mealviewer.com/api/v4/school/' + this.config.schools[i] + '/' + todayFormatted + '/' + endDayFormatted + '/'});
          }
      
          // Trigger the first request
          this.getMenuData(this);
        },
      
        getMenuData: function(_this) {
          // Make the initial request to the helper then set up the timer to perform the updates
          _this.sendSocketNotification('GET-MENU-DATA', _this.urls);
          setTimeout(_this.getMenuData(), _this.config.interval, _this);
        },
      
      
      
      posted in Development
      G
      gonzonia
    • RE: MMM-MealViewer

      The module works great on the initial load. The problem is that it doesn’t seem to be updating. After 12pm it’s supposed to start showing the next days meals but doesn’t. Even the next day it doesn’t update. I’ll try to dig into the core aspects of developing a module and see if I can find out why, but if anyone with more experience has any ideas where I should start looking I’d appreciate it.

      posted in Development
      G
      gonzonia
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 6 / 7