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

    martinkooij

    @martinkooij

    7
    Reputation
    703
    Profile views
    17
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online
    Location The Netherlands

    martinkooij Unfollow Follow

    Best posts made by martinkooij

    • MMM-Parcel

      Description

      Hi all,

      I just wanted to glance over my mirror and track incoming parcels, as me and my family start to be rather heavy users of Internet buying. Well heavy… but still a few parcels per week. I thought it would be nice to show the overall status on the mirror.

      The MMM-AfterShip module by @Mykle1 wich used the aftership interface inspired me to reuse that interface for parcel trackings but I needed a more compact display. So I changed the output design to a visual design with less details and more visual color and icon cues for shipment status.

      Alas the Dutch PostNL nor DHL provide free API’s to receiving users, but both couriers (and +400 more) are available via Aftership. ’

      The Mirror module shows the parcels that you enter via your aftership account. Aftership offers a free account with free API use when you stay under 100 parcels per month via their website aftership.com.

      Screenshots

      There are three presentations modes ranging from moderately compact (max three lines per parcel) to compact (max two lines per parcel) to very compact (one-liner per parcel), which can be set in config. Just as languages and colors.

      Examples:

      alt text

      alt text

      alt text

      Download

      [card:martinkooij/MMM-Parcel]

      posted in Utilities
      M
      martinkooij
    • RE: Electron CPU usage

      @mattn and others.
      I have a stable situation with the following:

      • electron 1.4.15 (withELECTRON_FORCE_WINDOW_MENU_BAR=1).
        higher elektron version gives black screen, the environment variable lowers the cpu-usage by elektron considerably).
      • Magic Mirror 2.3.1 (actually I was quick to install MM2.3.0 but manually downgraded electron, but I am quite sure that amounts to the same as installing MM 2.3.1).
      • nodejs version v9.11.1. (I used to have a 1.6.x nodejs, but that one caused memory leaks. )

      Is now running in this configuration almost 7 days without interrupt. And no signs of stopping soon. Thanks you all in this forum for the help.

      (Rasberry pi 3, Jessie, CPU Hardware: BCM2835, Revision: a02082)

      posted in Troubleshooting
      M
      martinkooij
    • RE: MMM-Parcel

      yes, would be possible, I think. Good idea,!

      I’ll look into a compact “3”. If we exchange mailadresses can you send me a picture of your mirror, so I can understand a little bit better what you mean… Because compactness 2 should already show a 1 liner…

      cheers, martin

      posted in Utilities
      M
      martinkooij
    • RE: MMM-Parcel

      @goprojojo Thanks! But also thanks to Aftership.com for providing the API.

      The parcel names (titles in aftership-speak) are customizable via the aftership app, or via the aftership.com website (login -> trackings). Just select the shipment, click edit and enter your own title in the title field. This name will then appear on the mirror-screen. Let me know if that helps and answers your question.

      posted in Utilities
      M
      martinkooij
    • RE: MMM-Parcel Tracker renewed

      @martinkooij I now (feb 2021) updated again to multi-API support (from version 3.0.0).

      Aftership has (slightly) improved their commercial offerings.

      iIn the MMM-Parcel config you can now easily choose between Tracktry.com (fully free) or AfterShip.com (free for legacy users, or >9$/month paid plans for new users). Screen display still works the same, except for the somewhat less detailed information that you will receive from the tracktry.com API there is no difference in the way the parcels are displayed.

      posted in Utilities
      M
      martinkooij

    Latest posts made by martinkooij

    • RE: MMM-Parcel Tracker renewed

      @martinkooij I now (feb 2021) updated again to multi-API support (from version 3.0.0).

      Aftership has (slightly) improved their commercial offerings.

      iIn the MMM-Parcel config you can now easily choose between Tracktry.com (fully free) or AfterShip.com (free for legacy users, or >9$/month paid plans for new users). Screen display still works the same, except for the somewhat less detailed information that you will receive from the tracktry.com API there is no difference in the way the parcels are displayed.

      posted in Utilities
      M
      martinkooij
    • MMM-Parcel Tracker renewed

      I finally got to it. For the moment I salvaged the MMM-Parcel from the great aftership API, that alas now only is offered from the $199,-/month plan onwards. It now uses another parcel tracking integrator, with some less detailed information, but functionally the same. Hopefully they don’t follow suit with their offerings and they keep it offering for free. So if you want the status of your parcels on your mirror, MMM-Parcel is the way to go (shameless self-plug!). Let me know what you think.

      (https://github.com/martinkooij/MMM-Parcel)

      posted in Utilities tracking utility
      M
      martinkooij
    • RE: Electron CPU usage

      @mattn and others.
      I have a stable situation with the following:

      • electron 1.4.15 (withELECTRON_FORCE_WINDOW_MENU_BAR=1).
        higher elektron version gives black screen, the environment variable lowers the cpu-usage by elektron considerably).
      • Magic Mirror 2.3.1 (actually I was quick to install MM2.3.0 but manually downgraded electron, but I am quite sure that amounts to the same as installing MM 2.3.1).
      • nodejs version v9.11.1. (I used to have a 1.6.x nodejs, but that one caused memory leaks. )

      Is now running in this configuration almost 7 days without interrupt. And no signs of stopping soon. Thanks you all in this forum for the help.

      (Rasberry pi 3, Jessie, CPU Hardware: BCM2835, Revision: a02082)

      posted in Troubleshooting
      M
      martinkooij
    • RE: Electron CPU usage

      @mattn thanks! I love my modules, so difficult to lose one ;).

      It however seems you have a slow leak too, growing memory usage of ca 200Mbyte in 6 days. Much less than me, but still more than it should be, I guess. Just let us know how you fare! Thanks for sharing.

      posted in Troubleshooting
      M
      martinkooij
    • RE: Electron CPU usage

      @mattn What version of electron are you running? I downgraded to 1.4.15 electron, have v6.12.3 nodejs and 2.3.1Magic Mirror. I set the environment variable as you indicated. CPU usage goes down remarkably, although not as much as in your case.

      Did you also got rid of a memory leak? I start with 43% free and this falls to 7% after a day. Stays between 5%-7% for a few days and then after 3-5 days my mirror halts completely with E_NOMEM panic in the log files. Any reader knows of handy memory leak analysistools for nodejs? It seems you keep on having 50% used / 50% free… Not me ;(.

      top - 20:03:02 up 21:14,  3 users,  load average: 0,30, 0,33, 0,41
      Tasks: 165 total,   2 running, 163 sleeping,   0 stopped,   0 zombie
      %Cpu(s):  8,6 us,  4,5 sy,  0,0 ni, 86,9 id,  0,0 wa,  0,0 hi,  0,0 si,  0,0 st
      KiB Mem:    949580 total,   907688 used,    41892 free,    60200 buffers
      KiB Swap:   102396 total,     5172 used,    97224 free.   444532 cached Mem
      
        PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
       1178 pi        20   0  828888 244624  65840 R  22,5 25,8 327:41.98 electron
       1216 pi        20   0  603272 349144 290184 S  13,6 36,8 132:11.73 electron
        666 root      20   0  200848  58756  28796 S  12,2  6,2 131:39.07 Xorg
      24453 pi        20   0    5224   2580   2148 R   1,0  0,3   0:02.03 top
      
      posted in Troubleshooting
      M
      martinkooij
    • RE: MMM-Parcel

      @twosquirrels Hi. I am sorry it doesn’t work for you. I must have missed a date format from aftership I think, because on my parcels upto now it works like a charm. If you can help me debug, can you please send me (via my personal mail, I sent you a PM) the console output after putting debug: true in the module config. This spits out a lot of info into the console output / log files.

      posted in Utilities
      M
      martinkooij
    • RE: MMM-Parcel

      @twosquirrels Basically the most radical way is to remove everything MMM-Parcel from both …/config and from …/modules and make a clean install with clone. I sent you a PM, let me know if it works for you.

      posted in Utilities
      M
      martinkooij
    • RE: MMM-Parcel

      To the users: thanks for your compliments. Your comments inspire me to add new functionality. Today (2018-03-30): a layout that caters for narrow spaces on the mirror and the possibility to automatically hide delivered packages after a configurable number of days. Have fun and keep on commenting!

      posted in Utilities
      M
      martinkooij
    • RE: Turning monitor on/off when not in use.

      @wi_brewer Hi I have a dual approach.( FYI my mirror turns the monitor off with the command vcgencmd display_power 0 (raspberry pi 3, Philips monitor on HDMI). and on again with vcgencmd display_power 1. Your mileage may vary. )

      In crontab I put my mirror off during the night and on again in the morning. My /etc/crontab has added the following:

      # m h dom mon dow user	command
      30 0	* * *    root	mmscreenoff
      00 6	* * *    root	mmscreenon
      

      The script mmscreenoff is a shell script that I put in the standard path that does the following:

      touch /var/lock/displayscreenoff.lck
      vcgencmd display_power 0 >/dev/null
      

      As you can see it turns off the screen and puts a lock file, so other programs will know that the screen really need to be turned off, whetever else.
      The mmscreenon script does the opposite.

      rm -f /var/lock/displayscreenoff.lck
      vcgencmd display_power 1 >/dev/null
      

      So… These are the basics… The screen goes off every night.

      Now I want during the day also to see if me, my wife or my son is at home. For this I adapted the script from https://github.com/RpDp-git/PiDisplaySleep (thanks!). I have my router assign IP …100,…101 and …102 to the three phones of myself, my wife and my son. The script is modified to first check if there is a lockfile, in that case it waits but does nothing useful. If there is no lockfile it will scan the network.

      from os import popen,system,path
      from time import sleep
      
      state=3 #State of the display 1 On 0 Off, 3 = unknown
      
      ip="192.168.2.100-102" #Enter the IP address of the device that should keep the display awake
      
      while True:
          if not path.exists('/var/lock/displayscreenoff.lck') :
              nmap_out=str(popen('nmap -sP '+ip).read()) #nmap command to scan on the given IP address
              if nmap_out.find('latency') == -1:  #looks for the word "latency" in the output
                  if state==0 :                   #this nested if makes sure that commands are not repeated
                     pass
                  else :
                     system('vcgencmd display_power 0')  #Bash command that turns off the display
                     state=0                             #Updating the display state variable
      
              elif nmap_out.find('latency') > 1:
                  if state==1:
                     pass
                  else :
                     system('vcgencmd display_power 1') #Bash command to turn on the display
                     state=1
                     sleep(900) #keep on for at least 15 minutes
      
          sleep(10) #Scan rate in seconds
      

      I run this script via pm2 start mmdaysleep.py or any other way you want to keep the script running. If nmap isn’t installed at your system you should install it via sudo apt-get install nmap.

      For the purists: it has grown this way, with the crontab job first and the python script later. Variations of the python scripts being stopped and started by crontab and/or having system timing considerations in the python script are also possible and maybe more logical. I just happen to like the relative simplicity and modularity of this solution.

      Hope this helps.
      Martin

      posted in Troubleshooting
      M
      martinkooij
    • RE: MMM-Parcel

      @twosquirrels Thank you for liking the module, and this clearly seems a bug that I haven’t seen yet, and can’t reproduce at home here. Sorry. I have dropped you a PM with my contact info, if you would be willing to help me debugging your situation.

      posted in Utilities
      M
      martinkooij