MagicMirror Forum

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

    Topics created by stuartiannaylor

    • S

      UNSOLVED Mediapipe cam gesture control
      Requests • • stuartiannaylor

      1
      0
      Votes
      1
      Posts
      150
      Views

      S

      Just been reading about the Google mediapipe libs that supposedly provide reasonably lite gesture recognition and wondered if anybody has or is intending implementing a webcam method?

    • S

      zram-conf
      General Discussion • • stuartiannaylor

      3
      0
      Votes
      3
      Posts
      1026
      Views

      S

      Same in as they both use the same terrible outmoded methods that is essentially a copy of zram-conf-05.deb.

      Since kernel 3.15 zram has been multi-stream and partitioning by core just makes smaller swaps with smaller single page write ability for absolutely no reason.
      Also makes no check that any previous zram utils maybe in operation and overwrites.
      Ignores the important mem_limit property for sys_admins and completely ignores the hot_plug and remove methods.

      I have no idea why that bad script has been copied and emulated so much, but yeah the above are very much the same as zram-conf-05.deb.

      I suggest you have a look at https://github.com/StuartIanNaylor/zram-config as it combines many functions that are beneficial for MagicMirror and has a better implementation of zram for quite a few reasons.
      Uses /etc/ztab so if you wish you can set up as many zswaps, zdir and a zlog if you wish.
      Zlog creates a zram directory which is the upper in a OverlayFS file systems so only on write is a file copied up. It also uses the olddir directive of logrotate so oldlogs are shipped to persistent.
      Provides negligible flash wear and an extremely small Zram memory footprint.
      Zdir is the same as zlog without the logrotate directives where the MagicMirror directory is loaded via a OverlayFS mount with the upper mounted on zram.
      Due to the copyup of COW only files that are write accessed use upper so again the whole MagicMirror dir can be provided with zero SD writes in an extremely small memory footprint.
      You can make as many Zdir as you need.
      Zswap does actually use the kernel doc methods of hot_plug and hot_remove for zram devices and will work with other zram services.
      Also includes the important mem-Limit for sysadmin and Zswap is multi-stream and there is little point making swaps per core but you can make as many as you like.
      Linux swapiness and page-cache settings are also based the assumption of HDD like swap and zram is mem not disk so swapiness needs to be increased to 80-100 and page-cache set to 0 for single pages to help cut latency as the default of 3 = caches of 8 pages for disk based caching.
      None of the scripts ever seem to provide the tuneables to actually utilise zram performance and again you can set both in the ztab as you set up your swap.

      Hopefully the likes of the above will actually read the kernel docs for zram https://www.kernel.org/doc/Documentation/blockdev/zram.txt before they just copy and paste a bad Ubuntu script again.

      Not really sure how zram will in anyway give you smooth youtube/video playback though… ? But if its caching locally then yes.
      But yeah you can get near memcpy speed with compression rations of up 3:1 or even use deflate or ztstd which are slower and prob not for swap but for text such as logs or much of the data format that nodejs uses the compression can be much higher than the performance base of LZO/4.

      https://github.com/StuartIanNaylor/zram-config

      pi@raspberrypi:~ $ zramctl NAME ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT /dev/zram0 lz4 1.2G 4K 76B 4K 4 [SWAP] /dev/zram1 lz4 150M 16.3M 25.1K 208K 4 /opt/zram/zram1 /dev/zram2 lz4 60M 7.5M 1.2M 1.7M 4 /opt/zram/zram2 pi@raspberrypi:~ $ df Filesystem 1K-blocks Used Available Use% Mounted on /dev/root 14803620 2558152 11611220 19% / devtmpfs 470116 0 470116 0% /dev tmpfs 474724 223868 250856 48% /dev/shm tmpfs 474724 12284 462440 3% /run tmpfs 5120 4 5116 1% /run/lock tmpfs 474724 0 474724 0% /sys/fs/cgroup /dev/mmcblk0p1 44220 22390 21831 51% /boot /dev/zram1 132384 280 121352 1% /opt/zram/zram1 overlay1 132384 280 121352 1% /home/pi/MagicMirror /dev/zram2 55408 3460 47648 7% /opt/zram/zram2 overlay2 55408 3460 47648 7% /var/log tmpfs 94944 0 94944 0% /run/user/1000 cat /etc/ztab # swap alg mem_limit disk_size swap_priority page-cluster swappiness swap lz4 400M 1200M 75 0 90 # dir alg mem_limit disk_size target_dir bind_dir dir lz4 50M 150M /home/pi/MagicMirror /magicmirror.bind # log alg mem_limit disk_size target_dir bind_dir oldlog_dir log lz4 20M 60M /var/log /log.bind /oldlog pi@raspberrypi:~ $ free -h total used free shared buff/cache available Mem: 927M 206M 184M 233M 535M 434M Swap: 1.3G 0B 1.3G pi@raspberrypi:~ $ swapon NAME TYPE SIZE USED PRIO /dev/zram0 partition 1.2G 0B 75 /var/swap file 100M 0B -2 pi@raspberrypi:/opt/zram $ ls log.bind magicmirror.bind oldlog zram1 zram2 pi@raspberrypi:/opt/zram $ top top - 23:18:21 up 1:28, 2 users, load average: 0.31, 0.29, 0.29 Tasks: 114 total, 1 running, 68 sleeping, 0 stopped, 0 zombie %Cpu(s): 1.9 us, 0.1 sy, 0.0 ni, 98.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st KiB Mem : 949448 total, 153464 free, 223452 used, 572532 buff/cache KiB Swap: 1331192 total, 1331192 free, 0 used. 412052 avail Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1215 pi 20 0 600844 325968 287276 S 5.3 34.3 8:09.51 chromium-browse 2536 pi 20 0 8104 3204 2728 R 1.6 0.3 0:00.11 top 970 pi 20 0 775108 156128 112876 S 1.0 16.4 11:17.06 chromium-browse 1611 pi 20 0 11656 3772 3056 S 0.3 0.4 0:00.30 sshd 1 root 20 0 27072 5964 4824 S 0.0 0.6 0:02.51 systemd 2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd 4 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/0:0H 6 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 mm_percpu_wq 7 root 20 0 0 0 0 S 0.0 0.0 0:00.24 ksoftirqd/0 8 root 20 0 0 0 0 I 0.0 0.0 0:00.87 rcu_sched 9 root 20 0 0 0 0 I 0.0 0.0 0:00.00 rcu_bh
    • S

      UNSOLVED Current weather
      Troubleshooting • • stuartiannaylor

      2
      0
      Votes
      2
      Posts
      496
      Views

      S

      Its back must of wanted me to have a coffee?!

    • S

      Bullet Proof Mirror aka Watchdog
      General Discussion • • stuartiannaylor

      1
      0
      Votes
      1
      Posts
      360
      Views

      S

      #Bullet proof mirror and how to enable the pi watch dog.

      The pi has a watchdog timer circuit built into it that is a prety reasonable means of detecting crashes and forcing an automated reboot.

      So first we need to enable it.

      First enable watchdog from /boot/config.txt, adding the following line:

      dtparam=watchdog=on # Then install watchdog service: sudo apt install watchdog #Uncomment the following line from /etc/watchdog.conf # Uncomment to enable test. Setting one of these values to '0' disables it. # These values will hopefully never reboot your machine during normal use # (if your machine is really hung, the loadavg will go much higher than 25) max-load-1 = 24 max-load-5 = 18 max-load-15 = 12 # ... watchdog-device = /dev/watchdog

      So basically constant loads and watchdog will kick in not sure what the time base is think its seconds but the above does the job. Then do a reboot and we can check its running by searching the syslog in /var/log for ‘watchdog’ But how do we know its working? We can test with a fork bomb and overload the Pi. If you have done an OC (Over Clock) on your pi do not run this and for anyone this test is your own decision. I have to say that but yeah you know.

      So what we will do is turn off all the swap so the test ends quicker and it doesn’t thrash your flash.

      sudo swapoff -a nano pythonbomb.py # import os while(1): os.fork()

      So we found that watchdog is running in the syslog and now to test. python3 pythonbomb.py

      Doesn’t take long to swamp the system that one The time base has me confused as its very quick to react on a load test but pretty sure the ping test is a minute. Its good how it is and the default values seem to work well as the highest I have ever seen my pi is just above 3 Ping test I tried this by putting in the IP of my desktop 192.168.1.16 which is local but then I just shut down. And right enough after a minute my computer was no longer available the pi restarted.

      The only thing I am worried about and I guess this is true that you could enter an IP that may never exist and turn your pi into a rotating boot. Time to put the SD card in a reader and edit your files and remove that watchdog test on another computer I guess. If you don’t have an overzealous internal firewall that putting in your router ip 192.168.1.1 with me would make a good WiFi watchdog Then maybe a internet IP like googles main DNS of 8.8.8.8 might but not sure if you constanty pinging that you may get filtered. 8.8.8.8 is usually what many use just never set up a perm watchdog so honestly can not say bbc.co.uk - 212.58.253.67 did actually take that service down and got bombarded by sysadmins to re-instate and its prob the UK’s unofficial official ping test.

      etc/watchdog.conf is a standard linux watchdog file http://www.sat.dundee.ac.uk/psc/watchdog/watchdog-configure.html So you can read up on these. https://manpages.debian.org/stretch/watchdog/watchdog.8.en.html

      As per usual you can all my stuff on https://github.com/StuartIanNaylor/MagicMirror-Install-Guide-Raspberry-0-to-3

    • S

      Can you call a module multiple times with different parameters?
      General Discussion • • stuartiannaylor

      5
      0
      Votes
      5
      Posts
      656
      Views

      S

      @sdetweil

      Yeap works just the same.

      Starting to get to grips with things Pages just suspends and restarts scripts for each page they are allocated.
      So it just needs to be referenced once in pages.

    • S

      Anyone fancy doing a fulscreeen month calendar?
      Custom CSS • • stuartiannaylor

      6
      0
      Votes
      6
      Posts
      1575
      Views

      ?

      0_1550672751542_sc1.png

      I don’t know what you mean grayscale theme, but how about this? Unless you set your style to event, it will be displayed as B/W style.
      like this;
      0_1550672935437_sc2.png
      Of course you can adjust color with CSS.

      MMM-CalendarExt can do that also.

    • S

      MMM-MovieInfo
      General Discussion • • stuartiannaylor

      13
      0
      Votes
      13
      Posts
      1772
      Views

      S

      Lols it would seem so, as so far much effort but no completed magic mirror, but much fun 🙂

      Its been really interesting introduction to nodejs and a whole previously hidden browser console.

      I am still banging my head with this PiZero as really with any complexity the proc load goes crazy.
      Great if you keep it relatively simple, but being trying ‘other’ browsers to be lighter and to my surprise chromium is by the the best. Midori & Epiphany even after java problems or bad animation are still no lighter from what I am seeing in Top.

      Its a tremendous project and I will bung it a donation when I have a bit of cash.

    • S

      SOLVED What difference does node server-only make in operation?
      Feature Requests • • stuartiannaylor

      3
      0
      Votes
      3
      Posts
      927
      Views

      S

      Many thanks got similar great info from discord as never have patience, apols.

      One last thing as I said because I have done a little script for Pi Zero https://github.com/StuartIanNaylor/MagicMirrorPi0StretchLite that has chromium with all the commandline settings need for the above.
      I said to Mich I was just looking @ Selenium as thinking of doing a Chromium watchdog and he suggest mm_watchdog.
      Then I barbled on but with hindsight does mm_watchdog also work with standalone chromium?

      As if so all I have to do is work out why plymouth confuses me so much as to if it will work or not and maybe show on whatever chance that might maybe 🙂

      Thanks for a great explanation though.

      One more question is how do you mark as solved?

    • S

      UNSOLVED Divide Config.js into modules
      Feature Requests • • stuartiannaylor

      21
      0
      Votes
      21
      Posts
      3195
      Views

      S

      @artieikon u can get files from the filesystem without special config settings just setup an express url handler in the node helper. See the MMM-ImagesPhotos module for an example use.

      Node_helper sets up the express url handler, module does a request to that url, and handler gets invoked, and files are found and their names are returned. The a url request is made for a file and it’s contents are returned.

      Module doesn’t know helper provided the files list or data

    • S

      YAPi0 Installer Stretch Lite
      General Discussion • • stuartiannaylor

      118
      0
      Votes
      118
      Posts
      15299
      Views

      B

      so lets run and let me know if you need any to test

      It works as designed I would say 😀

      @sdetweil good job! 👍

    • 1 / 1