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

MMM-iCloud-Client

Scheduled Pinned Locked Moved Troubleshooting
11 Posts 7 Posters 7.3k Views 8 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.
  • S Offline
    strawberry 3.141 Project Sponsor Module Developer @lolobyte
    last edited by Dec 20, 2016, 6:14 PM

    @lolobyte

    you get no error in the response of instance.contacts, but at the same time result.contacts is undefined. therefore it will be interesting what you getting as a result in the callback: try console.log(results); between line L134 and L135 in node_helper.js

    instance.contacts(function(err, results) {
        if (err) return console.log("failed to fetch contacts");
        console.log(results);
        results.contacts.forEach(function(contact) { //Line 135
            ....
    

    Please create a github issue if you need help, so I can keep track

    L 1 Reply Last reply Dec 21, 2016, 3:38 PM Reply Quote 0
    • L Offline
      lolobyte @strawberry 3.141
      last edited by Dec 21, 2016, 3:38 PM

      @strawberry-3.141 said in MMM-iCloud-Client:

      lts.contacts.forEach(function(contact) { //Line 135

      ok, now tis is my new node_helper.js in the module folder from MMM-iCloud-Client

      instance.login(this.config.username, this.config.password, function(err) {
      if (err) return console.log(“login failed”);
      instance.contacts(function(err, results) {
      if (err) return console.log(“failed to fetch contacts”);
      console.log(results);
      results.contacts.forEach(function(contact) {
      contactDB.update({“contactId”: contact.contactId}, contact, {upsert: true});

      and the log result ist this:

      0|mm | Whoops! There was an uncaught exception…
      0|mm | TypeError: Cannot read property ‘forEach’ of undefined
      0|mm | at Class. (/home/pi/MagicMirror/modules/MMM-iCloud-Client/node_helper.js:136:22)
      0|mm | at Request._callback (/home/pi/MagicMirror/modules/MMM-iCloud-Client/node_modules/icloud/index.js:117:13)
      0|mm | at Request.self.callback (/home/pi/MagicMirror/modules/MMM-iCloud-Client/node_modules/request/request.js:186:22)
      0|mm | at emitTwo (events.js:106:13)
      0|mm | at Request.emit (events.js:191:7)
      0|mm | at Request. (/home/pi/MagicMirror/modules/MMM-iCloud-Client/node_modules/request/request.js:1081:10)
      0|mm | at emitOne (events.js:96:13)
      0|mm | at Request.emit (events.js:188:7)
      0|mm | at IncomingMessage. (/home/pi/MagicMirror/modules/MMM-iCloud-Client/node_modules/request/request.js:1001:12)
      0|mm | at IncomingMessage.g (events.js:286:16)
      0|mm | MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?

      S 1 Reply Last reply Dec 21, 2016, 5:33 PM Reply Quote 0
      • S Offline
        strawberry 3.141 Project Sponsor Module Developer @lolobyte
        last edited by strawberry 3.141 Dec 21, 2016, 5:34 PM Dec 21, 2016, 5:33 PM

        @lolobyte but the result is not logged in there, this is just the log of the exception which happens in the line after

        Please create a github issue if you need help, so I can keep track

        L 2 Replies Last reply Dec 21, 2016, 7:40 PM Reply Quote 0
        • L Offline
          lolobyte @strawberry 3.141
          last edited by Dec 21, 2016, 7:40 PM

          @strawberry-3.141

          Sorry, your first step was a little confuse for me.

          for you it’s maybe familiar what you can do with coding and so on, i’m very very newbie, my age is 46 and i’m new in this environment developing, coding and so on.

          Please give me than a step by step instruction about witch information u need.

          pi@raspi2-MM2:~/MagicMirror $ pm2 logs mm
          [TAILING] Tailing last 10 lines for [mm] process (change the value with --lines option)
          /home/pi/.pm2/logs/mm-error-0.log last 10 lines:
          0|mm | at Request._callback (/home/pi/MagicMirror/modules/MMM-iCloud-Client/node_modules/icloud/index.js:117:13)
          0|mm | at Request.self.callback (/home/pi/MagicMirror/modules/MMM-iCloud-Client/node_modules/request/request.js:186:22)
          0|mm | at emitTwo (events.js:106:13)
          0|mm | at Request.emit (events.js:191:7)
          0|mm | at Request. (/home/pi/MagicMirror/modules/MMM-iCloud-Client/node_modules/request/request.js:1081:10)
          0|mm | at emitOne (events.js:96:13)
          0|mm | at Request.emit (events.js:188:7)
          0|mm | at IncomingMessage. (/home/pi/MagicMirror/modules/MMM-iCloud-Client/node_modules/request/request.js:1001:12)
          0|mm | at IncomingMessage.g (events.js:286:16)
          0|mm | (node:11184) DeprecationWarning: sys is deprecated. Use util instead.

          /home/pi/.pm2/logs/mm-out-0.log last 10 lines:

          That’s the first log message of my mm2

          1 Reply Last reply Reply Quote 0
          • L Offline
            lolobyte @strawberry 3.141
            last edited by Dec 21, 2016, 7:43 PM

            @strawberry-3.141

            what u mean with in the line after?

            1 Reply Last reply Reply Quote 0
            • B Offline
              Beh @Kai-Christoph
              last edited by Oct 21, 2017, 3:44 PM

              @Kai-Christoph

              You can use vdirsyncer to sync a private iCloud calendar with your mirror.

              I wrote a walkthrough here:

              https://forum.magicmirror.builders/topic/5327/sync-private-icloud-calendar-with-magicmirror

              1 Reply Last reply Reply Quote 0
              • F Offline
                Feedy88
                last edited by Jul 23, 2020, 12:31 PM

                Digging out this old topic. I successfully could sync my private calendar with vdirsyncer to my Mirror. What I would like to add are the birthdays of my contacts. The issue with this one is, that they are not an acutal calendar.

                I tried with another device specific password to bypass the two-factor authentification which I was assuming is the issue here but no success.

                I would even be fine in manually downloading an .ics with the Birthdays but have no idea how to extract them from the contacts. Does anyone have been successful?

                T 1 Reply Last reply Jun 8, 2022, 12:34 PM Reply Quote 0
                • T Offline
                  TazDev @Feedy88
                  last edited by Jun 8, 2022, 12:34 PM

                  @Feedy88 said in MMM-iCloud-Client:

                  Does anyone have been successful?

                  please upvote this: https://forum.magicmirror.builders/topic/16850/icloud-contacts-to-birthday-calendar-pyicloud-vcf-to-ics

                  i had success manually, it would be awesome to get this as working module

                  1 Reply Last reply Reply Quote 0
                  • 1
                  • 2
                  • 1 / 2
                  • 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