Are you using a proper power supply for the rpi? You need something that can provide at least 2A … anything less will cause it to be unstable with random crashes of processes. Adafruit has both a 2A version as well as a 2.4A one.
Read the statement by Michael Teeuw here.
Posts
-
RE: NPM process dies
-
RE: NPM process dies
If you install PM2 per the instructions, it will automatically get restarted if/when it dies.
As for why it dies, if you are running PM2, you might be able to see if anything gets logged with
'pm2 logs'. But I’m not sure if it does log anything to be honest. PM2 does, but the npm process itself … unsure. -
RE: Debugging
Or if you wish to run your module with jQuery, using .width() and .height() will also give you the size of the element.
-
RE: Debugging
This might help you: http://www.w3schools.com/jsref/prop_element_offsetwidth.asp
-
RE: "phyton capture.py" error
You said you’re using a USB camera, but that error tells me it’s wanting to access an rpi camera, one that gets connected to the on board camera port, not USB. You’re going to have to figure out how to change the code to use a USB camera instead.
-
RE: Debugging
- Nope, or unknown rather.
- Check your router for the IP of the devices connected to it, or on the rpi, type
ifconfigat the prompt. If you’re connected wirelessly, look for thewlan0block. If it’s hard wired, look for theeth0block.
And if you have access to your router, it’s worth setting the rpi’s IP to always be the same.
-
RE: Monthly Calendar
Small update pushed to the master branch (which is now up-to-date with the dev branch.) Please read the README for more info on the added config options.
-
RE: Debugging
For debugging purposes, I sprinkle
'Log.log("...")'statements in my code which I can then see in the console log. For example, in mycalendar_monthlymodule, I have a'debugging'flag that I can set which then outputs this bit in the console log:= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = CALENDAR_MONTHLY IS IN DEBUG MODE! Remove 'debugging' option from config/config.js to disable. Current moment(): 1466399977889 (11:19:37 pm) scheduleUpdate() delay set at: 1466402400000 nextReload should happen at: 1466402400000 (12:00:00 am) which is in: 40 minutes and 22 seconds. midnight set at: 1466402400000 (12:00:00 am) = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =That output helped a great deal when I needed to accurately calculate those values (and I couldn’t figure out why the delay I was setting wasn’t right.)
Having log notifications like that helps. I tend to put them in places where I need to check for a value, or verify that a condition is being met, before the rest of the code continues on. It’s worth nothing that I load the running mirror remotely on my development desktop machine (through Chrome or Firefox) by going to my rpi’s IP and MM’s port. I don’t touch the actual running task on the rpi itself, once loaded, I leave it alone. When I make a change in the code, I can refresh my browser and see the results immediately without affecting the mirror itself. It’s not till I’m certain the code works that I will restart the npm process on the mirror. This has the added advantage that I can see the current running code on the mirror and compare it with what the new/changed code shows on my remote browser.
As for the height/width part, those are being set in the main CSS file. Because it’s a fluid layout, there is no exact numbers, it’s all calculated at run-time based on the monitor’s resolution. So you’ll have to use the main layout “box” for the position that your module will be in, and then work within that. Setting fixed sizes will cause problems later down the road with folks who don’t have the same resolution as you.