Read the statement by Michael Teeuw here.
Rpi 4 and two monitors
-
@NathTheDude how about the output of xrandr -q
-
@sdetweil . I get the following when trying to run different xrandr commands:
Can't open display
-
@sdetweil - ahhh. I need to do this from the desktop:
pi@MagicMirrors:~ $ xrandr -q Screen 0: minimum 320 x 200, current 2160 x 1920, maximum 7680 x 7680 HDMI-1 connected primary 1080x1920+0+0 left (normal left inverted right x axis y axis) 477mm x 268mm 1920x1080 60.00*+ 60.00 50.00 59.94 1680x1050 59.88 1280x1024 75.02 60.02 1440x900 59.90 1280x960 60.00 1280x720 60.00 60.00 50.00 59.94 1024x768 75.03 70.07 60.00 832x624 74.55 800x600 72.19 75.00 60.32 56.25 720x576 50.00 50.00 50.00 720x480 60.00 60.00 59.94 59.94 59.94 640x480 75.00 72.81 66.67 60.00 59.94 59.94 720x400 70.08 HDMI-2 connected 1080x1920+1080+0 right (normal left inverted right x axis y axis) 477mm x 268mm 1920x1080 60.00*+ 60.00 50.00 59.94 1680x1050 59.88 1280x1024 75.02 60.02 1440x900 59.90 1280x960 60.00 1280x720 60.00 60.00 50.00 59.94 1024x768 75.03 70.07 60.00 832x624 74.55 800x600 72.19 75.00 60.32 56.25 720x576 50.00 50.00 50.00 720x480 60.00 60.00 59.94 59.94 59.94 640x480 75.00 72.81 66.67 60.00 59.94 59.94 720x400 70.08 pi@MagicMirrors:~ $
-
@NathTheDude ok, I can see the same results now that I have my adapter…
may have to wait til tomorrow to work on it…
-
Hey @sdetweil , no problem at all - no rush indeed. Thank you for your help thus far.
So thanks to this page I have been able to run up two chromiums, one on each page but I have started up chromium directly via terminal from the desktop. Not quite figured out how to implement this as two MM’s and if running up two at once would kill the CPU.
1st terminal session
DISPLAY=:0 /usr/bin/chromium-browser \ --noerrdialogs \ --kiosk \ --window-position=0,0 \ --start-fullscreen \ --user-data-dir=Default
2nd terminal session
DISPLAY=:0 /usr/bin/chromium-browser \ --noerrdialogs \ --kiosk \ --window-position=1920,0 \ --start-fullscreen \ --user-data-dir=‘Test2’
-
@NathTheDude copy one MM folder tree to MagicMirror1
then change the config on MM1 to use a different port (8081 maybe)
then start both MM in serverOnly mode (u can set that in config.js too, serverOnly: true,
then launch your two browsers, with the url pointing to separate MM’s…
–app=http://localhost:MM_port,
–app=http://localhost:MM1_portyou can edit the run-start.sh on MM1 to add the
--window-position=1920,0 \ --user-data-dir=‘Test2’
parms to the ones already provided
then change both MM configs to serverOnly: “local”,
and it will launch the chrome browser for you
(this is what we call split mode, using a separate browser)then u can have pm2 start both of those when the system boots…
have to change the mm.sh in MM1/installers, and maybe the json file title to MagicMirror1, and point to the local mm.sh -
Hey @sdetweil , thanks for the info on this - I am grateful.
I think I am nearly there but just missing a bit or two.
I copied the ‘MagicMirror’ to ‘MagicMirror2’ folder, updated the config.js, run-start.sh and the pm2_MagicMirror.json files.
When I reboot I now get MM and MM2 load up but both on the same screen.
I have messed around with the chromium line from the ‘run-start.sh’ and I don’t think it is actually be used in this case, I even commented the line out and this did not prevent me from running ‘npm start’ and MM2 still loaded albeit on top of the first MM.
Any ideas on where it is getting it’s info on how to start up chromium?
Thanks
Nathan
-
@NathTheDude sorry. I left out the pm2 steps
From mm2 folder do
pm2 start installers/pm2???.json pm2 save
Where the json file is the one u modified.
It should start the second mirror app.
The only difference is that window-positio info. And on reboot
pm2 status should show both.
Can u show the two chromium browser lines?
I will attempt to recreate here
-
Hey @sdetweil , after looking at how the current MM is setup with pm2 (pm2 show MagicMirror) this had the ‘mm.sh’ as the target.
Within the MM2 folder I ran: ‘pm2 start ./installers/mm.sh --name MagicMirror2’ which started the MM2 but on the first screen. Then used pm2 save.
I just setup pm2 with the .json file instead of the mm.sh file and the results seem to be the same from what i can see with it getting displayed on the first screen.
Within the start-run.sh, I can comment out the chromium line and and it will not break anything which makes me think this line is not being referenced.
MM line:
chromium-browser --noerrdialogs --kiosk --user-data-dir='Default' --window-position=0,0 --disable-infobars --app=http://localhost:$port --ignore-certificate-errors-spki-list --ignore-ssl-errors --ignore-certificate-errors 2>/dev/null
MM2 line:
chromium-browser --noerrdialogs --kiosk --disable-infobars --app=http://localhost:8082 --ignore-certificate-errors-spki-list --ignore-ssl-errors --ignore-certificate-errors --window-postion=1920,0 --user-data-dir='Test2' 2>/dev/null
-
@NathTheDude if u start the json file, pm2 reads the info, gives u a nice name etc.
pm2 delete 0 or 1
pm2 saveThen pm2 start the json file.
And pm2 save
To save for reboot