Read the statement by Michael Teeuw here.
Third-Party Module - how to get help?
-
@sdetweil said in Third-Party Module - how to get help?:
app.commandLine.appendSwitch(‘disable-http-cache’);
Thanks. I have made the change and restarted the mirror.
I’m running with only this module and the clock enabled and am finding that having the image caching disabled (so far) is significantly slowing down the rendering of the images on screen.
Is there a way to set the node.js maximum memory or set a limit on cache size? I have found some commentary that seems to say that node.js will use up to 1.7G of RAM by default and have no idea if there is anything in any of these configuration files that would lower that limit using the settings:
--max-old-space-size={limit in KB} --optimize-for-size --max-executable-size={limit in KB}Given that my system is 1GB of RAM, and the default for node.js is to use up to 1.7GB, I could see where it could conceivably be trying to use memory beyond the bounds of the system, especially if there were some sort of issue with the underlying OS and its interaction with node.js to control the memory usage.
-
@ember1205 you should increase the swap space .
https://wpitchoune.net/tricks/raspberry_pi3_increase_swap_size.html
yes, lack of cache will slow down rendering.
I added javascript code to the other module to wait til the image was loaded before showing,
made a huge improvement, no lag renderingyou could try it
https://github.com/sdetweil/MMM-ImagesPhotos
git clone that and then use this in config{ module: "MMM-ImagesPhotos", position: "fullscreen", config: { opacity: 0.9, animationSpeed: 0, updateInterval: 30000, // how often to change pic backgroundColor: "#808080", // color around pic (if u want something other than black) }, },u have to put images in the uploads folder,
or make a link (ln command) for the uploads folder where the pics are (I use my linux server, external usb drive)cd ~/MagicMirror/modules/MMM-ImagesPhotos ls -laF lrwxrwxrwx 1 sam sam 45 Dec 12 08:53 uploads -> /media/buildserver/media/Photos/selectedpics//add
disabled: true,the the existing module definition (after the name)
to turn it off, without changing anything -
the command
free -mwill show u memory usage
nano sam@nano:~/MagicMirror$ free -m total used free shared buff/cache available Mem: 3956 2097 359 559 1499 1149 Swap: 1978 460 1517pi4 -4gig, default swap space free -m total used free shared buff/cache available Mem: 3906 650 2053 447 1201 2656 Swap: 99 3 96 -
@sdetweil said in Third-Party Module - how to get help?:
https://wpitchoune.net/tricks/raspberry_pi3_increase_swap_size.html
I will give this a shot. Given that each time the slideshow has died, it has indicated that it ran out of memory at roughly 100Mb (and the default swap is 100Mb), this could definitely be related. I’ll try doubling it to see what happens with this module.
I was going to try tackling the transitioning to prevent changing to the new image until it was rendered (to prevent the “painting”), but need the memory issue fixed first. :)
Does your image module contain the JS code you were referring to that hides the image until it’s rendered?
-
@ember1205 yes, it contains the code for the transition handling.
I would make the swap 1 gig… its only a little disk (memory card) space…
the code.
basically it adds an img (appends) to the div to display, the image is hidden,
then there is an onload handler, that gets notified when the image is loaded (not yet visible)
it also adjusts the image size to keep the proportions correct, (css background-size:cover and contain both distort the image)it makes the image visible, and starts the timer for the next image.
it then checks to see if there are TWO images in the div,
if so, it hides the 1st, shows the second and removes the 1st (old image)
repeat -
I will give your code a try. Increasing the swap size and re-enabling the cache resulted in another almost immediate crash.
:(
-
@ember1205 hm… mine runs like a top on pi0 , pi3 b+, pi4, odroid, jetson nano , macOs, ubuntu
my selected pics holds 100 pics, some as large as 15meg. 7.4 meg avg
-
Seems your code has dependencies? I’m getting an error when trying to load:
WARNING! Could not load config file. Starting with default configuration. Error found: Error: Cannot find module 'node_helper' -
@ember1205 node_help is the build in module,
sounds like u did an npm install, even tho not needed (and finds a bug or new feature we don’t want)
recover with this
cd ~/MagicMirror git checkout modules/node_modules/node_helper/index.js -
@sdetweil said in Third-Party Module - how to get help?:
git checkout modules/node_modules/node_helper/index.js
yeah, I get into the habit of installing add-ons this way and I did the npm install.
Your fix cleaned it right up and it started up. But, guess what? Out of memory again.
Seems that I have bigger issues here…
-
@ember1205 show me the output of
node-v npm -v lsb_release -a uname -aand other than image, you are running default modules, correct?
I’m gonna be out for a couple hours, running xmas errands. will try to look in on my phone
-
pi@raspberrypi:~ $ node -v v10.17.0pi@raspberrypi:~ $ npm -v 6.11.3pi@raspberrypi:~ $ lsb_release -a No LSB modules are available. Distributor ID: Raspbian Description: Raspbian GNU/Linux 10 (buster) Release: 10 Codename: busterpi@raspberrypi:~ $ uname -a Linux raspberrypi 4.19.75-v7+ #1270 SMP Tue Sep 24 18:45:11 BST 2019 armv7l GNU/Linux -
@sdetweil said in Third-Party Module - how to get help?:
and other than image, you are running default modules, correct?
I have installed your MMM-ImagesPhotos and MMM-BackgroundSlideshow. Even paring the configuration down to ONLY one third-party module running, it will die unless I have the http cache disabled.
I have changed the swap size from the default of 100 to 250 and when it crashed, there was only a small portion of swap being used.
-
@ember1205 hm
my uname -a
Linux raspberrypi4 4.19.75-v7l+ #1270 SMP Tue Sep 24 18:51:41 BST 2019 armv7l GNU/Linuxwe have different kernels… wonder why
just got the pi4 yesterday -
@sdetweil Possibly because you’re running on a 4 and I’m on a 3?
-
are u using pm2 to manage? if so, do a pm2 logs --lines=100 >somefile
I’d like to see the error
-
@ember1205 ok, from my pi3
Linux raspberrypi 4.19.75-v7+ #1270 SMP Tue Sep 24 18:45:11 BST 2019 armv7l GNU/Linux -
I just did an apt-get update and apt-get upgrade. I then flushed the PM2 logs and restarted. When it crashes again, I’ll post the log info as you asked.
-
At a minimum, the apt-get update / upgrade seems to have at least helped. After installing the updates and restarting, I’ve been running this module with clock, calendar, current weather, and weather forecast all enabled and it hasn’t crashed in about an hour.
I stopped everything and reverted to the BackgroundSlideshow module to see if it would also run clean, but it died pretty quickly. I’ve flushed the logs again (although I did capture their contents from the other module’s crash) and once again changed over to ImagesPhotos to see what happens after another run.
While I’m waiting to see if it will crash, I have some questions about the rendering configuration.
I’ve tried both the “fullscreen” and “middle_center” settings and the photos are not constrained to the screen (in terms of the actual image, not where it’s shown). I can change the details so that I use less than full height and/or width, and there is a black border. However, the image itself is getting cropped - badly.
How can I get this to display the entire image on the screen like I can with the other module?
-
[TAILING] Tailing last 100 lines for [all] processes (change the value with --lines option) /home/pi/.pm2/pm2.log last 100 lines: PM2 | 2019-12-12T14:19:37: PM2 log: App [mm:0] starting in -fork mode- PM2 | 2019-12-12T14:19:37: PM2 log: App [mm:0] online PM2 | 2019-12-12T14:41:26: PM2 log: Stopping app:mm id:0 PM2 | 2019-12-12T14:41:26: PM2 log: pid=4285 msg=failed to kill - retrying in 100ms PM2 | 2019-12-12T14:41:26: PM2 log: pid=4285 msg=failed to kill - retrying in 100ms PM2 | 2019-12-12T14:41:26: PM2 log: pid=4285 msg=failed to kill - retrying in 100ms PM2 | 2019-12-12T14:41:26: PM2 log: pid=4285 msg=failed to kill - retrying in 100ms PM2 | 2019-12-12T14:41:26: PM2 log: pid=4285 msg=failed to kill - retrying in 100ms PM2 | 2019-12-12T14:41:26: PM2 log: pid=4285 msg=failed to kill - retrying in 100ms PM2 | 2019-12-12T14:41:27: PM2 log: pid=4285 msg=failed to kill - retrying in 100ms PM2 | 2019-12-12T14:41:27: PM2 log: pid=4285 msg=failed to kill - retrying in 100ms PM2 | 2019-12-12T14:41:27: PM2 log: pid=4285 msg=failed to kill - retrying in 100ms PM2 | 2019-12-12T14:41:27: PM2 log: pid=4285 msg=failed to kill - retrying in 100ms PM2 | 2019-12-12T14:41:27: PM2 log: pid=4285 msg=failed to kill - retrying in 100ms PM2 | 2019-12-12T14:41:27: PM2 log: pid=4285 msg=failed to kill - retrying in 100ms PM2 | 2019-12-12T14:41:27: PM2 log: pid=4285 msg=failed to kill - retrying in 100ms PM2 | 2019-12-12T14:41:27: PM2 log: App [mm:0] exited with code [0] via signal [SIGINT] PM2 | 2019-12-12T14:41:27: PM2 log: pid=4285 msg=process killed PM2 | 2019-12-12T14:41:27: PM2 log: App [mm:0] starting in -fork mode- PM2 | 2019-12-12T14:41:27: PM2 log: App [mm:0] online PM2 | 2019-12-12T14:43:33: PM2 log: Stopping app:mm id:0 PM2 | 2019-12-12T14:43:33: PM2 log: App [mm:0] exited with code [0] via signal [SIGINT] PM2 | 2019-12-12T14:43:33: PM2 log: pid=4543 msg=process killed PM2 | 2019-12-12T14:43:33: PM2 log: App [mm:0] starting in -fork mode- PM2 | 2019-12-12T14:43:33: PM2 log: App [mm:0] online PM2 | 2019-12-12T14:46:33: PM2 log: Stopping app:mm id:0 PM2 | 2019-12-12T14:46:33: PM2 log: pid=4667 msg=failed to kill - retrying in 100ms PM2 | 2019-12-12T14:46:33: PM2 log: App [mm:0] exited with code [0] via signal [SIGINT] PM2 | 2019-12-12T14:46:33: PM2 log: pid=4667 msg=process killed PM2 | 2019-12-12T14:46:33: PM2 log: App [mm:0] starting in -fork mode- PM2 | 2019-12-12T14:46:33: PM2 log: App [mm:0] online PM2 | 2019-12-12T14:47:42: PM2 log: Stopping app:mm id:0 PM2 | 2019-12-12T14:47:43: PM2 log: pid=4822 msg=failed to kill - retrying in 100ms PM2 | 2019-12-12T14:47:43: PM2 log: App [mm:0] exited with code [0] via signal [SIGINT] PM2 | 2019-12-12T14:47:43: PM2 log: pid=4822 msg=process killed PM2 | 2019-12-12T14:47:43: PM2 log: App [mm:0] starting in -fork mode- PM2 | 2019-12-12T14:47:43: PM2 log: App [mm:0] online PM2 | 2019-12-12T15:00:40: PM2 log: Stopping app:mm id:0 PM2 | 2019-12-12T15:00:41: PM2 log: pid=4943 msg=failed to kill - retrying in 100ms PM2 | 2019-12-12T15:00:41: PM2 log: pid=4943 msg=failed to kill - retrying in 100ms PM2 | 2019-12-12T15:00:41: PM2 log: pid=4943 msg=failed to kill - retrying in 100ms PM2 | 2019-12-12T15:00:41: PM2 log: pid=4943 msg=failed to kill - retrying in 100ms PM2 | 2019-12-12T15:00:41: PM2 log: pid=4943 msg=failed to kill - retrying in 100ms PM2 | 2019-12-12T15:00:41: PM2 log: pid=4943 msg=failed to kill - retrying in 100ms PM2 | 2019-12-12T15:00:41: PM2 log: pid=4943 msg=failed to kill - retrying in 100ms PM2 | 2019-12-12T15:00:41: PM2 log: pid=4943 msg=failed to kill - retrying in 100ms PM2 | 2019-12-12T15:00:41: PM2 log: pid=4943 msg=failed to kill - retrying in 100ms PM2 | 2019-12-12T15:00:42: PM2 log: pid=4943 msg=failed to kill - retrying in 100ms PM2 | 2019-12-12T15:00:42: PM2 log: pid=4943 msg=failed to kill - retrying in 100ms PM2 | 2019-12-12T15:00:42: PM2 log: pid=4943 msg=failed to kill - retrying in 100ms PM2 | 2019-12-12T15:00:42: PM2 log: App [mm:0] exited with code [0] via signal [SIGINT] PM2 | 2019-12-12T15:00:42: PM2 log: pid=4943 msg=process killed /home/pi/.pm2/logs/mm-error.log last 100 lines: 0|mm | [5004:1212/145553.006275:FATAL:memory.cc(22)] Out of memory. size=96641024 /home/pi/.pm2/logs/mm-out.log last 100 lines: 0|mm | No helper found for module: weatherforecast. 0|mm | All module helpers loaded. 0|mm | Starting server on port 8080 ... 0|mm | Server started ... 0|mm | Connecting socket for: MMM-ImagesPhotos 0|mm | Starting node helper for: MMM-ImagesPhotos 0|mm | Connecting socket for: updatenotification 0|mm | Connecting socket for: calendar 0|mm | Starting node helper for: calendar 0|mm | Sockets connected & modules started ... 0|mm | Launching application. 0|mm | Create new calendar fetcher for url: https://calendar.google.com/calendar/ical/EDITED%40gmail.com/EDITED/basic.ics - Interval: 900000 0|mm | 0|mm | > magicmirror@2.9.0 start /home/pi/MagicMirror 0|mm | > sh run-start.sh 0|mm | 0|mm | Starting MagicMirror: v2.9.0 0|mm | Loading config ... 0|mm | Loading module helpers ... 0|mm | Initializing new module helper ... 0|mm | Module helper loaded: MMM-ImagesPhotos 0|mm | No helper found for module: alert. 0|mm | Initializing new module helper ... 0|mm | Module helper loaded: updatenotification 0|mm | No helper found for module: clock. 0|mm | Initializing new module helper ... 0|mm | Module helper loaded: calendar 0|mm | No helper found for module: currentweather. 0|mm | No helper found for module: weatherforecast. 0|mm | All module helpers loaded. 0|mm | Starting server on port 8080 ... 0|mm | Server started ... 0|mm | Connecting socket for: MMM-ImagesPhotos 0|mm | Starting node helper for: MMM-ImagesPhotos 0|mm | Connecting socket for: updatenotification 0|mm | Connecting socket for: calendar 0|mm | Starting node helper for: calendar 0|mm | Sockets connected & modules started ... 0|mm | Launching application. 0|mm | Create new calendar fetcher for url: https://calendar.google.com/calendar/ical/EDITED%40gmail.com/EDITED/basic.ics - Interval: 900000 0|mm | 0|mm | > magicmirror@2.9.0 start /home/pi/MagicMirror 0|mm | > sh run-start.sh 0|mm | 0|mm | Starting MagicMirror: v2.9.0 0|mm | Loading config ... 0|mm | Loading module helpers ... 0|mm | Initializing new module helper ... 0|mm | Module helper loaded: MMM-ImagesPhotos 0|mm | No helper found for module: alert. 0|mm | Initializing new module helper ... 0|mm | Module helper loaded: updatenotification 0|mm | No helper found for module: clock. 0|mm | Initializing new module helper ... 0|mm | Module helper loaded: calendar 0|mm | No helper found for module: currentweather. 0|mm | No helper found for module: weatherforecast. 0|mm | All module helpers loaded. 0|mm | Starting server on port 8080 ... 0|mm | Server started ... 0|mm | Connecting socket for: MMM-ImagesPhotos 0|mm | Starting node helper for: MMM-ImagesPhotos 0|mm | Connecting socket for: updatenotification 0|mm | Connecting socket for: calendar 0|mm | Starting node helper for: calendar 0|mm | Sockets connected & modules started ... 0|mm | Launching application. 0|mm | Create new calendar fetcher for url: https://calendar.google.com/calendar/ical/EDITED%40gmail.com/EDITED/basic.ics - Interval: 900000 0|mm | 0|mm | > magicmirror@2.9.0 start /home/pi/MagicMirror 0|mm | > sh run-start.sh 0|mm | 0|mm | Starting MagicMirror: v2.9.0 0|mm | Loading config ... 0|mm | Loading module helpers ... 0|mm | Initializing new module helper ... 0|mm | Module helper loaded: MMM-ImagesPhotos 0|mm | No helper found for module: alert. 0|mm | Initializing new module helper ... 0|mm | Module helper loaded: updatenotification 0|mm | No helper found for module: clock. 0|mm | Initializing new module helper ... 0|mm | Module helper loaded: calendar 0|mm | No helper found for module: currentweather. 0|mm | No helper found for module: weatherforecast. 0|mm | All module helpers loaded. 0|mm | Starting server on port 8080 ... 0|mm | Server started ... 0|mm | Connecting socket for: MMM-ImagesPhotos 0|mm | Starting node helper for: MMM-ImagesPhotos 0|mm | Connecting socket for: updatenotification 0|mm | Connecting socket for: calendar 0|mm | Starting node helper for: calendar 0|mm | Sockets connected & modules started ... 0|mm | Launching application. 0|mm | Create new calendar fetcher for url: https://calendar.google.com/calendar/ical/EDITED%40gmail.com/EDITED/basic.ics - Interval: 900000 0|mm | Shutting down server... 0|mm | Stopping module helper: MMM-ImagesPhotos 0|mm | Stopping module helper: updatenotification 0|mm | Stopping module helper: calendar
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login