@jakuk Start at this post. The CSS will change the style of each module (size, font, etc) but to have them appear in the appropriate regions, it’s best to use your module configurations in config.js.
Read the statement by Michael Teeuw here.
Posts
-
RE: Positions of modules
-
RE: Quick Question regarding Magic Mirror cache
@chef The
POSTrequest isn’t sending it an image, it’s sending the URL to the image (e.g.http://192.168.2.18:9920/security/values/2). The problem is, it already has a cached copy of that image. I suggest you append a timestamp to trickelectroninto re-fetching the same image/resource.You want to pass it a URL-encoded value, so use
%3Fas?and just append your timestamp, like so:http://192.168.2.48:8080/api/v1/modules/alert/show_ALERT?timer=10500&imageUrl=http://192.168.2.18:9920/security/values/2%3F {INSERT TIMESTAMP HERE}&imageHeight=220px -
RE: Hey Guys, I need help
@Shisim It is telling you what line it’s on (e.g.
56) and also why there’s a problem (e.g.Expected ']' to match '[' from line 28 and instead saw ':'). There were a handful of missing brackets and braces.I’ve fixed your errors and placed the file here. I’ll leave the link live for a week or so. I’ve also left comments where you were missing brackets or braces. You will need to learn what they do and how to balance them.
-
RE: Messed up CSS between Portrait and Landscape monitors
@Damian Use the built-in DOM inspector to see what styles are currently applied. Right-click on the compliments module and select “Inspect”.
Worst case, using
!importantshould work:.module.compliments { font-size: 73% !important; } -
RE: GIF update from URL with MMM-EyeCandy
@Mykle1 Yep, just needs to be a
?before the first parameter. Anything after gets appended with an&, e.g.https://icons.wxug.com/data/weather-maps/radar/united-states/united-states-current-radar-animation.gif?seed=1521767776&otherseed=4846528&page=2.Making your code the following:
... // img creation, etc var getTimeStamp = new Date().getTime(); img.src = "https://icons.wxug.com/data/weather-maps/radar/united-states/united-states-current-radar-animation.gif?seed=" + getTimeStamp; pic.appendChild(img); wrapper.appendChild(pic); -
RE: Magic mirror serving multiple clients
@zack949 Not of which I’m aware. Most dev effort is spent on the display/features end. It would also have to track the config options for dozens of regularly changing modules, which presents its own challenges.
I recommend using a syntax-highlighting code editor, like (the free) Atom. It will help with closing brackets/braces, and using the proper quotes. You can also run “Atom Beautify” in “Packages” regularly to keep formatting for legibility.
-
RE: Module Developer Challenge - I surrender!
@Mykle1 It doesn’t seem that pc-stats has all the info you require. You might consider switching to the systeminformation package.
You can then use
si.cpu()for your CPU stats andsi.cpuTemperature()to retrieve an object that (if I read the docs right) looks like{ main: 0, max: 0, cores: [0, 0] }with your core temps. You can then combine the two responses (or you may be able to have it return all within one request) and return those in a singlesendNotification()call. -
RE: MMM-ImagesPhotos - Show images from a directory
@twosquirrels So, I suspect (but cannot be certain) that this is your problem. I’ve not found great browser support for EXIF image rotation. There are a variety of command line approaches available, and even some GUI apps.
-
RE: MMM-CalendarExt
@abetterway I think you mean switch the origin branch of the MMM-CalendarExt repository to
forRPI1.In this case, use
git checkout forRPI1within the~/MagicMirror/modules/MMM-CalendarExtdirectory. -
RE: Really confused
@Duke86 Hi Duke, start with
cd MagicMirror/… you’re probably trying to start MM out of the wrong folder. -
RE: Module Developer Challenge - I surrender!
@Mykle1 Depending on the style/implementation you’re using, you may want to read up on Promises in JS.
Also, see this note here about the
lm-sensorspackage.Alternatively, have a look at MMM-SystemStats which uses
vcgencmdon the CLI to retrieve the system temp, which would be far easier to integrate into your current module. -
RE: Calendar module won't show all events
I’ve had the same problem since upgrading to MagicMirror 2.2.0.
It seems that Node.js is upset that MMM-CalendarExt uses an
asyncfunction atMMM-CalendarExt.js:182. From what I can tell, Node.js didn’t supportasyncuntil 7.4, and I’m (apparently) running 6.12.2 (vianode -v). However, until I upgraded MagicMirror this weekend,MMM-CalendarExtwas working fine.I just edited
run-start.sh:4to the following, and just gotMMM-CalendarExtworking again:electron --js-flags="--harmony-async-await" js/electron.js $1Can someone explain why upgrading to MagicMirror 2.2.0 would’ve rolled back the Node.js support for
async? -
RE: Modules not always loading
Hi @NathanWilcox,
If you followed the manual install, you should see the shell script (
mm.sh) when you runls -la ~. Runpm2 listto see what processes are registered inpm2. You can thenpm2 stop mm && pm2 delete mm && pm2 save, and finallyrm ~/mm.sh.mmshould then be gone for good, and onlyMagicMirrorwill remain. You can confirm what remains by runningpm2 listagain. -
RE: Creating a module with existing Nodejs client?
@Baxer An API (and client) give you a way to ask for information; it doesn’t stipulate what information to request, or how to display it. However, you could use
MagicMirror-Module-Templatethen runnpm install --save open-shlwithin your module folder to installopen-shl.You would then add the code featured here to load the API and start querying data. I recommend loading the API in your
node_helper.jsand passing back the data to display viathis.sendSocketNotification(notification, payload). -
RE: MMM-Tabulator: How to port HTML JS imports to node JS imports? [solved]
@E3V3A These paths are relative to your module file, which is why
this.file()is needed.I believe you could have alternately start with a slash, which makes the path relative to the server root:
'/modules/MMM-Tabulator/node_modules/jquery/dist/jquery.min.js', '/modules/MMM-Tabulator/node_modules/jquery-ui-dist/jquery-ui.min.js', '/modules/MMM-Tabulator/node_modules/jquery.tabulator/dist/js/tabulator.js' -
RE: magic mirror as a smart clock
@MrRodz If you install
MMM-Remote-Controland correctly configure the ipWhiteList, it will install a generic receiver to receive commands to your MM via a local HTTP GET request.You can then use an HTTP GET request like
http://192.168.178.240:8080/remote?action=SHOW&module=module_0_MMM-GoogleMapsTrafficto trigger a module/action, switch profiles, or create your own custom actions.I’m terms of GPIO for your doorbell, see
MMM-ButtonsorMMM-PIR-Sensor. It seems to me you want to receive a GPIO event, switch profiles, and start a timer to later revert your profile to the original – that’s basicallyMMM-PIR-Sensor(movement, turn on screen, set timer to turn off). -
RE: How to pass a value between functions in a Module?
@ameenaziz I think if you change
var ajaxResult;tothis.ajaxResult = "";and change all other references (fromajaxResulttothis.ajaxResult), you should be able to access it from anywhere in your module, includinggetDom(). Just remember whengetDom()is first called,this.ajaxResultmay still be empty until the response is received. -
RE: Modules assistance for MM newbie! Help!
@Fookes No problem. You need to use a program (app) to open any file. Right now, you’re using what came with your Mac (called TextEdit). But it’s much more of a note taking or word processing program than a text editor for code. It doesn’t understand code, and does things that break it. Once you’ve downloaded and installed Atom (by moving it to your
~/Applicationsfolder on your Mac) you can run it then open the file, or right-click a file and select “Open with…” and choose Atom. Not only will it not break your code, it will colour-code (called “syntax-highlighting”) your code, show you where brackets/braces match, and can help to make your code legible (called “Beautify” in Atom).For adding modules, check out this walkthrough for tips: https://forum.magicmirror.builders/topic/4231/how-to-add-modules-for-absolute-beginners
-
RE: Transfer to smaller SD card
@crowbar You can either (1) truncate your original SD partition to 8Gb, transfer or backup/restore to your new card, or (2) create an image, resize the image to 8Gb, then restore it to your new SD card. If you already have an RPi backup, suggest you do the latter method.
As @Mykle1 notes, this is a very common issue (esp for RPi), but is complicated in that Win/Mac don’t play nice/at all with ext4 partitions. It’s not a great idea to back up the RPi while it’s running (esp to itself) – it is swapping all kinds of temp files, it has comparatively poor I/O, plus you’ll need a machine with two SD card readers or an interim storage medium like an HDD or USB stick. As he notes, a Live USB/CD is useful in this regard.