seb-ma / eInkFrame

A step by step guide to create a weather station (and more) in e-ink frame running with MagicMirror².
19 stars 0 forks source link

Guide #1

Closed sdmydbr9 closed 1 year ago

sdmydbr9 commented 1 year ago

Hi, wonderful project, after seeing this project being beautifully made, I bought myself an eink display and I'm attempting to build one, unfortunately I'm having a hard time following along. I have installed everything as per instructions in the readme, how do I run it now? If you could elaborate it step by step, it would be really helpful

seb-ma commented 1 year ago

Hello, If you want help, you'll have to be more precise on your problem. I already wrote a guide (one for hardware and one for software). And I thought the software part (https://github.com/seb-ma/eInkFrame/blob/master/software.md) was quite explicit for each step from scratch.

What step causes you trouble?

sdmydbr9 commented 1 year ago

Okay so I have installed and successfully ran the server in the background. I also have the display connected and configured. How do I proceed from here? Pardon me if I sound dumb but this is not really my area and this is my first time using the e ink display.
I already have the sever running in the background. Now how do I get it to display it on the e ink? Is there a particular script for this or do I run npm start in the einkframe folder?

seb-ma commented 1 year ago

Have you already tested your eink to be sure it works? If no, follow the procedure here: https://github.com/seb-ma/eInkFrame/blob/master/hardware.md#test-waveshare-e-ink

A drawback to the driver is that it needs to be run as root. So, MagicMirror must be run by root user.

Another point to check is the compilation of module MMM-IT8951 that I use in MagicMirror to display on eink (see readme of https://github.com/seb-ma/MMM-IT8951).

And when running magicmirror, check logs to get information on errors/warnings that can help understand the problem.

sdmydbr9 commented 1 year ago

Yes I have run the test script and it runs, and I have compiled the modules. My confusion is if I need to start the part separately for refreshing the display. And the part about running as root, do I just add the serveruser or do I use the existing root user instead of adding the serverusr, but as you mentioned the MagicMirror won’t run as root, I am instead trying to give the privilege to the ‘pi’ user instead, I tried this and still haven’t got it to work, the server seems to be running fine. If you could run me through once again it would be really helpful. Objective:- to use the pi as the user and grant it the necessary privileges to access the kmem.

I have so far done the following steps.

  1. Install necessary packages and configuration settings for the pi.
  2. Installation of MagicMirror and modules.
  3. Sever running on localhost8080 serveronly.
  4. How do I connect to the server from the display, I can connect with the server using my phone or the laptop. Or is the script automatic like the original magic mirror script that I wouldn't need to do anything and will update on its own?
seb-ma commented 1 year ago

You made a confusion: in my guide, I added a disclaimer to say that it "works but only with the root user." I spent a lot of hours and tried many things but nothing else than running MagicMirror with the root user works. So, when the guide mentions "serverusr", replace it with "root". Sorry for the confusion.

Now, about displaying on eink: running MagicMirror is enough and you don't have anything else to run. Some explanations about the "magic" under the hood: The module MMM-IT8951 starts a Chrome browser that connects to MagicMirror server and set a script on page to observe DOM modifications (display changes). When page's DOM changes, it triggers the MM module. The module takes a screenshot of the modified area and sends this image to eink screen thanks to the driver "node-it8951".

Before running MagicMirror as a service, you must ensure that it works when you run it "manually". It will give you useful information if something goes wrong. So, stop the service (if running) then go root and start MagicMirror: sudo systemctl stop magicmirror.service sudo su npm run server

Finally, when you're sure it works manually, you have nothing to do if the service is active. This is the service that starts MagicMirror when the Raspberry is started.

seb-ma commented 1 year ago

@sdmydbr9 Have you solved your problem now?

sdmydbr9 commented 1 year ago

Yes. It seems to be an issue with the it8951 board. I switched to using another script, not very interactive but does the work. Maybe I will have to get a new board and then try again. Sorry about all the fuzz🙂

seb-ma commented 1 year ago

Happy to know. I close the issue. Let me know if something else causes you trouble.

Have fun with your project.