@KristjanESPERANTO abd @sdetweil
for MagicMirror purposes, is there a preferred style to be used for modules?
@KristjanESPERANTO abd @sdetweil
for MagicMirror purposes, is there a preferred style to be used for modules?
@sdetweil AHHHH!!! AHA moment here. That graphic really helps me understand.
Not everyone runs a single mirror on it’s own computer like I do. Some use the MM like digital signage. One beefy server doing the heavy lifting and then a bunch of lightweight microcomputers just displaying the MM front end.
The Kid node_helper is running on the server! While the MotherModules are only in their own browsers on whatever weenie machine is displaying the front end of MM. (might not be weenie but might be.)
so I see how I would have to be really careful about unique id’s in an environment where I run the MagicMirror on a server and have a bunch of displays all connected to it. May not want the KidModule blasting the same info out to every single display. Unique ID’s mean info would only go to the display it’s intended for.
Though I supposed it’s possible that one would want the same info to go out to every display.
I was thinking of setting up a few displays showing golf tournament scores and in that situation, I’d want every single mirror to show the same info. So in this use case, I wouldn’t want the unique id at all.
I think we have five ways to use when sending notifications around in MM. I’d like to know if I finally have a grasp on how it works. Can someone confirm if I’ve got this right?
In my mental analogy I kind of imagine a node_helper is like a child of the mother module which spawned it.
So when I need to send information around inside MagicMirror this is how I think it works:
1. my MotherModule can send info to it's own kid node_helper with sendSocketNotification
2. my MotherModule can send info to the MM in this [edited: browser instance] with sendNotification
3. my node_helper kid can send to it's MotherModule with this.sendSocketNotification
4. my node_helper kid to all it's cloned MotherModule instances, but no module outside the immediate family with sendSocketNotification
(ie maybe I have four instances of the same module just using diff header names and setup with four diff config variables to kickstart them. I better be careful and keep track of which Mom send what info that the kid is replying to, or all the Mom's in the family will know the kid's secrets.)
5. can my kid node_helper sned info to the whole system? not directly possible. The kid node_helper has to send info to the MotherModule and then MotherModule will be able send it to the [edited: browser instance] .
“this.” makes it a private conversation between the specific instance of the Mother Module and the node_helper . Not having “this.” make it more public. In the case of the node_helper, it send to every instance of the Mother Module if there is more than one in use; and, in the case of the MotherModule, it blasts the info out into the entire MagicMirror.
I’m looking at a lot of modules while trying to roll my own and see a lot of differences in syntax style, I wonder if one way of creating a function is better or more efficient than the other.
init: function () and init()
I see both ways done in node_helper.js in different modules.
module.exports = NodeHelper.create({
init: function () {
console.log ("init module helper ");
}
})
and
module.exports = NodeHelper.create({
init () {
console.log ("init module helper ");
}
});
@Vauxdvihl openweathermap discontinued their 2.5 api. so the url in the module might be wrong. Check the configuration possibilities for your module and see if you can choose the 3.0 api.
@Lipax try dialing down the sensitivity, it’s probably picking up dust or something small you can’t see.
@sdetweil
what was happening is that no matter if i used the full path or just the folder name like this
-b /home/pi/MMbackup2
-b MMbackup2
the script always used it’s own folder name of MM_backup.
when i tried to run from your repository,
Illegal option '- ’
I tried a local copy pulled a fresh copy from your GitHub and tried again
using -s MagicMirror
and -b MMbackup3
bash -c ./mm_backup.sh -p -b MMbackup3 -r MMbackup2 -u Kayakbabe -e user@email.com -m "second backup after build finished "
the backup folder was still created MM_backup and not MMbackup3.
Then I tried removing the -p option and I get this
bash -c “$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror-backup-restore/main/mm_backup.sh)” -b MMbackup2 -r MMbackup2 -u Kayakbabe -e email@mydomain.com -m “first backup after build finished (or whatever)”
environment: line 155: [: too many arguments
checking for backup folder MMbackup2
folder doesn’t exist, creating backup folder /home/kelly/MMbackup2
backup folder is /home/kelly/MMbackup2
username specified with -u temp doesn’t match the user in the github repo MMbackup2, aborting
Note i used my correct email, just don’t want it out here to get scraped. And the name and email DO match my github.
I run git remote-v in the folder it created (MM_backup) and there is no git .
I have to tell you that I am awed! And really considering making a round MM now. It is fabulous!
I’ll put this in my own words to see if I’m understanding what I am to do.
Depending on how I create my repository on github will determine my next step.
Note: This process is easier if you create an empty GitHub Repository.
If I created an empty GitHub Repsitory:
2.a.Run the backupscript using the flags on the backup script for repository name, source folder, backup destination folder, github userid, etc.
2.b. from the backup desitnation folder run the command
git push
if I created GitHub repository with a readme:
then I’ve made a big mess and shouldn’t have done that. So delete the local folder and github repository and start over.
Results
I ran this
bash -c ./mm_backup.sh -s /home/pi/MagicMirror -b /home/pi/MMbackup2 -r https://github.com/Kayakbabe/MMbackup2.git -u Kayakbabe -e email@mydomain.com -m 5thTry
And got this:
folder created with name /home/MM_backup
files created inside /home/MM_backup
no folder named MMbackup2
I also tried with -b /home/pi/MMbackup2
and still get home/pi/MM_backup created
i don’t have a folder named MMbackup2 on my pi at all.
I then manually created /home/pi/MMbackup2
ran my command again and still no files were placed in MMbackup2. i tried both =b /home/pi/MMbackup2 and -b MMbackup2 to no avail.
I noticed .git was created in the MM_backup folder along with the files the script created.
I ran git remote -v and get no output. (Just to make sure, i went to a diff local git folder and ran git remote -v and it shows the origins for fetch and pull.) so I think the .git being created in the MM_backup folder isn’t correct.
My questions are:
What is wrong with my flags that my backup folder isn’t being create with the folder name I chose?
Was the backup script supposed to do all the git stuff for me, like the git remote add origin and add files and set the branch and message?
So that, all I am supposed to have to run git push?
Or, am i supposed to now do all the following stuff?
git remote add origin https://github.com/<USER>/<repo>.git
git branch -M main
git push -u origin main
@ankonaskiff17 I have to agree that DAKBOARD is super lame. I read about MM a long time ago and found DAKBOARD becuase of my MM research. I actually looked at it for about a hour and thought it was lame too. MagicMirror is so customizable and I am a tinkerer. I like to change up things. I like to fix things and not wait on someone else to update when some api changes. So, I decided to tackle MagicMirror. I’ve learned a lot and this is a great community.
I’ve read through this topic and several others about backing up magic mirror especially this one
Re: So I have a question about backup
I’m trying to use Sam’s backup and restore scripts.
I actually have it making files into a folder named MM_backup. But now I think my problem is that I don’t understand how git works all that well yet. I’ve only used it in a very simplistic way until now.
Should my repository on GitHub have the same name as my local MM_backup folder? I ask because what is happening is that when I try to connect my local folder to the repository I made on GitHub, I get error messages about a repository inside a repository.
I made a repository on GitHub then went to my local MM_backup and git cloned that repository into MM_backup.
Then I ran the backup script making sure I specified the correct repository name. Then i try to git add the new files. GitHub is having none of it. says i have a repository inside a repository.
SOOO. I thought aHA! i will change the backup folder path in the bash script. I deleted all the folders i made.
Created a folder at /home/reponame
Ran the script using the flag -b /home/reponame
but the script doesn’t put the files in /home/reponame. The script creates a folder MM_backup and puts the files it made in there.
So perhaps that is a bug?
I don’t understand what is happening.
And i can’t push the files the script made to the repository because i somehow made a repository inside a repository.
I manually added the files to my repository on Github in the hopes that they’ll be useful at some point.
I’d really like to make this work. But I need help.
@ankonaskiff17 I think that is very cool. Vilros has a Magic Mirror kit too. This one looks more complete. Waveshare has some nice displays. I think the more people getting into and using the MagicMirror software the longer it will continue. This is a good thing for all of us. They are linking to our MagicMirror repository and giving good instructions for setting it up and modules too.
Drawing people here will help us all and ensure MM goes into the future.
@Hanimani Why not take the keyboard from your pc and plug it into your raspbery pi? use the mouse too.
The Pi5 has new GPIO hardware. It is not compatible with software written for earlier Pi models.
So look at what gpio library is being called by the modules you are wanting to use.
I’ve been rewriting my own code to use gpiozero .
gpiozero works and isrecommend by raspberry pi foundation and works on older pis too.
Lgpio works on rpi5
Gpiod works on rpi5
Pigpio WILL NOT WORK
RPi.GIPO WILL NOT WORK
I haven’t tried rpi-lgpio which supposed to be a drop in replacement for rpi.gpio.
If you use YouTube, it is possible.
If you use isstracker.spaceflight.esa.int, it is not possible.
@Manu85 Youtube allows you to form the url requesting the video in a way that tells YouTube what size you want the YouTube player to be. The YouTube developers do that purposely as they make money from ads they show you.
Unfortunately the isstracker.spaceflight.esa.int website doesn’t allow you to do that.
Every website developer makes choices for their own website. We may not like what they choose.
@Manu85 I do not understand what you wrote. I think you want to change the size of the content you are grabbing from a different website.
MMM-SmartWebDisplay creates an iframe and shows a webpage inside that iframe.
Because you are displaying the contents of your link inside an iframe, you are stuck with whatever is coded in that frame. You can’t change what is in it. The web page you chose contents are set to a fixed size by the html code that creates that page.
The width and height in the config.js only affect the size of the iframe that you created with the module. Those values can not affect what is inside the iframe that are hosted on a different server.
Perhaps you can find a different source for your content? If you found something that isn’t set to a fixed size then it may display relative to the size of the iframe you build locally with the module.
This is by design of the www. It prevents hijacking content. If you want to read about it, it’s called same-domain policy.
@ludoRaspberry said in changement couleur d'une lettre d'un title:
bonjour a tous ; je suis débutant dans la programmation js
j’aimerais changer la couleur d’une lettre sur le “title cNews”
le c en noir et News en rouge
comment puis je faire??
CSS controls the colors and format of the text. It is not the same as js. CSS is a very large topic but the best way to learn is to play with it. You will use the file custom.css to enter your changes. It will override any other css setup by the default MagicMirror.
This post has a lot of information: https://forum.magicmirror.builders/topic/6808/css-101-getting-started-with-css-and-understanding-how-css-works?_=1708249746950
@JohnGalt
I see you got your module choice working.
jclarke0000 is the one I’m using.