Open ILPlais opened 4 years ago
With the help of @sunfounder I installed the dependencies:
apt install python3-rpi.gpio python3-spidev
And after via pip3:
pip3 install spidev
pip3 install rpi.gpio
pip3 install RPi.GPIO2
But now I have the error:
root@DietPi:/opt/vc/bin/nas-kit# python3 /opt/vc/bin/nas-kit/main/raspi_omv_main.py &
[1] 4557
root@DietPi:/opt/vc/bin/nas-kit# Traceback (most recent call last):
File "/opt/vc/bin/nas-kit/main/raspi_omv_main.py", line 3, in <module>
import RPi.GPIO as GPIO
File "/usr/local/lib/python3.7/dist-packages/RPi/GPIO/__init__.py", line 8, in <module>
from RPi.core import\
File "/usr/local/lib/python3.7/dist-packages/RPi/core.py", line 59, in <module>
LOW = gpiod.Line.ACTIVE_LOW
AttributeError: module 'gpiod' has no attribute 'Line'
^C
[1]+ Exit 1 python3 /opt/vc/bin/nas-kit/main/raspi_omv_main.py
root@DietPi:/opt/vc/bin/nas-kit#
Someone help?
I'm currently stuck at the same point while trying to install on Debian.
I also had to install the following :
pip3 install gpiod
I managed to make it work today on my NAS Kit.
The only required Python dependencies are the following:
RPi.GPIO
spidev
:warning: You must NOT use Rpi.GPIO2
nor gpiod
. The script provided by SunFounder does not use these dependencies at all, only the ones listed above. If they are installed on your system, remove them:
sudo pip3 uninstall Rpi.GPIO2 gpiod
pip3 uninstall Rpi.GPIO2 gpiod
Make sure SPI is enabled on your Raspberry Pi:
ssh pi@your-ip-address
sudo raspi-config
5 Interfacing Options
and press EnterP4 SPI
and Press EnterYes
to the questionsudo reboot now
Clone this repo:
cd ~
git clone https://github.com/sunfounder/nas-kit
Go to nas-kit
root folder and execute setup:
cd ~/nas-kit
sudo python3 setup.py
(sudo is important, since this script is meant to run at startup later)That's all! You can now run the script.
cd ~/nas-kit
python3 main/raspi_omv_main.py
Note: To start omv-epd
at NAS startup:
ln -s /home/pi/nas-kit/bin/omv-epd /etc/init.d/omv-epd
sudo systemctl daemon-reload
sudo systemctl enable omv-epd
sudo systemctl start omv-epd
It should now start the NAS Kit EPD screen display at startup! :tada:
PS: This should be in a README in this repo, so it could help people.
PPS: I have opened #5, do not hesitate to comment/improve the documentation! :+1:
@thomasdom This is clearly an improvement on the problem, as I get the fans to work this way.
I'm still having an issue with the screen that is briefly blinking, then stays white. I get an error from the command python3 main.raspi_omv_main.py
pi@raspberrypi:~nas-kit $ python3 main/raspi_omv_main.py
Exception in thread Thread-1
Traceback (most recent call last):
File "/usr/lib/python3.7/threading.py", line 917, in _boostrap_inner
self.run()
File "/usr/lib/python3.7/threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "main/raspi_omv_main.py", line 312, in main
page(current_page)
File "/home/pi/nas-kit/main/page.py", line 76, in __call__
eval(cmd)
File "<string>", line 1, in <module>
File "/home/pi/nas-kit/main/page.py", line 99, in page_1_update
pi_msg = pi_read()
File "/home/pi/nas-kit/main/page.py", line 150, in pi_read
"cpu_usage": cpu_usage(),
File "/home/pi/nas-kit/main/page.py", line 106, in cpu_usage
result = round(100 - float(result), 2)
ValueError: could not convert string to float: '80,35'
This seems to be an error with the locale number format, as the number use a ,
as a decimal and not a .
.
Using raspi-config
to revert back to en_US
locale is a workaround. The screen now works.
Still, there is room for improvement here.
Using raspi-config to revert back to en_US locale is a workaround. The screen now works. Still, there is room for improvement here.
Agree! This should be addressed in a separate issue to facilitate tracking of bugs/improvements :+1:
I created a new issue for that locale problem.
I'm still having an issue with the launch at startup (on a fresh install of raspbian). If I follow your guide:
ln -s /home/pi/nas-kit/bin/omv-epd /etc/init.d/omv-epd
sudo systemctl daemon-reload
sudo systemctl enable omv-epd
sudo systemctl start omv-epd
I cannot make the link (1.) without sudo
(but it works with sudo). The second command works fine (without any message). The third command is giving me a message:
bleu@raspberrypi:~/nas-kit $ sudo systemctl enable omv-epd
omv-epd.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable omv-epd
The fourth command gives me an error:
bleu@raspberrypi:~/nas-kit $ sudo systemctl start omv-epd
Failed to start omv-epd.service: Unit omv-epd.service not found.
Any idea about this one ?
Hi, for this:
bleu@raspberrypi:~/nas-kit $ sudo systemctl start omv-epd Failed to start omv-epd.service: Unit omv-epd.service not found.
I do this: Chmod u+x /to_the_path/omv-epd
Now start service by:
sudo /to_the_path/omv-epd start
And reboot your raspberry and it's working.
@nostromo1st you are right, I forgot to make the file executable, which was the cause of my problem.
Hello,
I tried to install the NAS Kit on a DietPi distribution on my SunFounder Kit. But I have this error:
Here the line on bug: https://github.com/sunfounder/nas-kit/blob/bc9bebcdc0120914d5c7409b1a9121d8f11fc235/lib/epd_lib/epdconfig.py#L50
Good luck!