Closed Coernel82 closed 1 year ago
There are more things unclear to me:
for pm2 start index.js --name "eink-update"
there must be https://github.com/BenRoe/rpi-magicmirror-eink installed, right?
So I have your RPi-MagicMirror-Waveshare folder and also the rpi-magicmirror-eink folder on my system.
Does your folder need to be inside the original folder? Like:
cd ~/rpi-magicmirror-eink
git clone https://github.com/winstonma/RPi-MagicMirror-Waveshare.git
I would be so happy if you could clarify the installation process!
@Coernel82 I updated README.md
Please let me know if this works for you
Thank you for the quick response however it does not work. Here is my setup:
pm2 list
showing:
id | name | namespace | version | mode | pid | uptime | ↺ | status | cpu | mem | user | watching |
---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | MagicMirror | default | 2.21.0 | fork | N/A | 0 | 0 | stopped | 0% | 0b | coernel | disabled |
5 | eink-update | default | N/A | fork | 4241 | 0s | 0 | online | 0% | 3.5mb | coernel | disabled |
1 | node | default | N/A | fork | 1007 | 18m | 0 | online | 0% | 17.9mb | coernel | disabled |
2 | serveronly | default | 2.21.0 | fork | 1013 | 18m | 0 | online | 0% | 60.2mb | coernel | disabled |
Magicmirror is working networkwide on http://magicmirror:8080
Small update: changing the address to http://magicmirror:8080/ in the config doesn't change anything. Localhost should be working anyways.
I came across the idea to directly start your file: python3 main.py
- just using python main.py
resulted in the error that selenium could not be imported.
I added some print('xyz')
to the code (that is all I can do in python - to see where the script stops. I can see that it successfully runs the while-loop which displays the screenshot - except that the screenshot won't show on the display.
After that I forced python3 as interpreter for pm: pm2 start main.py --name "eink-update" --interpreter python3
- no success either.
Using VS Code debuggin mode (which I have never used before) I cam acorrs the error:
Exception has occurred: NoSectionError
No section: 'Display'
During handling of the above exception, another exception occurred:
File "/home/coernel/RPi-MagicMirror-Waveshare/main.py", line 23, in <module>
refreshRate = config.getint('Display', 'refesh_rate')
Of course there is the section Display
in config.cfg ... so I hardcoded:
model = 'epd7in5_V2'
refreshRate = 180
And holy shhhh..... HALLELUJAH! I got a black / white flashing display for a second. Next error: No section 'MagicMirror in the config file. Hardcoding again. Restarting.
Again: flashin black white..... wait ... wait... screen turns black.
Console output: <PIL.PngImagePlugin.PngImageFile image mode=RGBA size=800x480 at 0x73D73268>
And then: I got my magic mirror (nearly) working. Now it is just a matter of scaling, everything simply is far to small.
Again: pm2 start main.py --name "eink-update" --interpreter python3
And here it also works.
Hope this helps in improving your script!
One important question: Waveshare says that the power has to be switched off after the screen update otherwise the screen gets damaged. Is this done?
One important question: Waveshare says that the power has to be switched off after the screen update otherwise the screen gets damaged. Is this done?
I am using waveshare-epaper
module in Python and I didn't know if it is switched off (I believe it would). In addition I modified the main.py
and added the partial refresh capability, so far my eink panel keeps working after one year.
This is my modified main.py, you can try to replace your main.py and update the refesh_rate
. But the partial refresh is not very good.
Good to hear that it works for you.
Also for the font setting, I created custom.css (in MagicMirror/css folder) and hope the setting works for you.
But it is weird that config.cfg doesn't work for you because it works on my side. Would you mind checking the Python version on your RPi? This is my output:
pi@raspberrypi:~/RPi-MagicMirror-Waveshare $ python --version
Python 3.9.2
pi@raspberrypi:~/RPi-MagicMirror-Waveshare $ pip --version
pip 20.3.4 from /usr/lib/python3/dist-packages/pip (python 3.9)
I think you are right that there are issues with different versions:
coernel@magicmirror:~/RPi-MagicMirror-Waveshare $ python --version && pip --version
Python 2.7.18
pip 20.3.4 from /usr/lib/python3/dist-packages/pip (python 3.9)
I investigated further, partially getting different results from yesterday as I did not always reboot yesterday an also getting different results today:
python
or pm2
pm2
deactivating and deleting eink-update and pm2 save
sudo reboot
direct execution such as: starting main.py
with python
= leaving blank, python2
and python
pm2 execution such as: pm2 start ~/RPi-MagicMirror-Waveshare/main.py --name "eink-update"
version | pm2 | direct execution |
---|---|---|
leaving blank | photocopy edges and pm2 eink-update "errored" | traceback (most recent call last): File "/home/coernel/RPi-MagicMirror-Waveshare/main.py", line 3, in <module> from selenium import webdriver ImportError: No module named selenium |
python2 | "photocopy" - see above | "selenium" - see above |
python3 | instead of black now a white screen | crash |
I did get it to work as well. It seems the errors are highly random and not reproducable so far.
After some research I found out that there are some fundamental differences in Phython 2 and Python 3. https://python-forum.io/thread-10832.html:
Try code like the following. Please note that you are using Python 2. For Python 3 'ConfigParser.' becomes lower case 'configparser.' (configparser dot) and import ConfigParser becomes import configparser
Thank you for the custom.css!
I have broken my system now completely. I will start with a clean install and report back to you later.
After a complete reinstall I found the solution:
Your script has the requirement that MagicMirror² is installed the default way and not using an installer script. Your script started working instantly. I make a pull request now.
In normal case the python version and the pip version should in sync with each other.
coernel@magicmirror:~/RPi-MagicMirror-Waveshare $ python --version && pip --version
Python 2.7.18
pip 20.3.4 from /usr/lib/python3/dist-packages/pip (python 3.9)
But your pip version and python version is different and that's why the pip installed modules (Python v3.9) can't be accessed by Python v2.7.
Also thanks for updating the README.md
as I was too lazy just put the working script onto this repo.