sdetweil/MagicMirror_scripts

start up on pi0w

Closed this issue ยท 95 comments

Hi,

Thank you very much for all your work. I used your script to install the MagicMirror onto a Pi zero W. However, after I run pm2 start MagicMirror, it says process successfully started, but nothing happens afterward. Am I missing something?

Sorry, I am new to this. Thank you very much for your help!

20211204_103159

do
lsb_release -a
pm2 status
and
ps -ef | grep chrome

show output please

pi 0 w is pretty slow now adays..

I hope this helps.
Thank you~

Capture

ok, so the status info say 865 restarts ( pm2's job is to keep whatever running)

so more info

pm2 stop all
pm2 logs --lines=50

sorry, I don't know what is a better way to put this info up besides screenshot.
I really appreciate your help!

Capture
Capture1
Capture2
Capture3
Capture4

aha.. something is already using that port...
do this

pm2 stop all
pm2 flush 
ps -ef | grep node

Thank you for your prompt responses.

Capture

aha, the server side stuck

sudo kill -9 32740
then
npm start

is this easier to see or screenshot is better?

pi@raspberrypi:/MagicMirror $ sudo kill -9 32740
pi@raspberrypi:
/MagicMirror $ npm start

magicmirror@2.17.1 start /home/pi/MagicMirror
./run-start.sh $1

[05.12.2021 15:09.18.281] [LOG] Starting MagicMirror: v2.17.1
[05.12.2021 15:09.18.387] [LOG] Loading config ...
[05.12.2021 15:09.18.520] [LOG] Loading module helpers ...
[05.12.2021 15:09.18.581] [LOG] No helper found for module: alert.
[05.12.2021 15:09.19.392] [LOG] Initializing new module helper ...
[05.12.2021 15:09.19.434] [LOG] Module helper loaded: updatenotification
[05.12.2021 15:09.19.448] [LOG] No helper found for module: clock.
[05.12.2021 15:09.23.344] [LOG] Initializing new module helper ...
[05.12.2021 15:09.23.352] [LOG] Module helper loaded: calendar
[05.12.2021 15:09.23.363] [LOG] No helper found for module: compliments.
[05.12.2021 15:09.23.377] [LOG] No helper found for module: weather.
[05.12.2021 15:09.24.154] [LOG] Initializing new module helper ...
[05.12.2021 15:09.24.168] [LOG] Module helper loaded: newsfeed
[05.12.2021 15:09.24.195] [LOG] All module helpers loaded.
[05.12.2021 15:09.26.738] [LOG] Starting server on port 8080 ...
[05.12.2021 15:09.27.290] [LOG] Server started ...
[05.12.2021 15:09.27.312] [LOG] Connecting socket for: updatenotification
[05.12.2021 15:09.27.365] [LOG] Connecting socket for: calendar
[05.12.2021 15:09.27.377] [LOG] Starting node helper for: calendar
[05.12.2021 15:09.27.414] [LOG] Connecting socket for: newsfeed
[05.12.2021 15:09.27.438] [LOG] Starting node helper for: newsfeed
[05.12.2021 15:09.27.465] [LOG] Sockets connected & modules started ...
[05.12.2021 15:09.27.507] [LOG]
Ready to go! Please point your browser to: http://localhost:8080
Starting chromium browser now, have patience, it takes a minute
./run-start.sh: line 115: 5269 Illegal instruction "$b" -noerrdialogs -kiosk -start_maximized --disable-infobars --app=http://localhost:$port --ignore-certificate-errors-spki-list --ignore-ssl-errors --ignore-certificate-errors 2> /dev/null
npm ERR! code ELIFECYCLE
npm ERR! errno 132
npm ERR! magicmirror@2.17.1 start: ./run-start.sh $1
npm ERR! Exit status 132
npm ERR!
npm ERR! Failed at the magicmirror@2.17.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2021-12-05T20_09_31_784Z-debug.log
pi@raspberrypi:~/MagicMirror $

Capture
Capture1

cool, thanks do

which chromium-browser
and
which chromium

need a browser, was installed by default

I downloaded the raspberry pi imager to flash the SD card, I used the legacy one. I don't actually know which chromium browser it came with. In fact, I am not sure if it is even installed... because when I clicked the icon, nothing happens. How do I check? Sorry, this must sound very stupid.

when I check add/remove software, web browser chromium-90.0.4430.212-1~deb10u1 is checkmarked.

when u click, nothing happens.. well that's a problem. I haven't tried legacy yet. will do shortly

should I start over again with the newest OS with all the recommended software instead? would that be easier?

no, that's been flaky too and I don't think recommended for pi0w.

can I install /re-install a browser? Will that help? Or it's not that simple.

or maybe I should just give up on using a pi0w. I just thought it was smaller size to put into the frame.

I don't know at this time.

pi0w2 is out, same size and footprint. like pi3 speed

pi0w2 probably won't have the same problem as we do now right?

because there is an electron for armv7l, all is ok. don't need to do the server with chromium over to fake it

ok. Thank you very much for all your help. I really appreciate it.

I have confirmed that chromium on legacy is broken. uninstall/reinstall does not fix..
I have started discussion with pi os team

firefox also fails

I guess that means pi0w is no longer good for magic mirror.
Thank you very much for your help!

Note: Running the script completes on my PI Zero. Chromium will not load but I did install:
sudo apt-get install midori
The midori web browser does work.
image

I'm getting white screen on pizw

โžœ  ~ cat /etc/os-release 
PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
NAME="Raspbian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

Screenshot from 2022-05-01 13-51-38

you need to use the legacy, buster image for pi0w, (and pi1) using armv6l

you need to use the legacy, buster image for pi0w, (and pi1) using armv6l

thank you very much I'm really happy that I can't express my feeling to you. this was my first project in the company and i did it thanks to you

there is a problem i notice that there are 2 browser open at the boot

do pm2 status, to see if there are two apps being started

pm2 delete name
whichever you don't want
then pm2 save to clean the restart list

pm2 --help will show u all it can do

Screenshot_20220503-173757_Termux
it's showing me one only

> cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

hm..

do

ps -ef | grep npm | grep -v grep

this will list out the running instance of the npm command.

no output
Screenshot_20220503-175742_Termux

weird, if mm is ruining npm must have been used

it should look like this

sam@galliumos:~$ ps -ef | grep npm | grep -v color
sam      22934  5127  0 May02 pts/1    00:02:48 npm start

i started with both pm2 and npm start and the results of the grep are the same

let me restart and give it a try

did u follow the manual setup instructions on the mm website that had u create an autostart service?

yes I did
let me just reinstall it again

flash a new image
and then just use my script..

flash a new image and then just use my script..

yes I'm doing that only

here are the status of fresh installation. i used this script for installing

bash -c  "$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror_scripts/master/raspberry.sh)"

Screenshot_20220503-185405_Termux
Screenshot_20220503-184919_VNC Viewer

i don't think that is the legacy pi os image.. i think that is bullseye.. needs to be buster for pi0w..
Screenshot_2022-05-03_08-27-25

weird.. never seen chromium do this on buster, happens all the time on bullseye on pi0w

ok do this..

pm2 stop all
cd ~
rm -rf .config/chromium

done shall I start using

pm2 start all

no, have to do

pm2 start 0

all only works on stop i think

still the same
Screenshot_20220503-184919_VNC Viewer

and if u click on the MagicMirror icon it should display

i don't know what causes this

did that rm command end with no messages?

try this

nano ~/MagicMirror/run-start.sh

on line 92

change the end of the line from this

--ignore-ssl-errors --ignore-certificate-errors 2>/dev/null

to this

--ignore-ssl-errors --ignore-certificate-errors --new-window 2>/dev/null

then pm2 restart 0

weird.. never seen chromium do this on buster, happens all the time on bullseye on pi0w

ok do this..

pm2 stop all
cd ~
rm -rf .config/chromium

here is the log https://pastebin.com/8X942LRa

try this

nano ~/MagicMirror/run-start.sh

on line 92

change the end of the line from this

--ignore-ssl-errors --ignore-certificate-errors 2>/dev/null

to this

--ignore-ssl-errors --ignore-certificate-errors --new-window 2>/dev/null

then pm2 restart 0

Still the same

Screenshot_20220503-204305_VNC Viewer

but if i access url it's working fine

wild..

do this

cd ~
ls .config/c* -laF

yes, for some reason chromium has decided that the URL provided is not to be opened...

I am using the same script on my pi0w and it worked great.. (on saturday ran another install test)

.config/chromium:
total 5244
drwx------ 28 pi pi 4096 May 3 21:31 ./
drwx------ 12 pi pi 4096 May 3 21:34 ../
drwx------ 2 pi pi 4096 May 3 21:29 AutofillRegex/
drwx------ 2 pi pi 4096 May 3 21:29 AutofillStates/
-rw------- 1 pi pi 4194304 May 3 21:31 BrowserMetrics-spare.pma
drwx------ 2 pi pi 4096 May 3 21:29 CertificateRevocation/
drwx------ 2 pi pi 4096 May 3 21:29 ClientSidePhishing/
-rw------- 1 pi pi 1048576 May 3 21:31 CrashpadMetrics-active.pma
drwx------ 6 pi pi 4096 May 3 21:29 'Crash Reports'/
drwx------ 2 pi pi 4096 May 3 21:29 'Crowd Deny'/
drwx------ 22 pi pi 4096 May 3 21:31 Default/
drwx------ 2 pi pi 4096 May 3 21:29 DesktopSharingHub/
drwx------ 2 pi pi 4096 May 3 21:30 Dictionaries/
drwx------ 2 pi pi 4096 May 3 21:29 FileTypePolicies/
drwx------ 2 pi pi 4096 May 3 21:29 FirstPartySetsPreloaded/
-rw-r--r-- 1 pi pi 0 May 3 21:29 'First Run'
drwx------ 2 pi pi 4096 May 3 21:29 Floc/
drwx------ 3 pi pi 4096 May 3 21:30 GrShaderCache/
drwx------ 2 pi pi 4096 May 3 21:29 hyphen-data/
-rw-r--r-- 1 pi pi 12 May 3 21:29 'Last Version'
-rw------- 1 pi pi 6242 May 3 21:31 'Local State'
drwx------ 2 pi pi 4096 May 3 21:29 NativeMessagingHosts/
drwx------ 3 pi pi 4096 May 3 21:31 OnDeviceHeadSuggestModel/
drwx------ 3 pi pi 4096 May 3 21:31 OptimizationHints/
drwx------ 2 pi pi 4096 May 3 21:29 OriginTrials/
drwx------ 2 pi pi 4096 May 3 21:29 'Safe Browsing'/
drwx------ 2 pi pi 4096 May 3 21:29 SafetyTips/
drwx------ 3 pi pi 4096 May 3 21:29 ShaderCache/
lrwxrwxrwx 1 pi pi 20 May 3 21:29 SingletonCookie -> 13878286093735246143
lrwxrwxrwx 1 pi pi 14 May 3 21:29 SingletonLock -> Dashboard-2588
lrwxrwxrwx 1 pi pi 50 May 3 21:29 SingletonSocket -> /tmp/.org.chromium.Chromium.KO42es/SingletonSocket
drwx------ 2 pi pi 4096 May 3 21:29 SSLErrorAssistant/
drwx------ 4 pi pi 4096 May 3 21:30 'Subresource Filter'/
drwx------ 2 pi pi 4096 May 3 21:29 TrustTokenKeyCommitments/
drwx------ 2 pi pi 4096 May 3 21:29 WidevineCdm/
drwx------ 2 pi pi 4096 May 3 21:29 ZxcvbnData/

.config/configstore:
total 12
drwx------ 2 pi pi 4096 May 2 22:24 ./
drwx------ 12 pi pi 4096 May 3 21:34 ../
-rw------- 1 pi pi 55 May 2 22:24 update-notifier-npm.json

still, it has 2 browser opened

explain that?

1 with the chromium desktop and 1 with the MM after click on icon?

yes one with chromium desktop and one with MM but everytime it restart or if I make change it change back to chromium desktop

yes, when u make change to config.js, pm2 detects change and restarts for you..

I don't know on the chromium problem cause the last workaround, deleting the .config folder has worked for everyone else..

is there any way to change the browser permanently? or some other solution

@mrfoxie yes, but you will have to edit the run-start.sh script to change it.

mm normally runs the electron js browser but they stopped building it for armv6l devices about 2 years ago. but chromium runs.

so I built the run-start script to launch mm in server mode, and then launch chromium over it.

I do not have any other browser experience on pi so I do not know what would work

I was thinking that buster desktop version is little bit heavy for pi0w can we do it on lite core cli version?

no. browser needs graphics to draw everything..

u could run server somewhere else but still need graphics on the pi.
you could server mode on the pi and display somewhere else...in graphics mode

in short I'm stuck is there any place where I can contact you and have conversation there?

I am in the US central timezone

I am in the US central timezone

ok but I'm unable to solve the error of 2 Chrome windows ๐Ÿ˜ญ๐Ÿ˜ญ๐Ÿ˜ญ

@mrfoxie yes, but you will have to edit the run-start.sh script to change it.

mm normally runs the electron js browser but they stopped building it for armv6l devices about 2 years ago. but chromium runs.

so I built the run-start script to launch mm in server mode, and then launch chromium over it.

I do not have any other browser experience on pi so I do not know what would work

can we change from chromium-browser to midori browser

Midori sure , edit the run-start to open Midori instead of chromium

Midori sure , edit the run-start to open Midori instead of chromium

i have installed Midori browser and change 91 line in run-start.sh from this

b='chromium-browser'

to this

b='midori'

but now its not starting

and u have to change parms to whatever Midori needs from command line too

if you go to command prompt and enter midori
does it start? as I said, I don't know anything about Midori

the literals for chromium/chromium-browser are because different systems use a different name for the same thing.

my script rus on pi and any Linux

i don't know why does it always start with 2 browsers ๐Ÿ˜‘๐Ÿ˜‘๐Ÿ˜‘๐Ÿ˜‘๐Ÿ˜‘๐Ÿ˜‘๐Ÿ˜‘๐Ÿ˜‘

it only opens the chromium desktop, right. then you have to click to.open another page, right?

no when I run the script on fresh installed os then it's run perfect with single browser but say for example if power cut off and comes back so basically pi boot up again then it's starts 2 Chrome browser which first one is blank chrome home page like this

Screenshot_20220503-184919_VNC Viewer

and how do u get rid of that page?

still not found ๐Ÿ˜ซ๐Ÿ˜ซ

stop magic mirror, ctrl-c or pm2 stop all

cd ~/MagicMirror
bash -x run-start.sh

this will execute the script in debug mode so you can see the results of all commands etc

you can write it to a file with 2&>somefile.txt

wait 10 seconds, then ctrl-c
and the edit somefile.txt to see what is going on

stop magic mirror, ctrl-c or pm2 stop all

cd ~/MagicMirror
bash -x run-start.sh

this will execute the script in debug mode so you can see the results of all commands etc

you can write it to a file with 2&>somefile.txt

wait 10 seconds, then ctrl-c and the edit somefile.txt to see what is going on

here is the log

> cat run.log
libEGL warning: DRI2: failed to authenticate
[2016:2135:0505/140104.735365:ERROR:bus.cc(393)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[2016:2135:0505/140104.736647:ERROR:bus.cc(393)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[2016:2135:0505/140107.061672:ERROR:bus.cc(393)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[2016:2135:0505/140107.068265:ERROR:bus.cc(393)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[0505/140119.570093:ERROR:elf_dynamic_array_reader.h(61)] tag not found
[0505/140119.770708:WARNING:exception_snapshot_linux.cc(427)] Unhandled signal -1
[2016:2118:0505/140120.101836:ERROR:gpu_process_host.cc(995)] GPU process exited unexpectedly: exit_code=512
libEGL warning: DRI2: failed to authenticate
[2186:2186:0505/140132.961212:ERROR:gpu_init.cc(441)] Passthrough is not supported, GL is egl
[2186:2186:0505/140133.230388:ERROR:viz_main_impl.cc(162)] Exiting GPU process due to errors during initialization
[2324:2324:0505/140133.645356:ERROR:gpu_init.cc(441)] Passthrough is not supported, GL is swiftshader

where is that from? should be looking at somefile.txt. none of that looks like output of run-start

where is that from? should be looking at somefile.txt. none of that looks like output of run-start

I changed this 94 line from run-start.sh

"$b" -noerrdialogs -kiosk -start_maximized  --disable-infobars --app=http://localhost:$port  --ignore-certificate-errors-spki-list --ignore-ssl-errors --ignore-certificate-errors 2>/dev/null

to this

"$b" -noerrdialogs -kiosk -start_maximized  --disable-infobars --app=http://localhost:$port  --ignore-certificate-errors-spki-list --ignore-ssl-errors --ignore-certificate-errors 2>/home/pi/run.log

ok.. WAY BEFORE editing run start, you should practice at the command line how to launch Midori and what parms are needed.

once you got it so that it works at the command, THEN change the run-start script to match what u did manually

npm run server

that will start mm in server mode

now launch Midori to connect to the localhost:port that mm is configured for

no im using your script only because I don't know how to launch midori browser so I left as it is

open a command prompt and type
midori xxx you zzz m.....
with whatever parms Midori needs to run

google Midori parameters

the command is

midori --app=http://localhost:80o0 -e fullscreen

you ARE running server-only under the covers

the WHOLE point of run-start is to fix the lack of a supplied electron browser
so i start mm in server-only mode
and then launch a browser over that

so if b =="midori" then use that command instead of the chromium command

i fixed run-start for you do

cd ~/MagicMirror
curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror_scripts/master/run-start.sh >run-start.sh

then to use midori

edit the installers/mm.sh (used by pm2 starting) and add

external_browser=midori

before the npm start

to test from the commandline

external_browser=midori

then npm start

i fixed run-start for you do

cd ~/MagicMirror
curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror_scripts/master/run-start.sh >run-start.sh

then to use midori

edit the installers/mm.sh (used by pm2 starting) and add

external_browser=midori

before the npm start

to test from the commandline

external_browser=midori

then npm start

it works but when I edit then it opens 2 browsers so I have to stop by pm2 and restart it

pm2 watches for config.js changes and restarts mm

maybe it cant kill Midori?

hmm

do pm2 save after starting.i think it needs to see Midori as part of the process tree..

i don't have a system that updates on change.. same setup, never works..

but pm2 restart x works stops midori and restarts (without doing the pm2 save)

let me give it a shot on fresh installation of pi0w

make sure install Midori

make sure install Midori

on first initial boot it's starts with 2 browser of chrome and when I restart it's start with Midori that's a little bit strange ๐Ÿค”๐Ÿค”

hey i got a question what I'd remove chrome browser and then give it a restart will it work?

should work. shouldn't launch chrome now...

should work. shouldn't launch chrome now...

it was a bad Idea, is there any way to create iso or img file from install os so that I can send it to you

should work. shouldn't launch chrome now...

Hey, I don't know what happened but it's now working properly. Thank you