Gulivertx / cbatmo

A Netatmo Weather Station Web-APP for Raspberry Pi & official Raspberry touchscreen

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

problem with yarn install --production

karba71 opened this issue · comments

commented

Hello,

thanks for update this project!!!

I create the archive cbatmo to my raspi and unzip.
Then i get this:

/home/pi/cbatmo$ yarn install --production
-bash: Zeile 10: yarn: Kommando nicht gefunden.

What is the Problem?

Is yarn installed in your system?

commented
commented

Hello Cedric,

i think i have install yarn on my raspi.
I do this directly on the raspi, not over ssh.

And now i have this result:

/home/pi/cbatmo$ systemctl status cbatmo.service
● cbatmo.service - CBatmo WEB server
Loaded: loaded (/etc/systemd/system/cbatmo.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Mon 2020-05-25 23:11:47 CEST; 4s ago
Process: 897 ExecStart=/usr/bin/yarn start (code=exited, status=217/USER)
Main PID: 897 (code=exited, status=217/USER)

commented

Hello,

I have fixed my mistake within rpi/cbatmo.service.
User and group are pi now.

[Service]

Start the js-file starting the express server

ExecStart=/usr/bin/yarn start
WorkingDirectory=/home/pi/cbatmo
Restart=always
RestartSec=10
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=CBatmo

Change to a non-root user (optional, but recommended)

User=pi
Group=pi

Set environment options

Environment=NODE_ENV=production PORT=3000

And the result:
/home/pi/cbatmo$ systemctl status cbatmo.service
● cbatmo.service - CBatmo WEB server
Loaded: loaded (/etc/systemd/system/cbatmo.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Tue 2020-05-26 19:59:27 CEST; 6s ago
Process: 1876 ExecStart=/usr/bin/yarn start (code=exited, status=203/EXEC)
Main PID: 1876 (code=exited, status=203/EXEC)

What is the Problem?

THX karba

ok, could be a lot of different things...

Please try to run the server from command line without using systemd now.
Just go to your cbatmo folder then yarn run start.
What is the result of this command ?

commented
commented

When i check http://localhost:3000 on my raspi:

Failed to lookup view "index" in views directory "home/pi/cbatmo/views"

This Directory only contains a file error.ejs

This is because there is no build, unfortunately you can not build the app from a raspberry, node-sass is not compatible with arm processor (I did not check if it is still the case but I assume that it is).
You must build the app from a x86 / x64 processor has intel or amd.

Please follow the guide in the Readme to build your app and at the end copy the build result, everything should be well explain in the readme.

The best way if you are not confortable to build and copy from another computer is to use a MacOS or Linux system and the deploy script in the rpi folder for an auto deployment. Good luck.
Maybe if you work from windows, installing bash for windows could make the script also working from this system, I never try but sure you can on windows install a Linux subsystem with wsl and have a full linux where the script will work.

commented

Hello,

i've got it:

/home/pi/cbatmo$ sudo cp rpi/cbatmo.service /etc/systemd/system/
/home/pi/cbatmo$ sudo systemctl enable cbatmo.service
/home/pi/cbatmo$ sudo systemctl restart cbatmo.service
/home/pi/cbatmo$ systemctl status cbatmo.service
● cbatmo.service - CBatmo WEB server
Loaded: loaded (/etc/systemd/system/cbatmo.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2020-05-28 02:09:36 CEST; 16s ago
Main PID: 4755 (node)
Tasks: 23 (limit: 2200)
Memory: 61.6M
CGroup: /system.slice/cbatmo.service
├─4755 node /usr/share/yarn/bin/yarn.js start
├─4779 /bin/sh -c node server.js
└─4780 /usr/bin/node server.js

Mai 28 02:09:36 raspberrypi systemd[1]: Started CBatmo WEB server.
Mai 28 02:09:40 raspberrypi CBatmo[4755]: yarn run v1.22.4
Mai 28 02:09:40 raspberrypi CBatmo[4755]: $ node server.js
Mai 28 02:09:45 raspberrypi CBatmo[4755]: Server running on http://localhost:3000 as production

cbatmo is running, but how can i login?

???? my mail-adress
???? my passwort
???? ????

Nice! The last field is your app secret that you specified in your .env

commented

First: app_secret in .env cannot by empty, I do not allow null value, sorry, so on your Raspi specify a secret key, what you want, then restart the server from systemctl.
After that it should works.

Second: For your windows problem, could you please tell me what is your web browser and the version.

commented

Ha yes I do not support this IE11 dinosaur 🙂 which should not by used anymore!

For kiosk mode in the rpi folder there is scripts for what you want running on Weston / Wayland.

commented

changing the data in graph is just by clicking any values.

you said : Can you integrate this status-informations?
What are you talking about ? There is no pictures in your message.

commented

Hello Cedric,

changing the data in graph:
I can take data from the 2. indoor-module (temp, CO2, acoustic), the the outdoor-module (temp, humidity, pressure), the rain-sensor and the wind-sensor.

But, if i take any data from the main-module cbatmo breakes.

The graph will store which data i select, but not the time (12 hour, 1 day or 1 month).
It starts every time with 12 hour.

I think at the rain-gauge is a unit slips:

Regensensor_02

karba

Could you open a new issue for the rain unit?