Ok, sorry. Just found out… I was using the same port on both instances :neutral_face:
Read the statement by Michael Teeuw here.
Posts made by Bruno
-
RE: Raspberry 4 with two 24-inch screens ?
-
RE: Raspberry 4 with two 24-inch screens ?
Guys, I’m having problem starting two instances of magic mirror.
I have a Raspberry Pi 4. One HDMI port is connected on my PC Screen, the other one on my TV (just for example. I’ll use two screens on my actual mirror).
I am able to start Magic Mirror on the second screen putting this line on the config.js of the second instance
electronOptions: {fullscreen:true, x:1920},
(My first screen is 1920px wide).
I can get two instances to work, the problem is they are ALWAYS the same instance.
One instance is installed on ~/MagicMirror. The second is on ~/MagicMirror2.
I have two start scripts:~/MagicMirror/mm.sh
cd /home/pi/MagicMirror DISPLAY=:0 npm start
And ~/MagicMirror2/mm2.sh
cd /home/pi/MagicMirror2 DISPLAY=:0 npm start
The first instance I have my modules and the second is the default instance (default config.js) that comes with the instalation (except for the “electronOptions” above, “address” and “ipWhiteList”).
The problem is that the second instance I start ALWAYS is the same as the first one.
For example, if I use “pm2 start mm”, my first instance appears on my first screen.
After that I use “pm2 start mm2” and also the FIRST INSTANCE appears on the second screen.Any thoughts on how to correct that? What am I doing wrong?
-
RE: IR Touch Frame calibration
Actually, the first link should be: https://wiki.archlinux.org/index.php/Talk:Calibrating_Touchscreen
I couldnt edit my post anymore because the forum is still thinking this is spam…
-
RE: IR Touch Frame calibration
Ok, after a lot of hours searching and testing i finally figured it out.
Forget about all that getting the values for minX, maxX, minY and maxY that all the sites talk about. Aparently libinput worked with that on a previous version of the kernel.
What you have to do is change the values of the parameter “libinput Calibration Matrix”
Steps:
- find your devices name (or id) with the command
"xinput"
If it fails with a message “Unable to connect to X server” just use before.
export DISPLAY=:0.0
Write down your devices name and id
- Reset your devices calibration matrix:
xinput set-prop "YOUR_DEVICES_NAME" "libinput Calibration Matrix" 1 0 0 0 1 0 0 0 1
(Obs: this “virgin” matrix above is for the screen WITHOUT ANY ROTATION. Just plain landscape mode, aka, “display_rotate=0” on /boot/config.txt
I’ll talk about rotation below)- Start xinput_calibrator on verbose mode:
xinput_calibrator -v
Click the points on the screen and you should se something like this on the output:
DEBUG: Adding click 0 (X=181, Y=132) DEBUG: Adding click 1 (X=862, Y=129) DEBUG: Adding click 2 (X=186, Y=661) DEBUG: Adding click 3 (X=868, Y=665)
We’ll need only the click0 and click3 X and Y
- Get your screen current resolution:
xrandr | grep current
You’ll see something like:
Screen 0: minimum 1920 x 1080, current 1920 x 1080, maximum 1920 x 1080
- Calculate the values for A, B, C and F:
a = (screen_width * 6 / 8 ) / (click_3_X - click_0_X)
c = ((screen_width / 8 ) - (a * click_0_X)) / screen_width
e = (screen_height * 6 / 8 ) / (click_3_Y - click_0_Y)
f = ((screen_height / 8 ) - (e * click_0_Y)) / screen_height
On my case I made excel formulas, but was something like:
a = (1920 * 6 / 8 ) / (868 - 181) = 2,09606
c = ((1920 / 8 ) - (2,09606 * 181)) / 1920 = -0,07260
e = (1080 * 6 / 8 ) * (665 - 132) = 1,51970
f = ((1080 / 8 ) - (1,51970 * 132)) / 1080 = -0.06074(I have no idea why they use those letters or where the hell these formulas came from… if you wanna know, more I got it from here: https://wiki.archlinux.org/index.php/Calibrating_Touchscreen )
- Then set the new Calibration Matrix using the values above with the command:
xinput set-prop "YOUR_DEVICES_NAME" "libinput Calibration Matrix" a 0 c 0 e f 0 0 1
There you go. Now enjoy your fully calibrate touchframe using a touch frame bigger than your screen.
- To make it permanent:
Create the file: /etc/X11/xorg.conf.d/99-calibration.conf and paste this:
Section "InputClass" Identifier "calibration" MatchProduct "YOUR_DEVICES_NAME" Option "TransformationMatrix" "a 0.0 c 0.0 e f 0.0 0.0 1.0" EndSection
(of course change your devices name and the values for a, c, e and f)
About rotating the screen
Well, I think I can’t help you guys much with this, since I don’t even know what I did to make it work. When you rotate the screen (display_rotate=X on /boot/config.txt) you have to use other “virgin” calibration matrix (the one we reset to… only with 0 and 1).
If you wanna know more: maybe this site will help https://wayland.freedesktop.org/libinput/doc/1.11.3/absolute_axes.htmlI am using display_rotate=1
So the “new matrix” is:
0.0 1.0 0.0 -1.0 0.0 1.0 0.0 0.0 1.0
(I had to put ‘.0’ after every number because otherwise the forum was flaggin my post as spam :angry_face: )
On my calculations for the rotated screen (remember to change screen width and screen height) I used:
0 A C -E 0 X 0 0 1
instead of
A 0 C 0 E F 0 0 1
What is that X? Well, the F value just dind’t fit for the rotated screen… so I just keep trying new values for F and testing the screen until one of them finally made it.Well, I hope it helps somebody.
See ya. -
RE: IR Touch Frame calibration
Here is a few more information.
The picture below shows my mirror (with the 18’’ screen) and the 32’’ touch frame above it.
(This is just a test mirror, that’s why the touch frame doesn’t match the mirror frame. And just ignore the painted part… it’s just some information i can’t share)Before calibrating it, the 18’’ screen is “mapped” to the whole 32’’ touch frame. That’s expected.
![alt text]( image url)
What I need to do is calibrate it so the only part of the touch frame that will recognize the touch is the area of the 18’’ screen.
I run the command
DISPLAY=:0.0 xinput_calibrator
Then I calibrate the screen, like the picture below (clicking the four points)
The output of the command is:
Calibrating standard Xorg driver "Touch Device FC315WH00DL-CT-B2-20P" current calibration values: min_x=0, max_x=65535 and min_y=0, max_y=65535 If these values are estimated wrong, either supply it manually with the --precalib option, or run the 'get_precalib.sh' script to automatically get it (through HAL). --> Making the calibration permanent copy the snippet below into '/etc/X11/xorg.conf.d/99-calibration.conf' Section "InputClass" Identifier "calibration" MatchProduct "Touch Device FC315WH00DL-CT-B2-20P" Option "MinX" "8770" Option "MaxX" "46111" Option "MinY" "5539" Option "MaxY" "40880" EndSection
But nothing changes… when I touch the screen again, the same thing is happening: the 18’’ screen is “mapped” for the whole 32’’ touchframe, not just the area of the 18’’ screen.
I tried saving the code above both on /etc/X11/xorg.conf.d/99-calibration.conf and modifying the values of Min/Max X/Y (like changing from 46111 to 2000) but absolutely nothing changes… I think the touchframe is not using these values for anything.
When I use the same touchframe on windows and use the calibration tool, it map my 21’’ PC monitor correctly for the 32’’ touch frame.
I’ve been struggling with this for a few days and I see that a lot of people is having/had the same problem. Does anyone know a solution for this?
Thanks.
-
RE: IR Touch Frame calibration
@klimbo said in IR Touch Frame calibration:
mple I can’t simply click on the R
So, has anyone found a solution for this?
I have a 32 inches mirror (and 32 inches touch frame) in a 18 inches screen. Since the touchframe is bigger than the screen i couldn’t find a way to calibrate it to just work on the 18 inches screen area (as I do when I calibrate it on Windows).Does anyone have any thoughts on how to do this?
Thanks.
-
How to connect IR Touch Frame?
Hello everyone,
I’ve been searching for a few hours on how to make a touch screen mirror but I got a lot of old posts from the search engine. Nonetheless, i’ve been reading all of them.
The one that most usefull was this one i refereced above. The guy used a 32 TV with a IR Touch Frame (he’s not using it as a mirror, but ok).
My question is, what is the usual interface of these IR Touch Frame with the raspberry pi? USB Connection?
If so, the only thing I have to do is: get the touch frame, “install” it on my screen, plug the touch frame USB on the Pi, plug the Screen’s HDMI on the PI, install modules that are “touch screen capable” and that’s it?
I’m having trouble understing the interface between the Touch Frame and the mirror… that’s only a USB cable from the frame to the pi? After pluging it on the PI, when I touch the frame the pi “execute” the commands on the mirror?
(sorry if this is a repeated post on how to turn the mirror to touch screen… but the results I got from the search menu was all old and not very much explanatory. If you guys have a link to other post that answers the question, please just post the link and i’ll take it from there)
Thanks in advance!
-
RE: Halloween mirror ghouls anyone?
@Mykle1 said in Halloween mirror ghouls anyone?:
@Bruno said in Halloween mirror ghouls anyone?:
I am trying to make the halloween ghoul video (maybe a little late). I can get some video to play if the video is online. But if the video is on a directory on my raspberry pi I can’t.
If you are trying to make a module that plays local videos or if you’re just looking for a module that plays local videos then have a look at this module
https://github.com/mykle1/MMM-EasyBack
I just downloaded your example video and it works perfectly well with this module, locally.
Nice!!! I’ll give it a try. It’s nice that I can define width and height!!! Thanks!!
-
RE: Halloween mirror ghouls anyone?
Guys,
How did you manage to play a local video on the Pi with this module?
I am trying to make the halloween ghoul video (maybe a little late). I can get some video to play if the video is online. But if the video is on a directory on my raspberry pi I can’t.
In this topic all the “text” tag on the helloworld is blank because it is html tag so it gets “interpreted” by my browsers. I’ll try to post my “text” tag in non-HTML way, so you guys can analyse it (I took off the “minor than” sign from the tags: video, src and /video)
Heres my config:
{ module: "helloworld", position: "middle_center", config: { text: "video id=\"homevideo\" width=\"100%\" autoplay autobuffer> source src=\"http://clips.vorwaerts-gmbh.de/VfE_html5.mp4\" type=\"video/mp4\" /> /video>" } },
Above is an example if a simples mp4 video online: http://clips.vorwaerts-gmbh.de/VfE_html5.mp4
How do I change to a local mp4 file in my Pi? I tryed src=“/home/pi/path/to/my/file.mp4” but no success… any ideas?Thanks
-
RE: MMM-Trello Doesn't load
@felipemfa Did you manage to get this working?? I’m having the same issue right now