tjohn327 / raspberry_pi_ups

An uninterruptible power supply for Raspberry Pi that can provide more than an hour of backup power and can shutdown the Pi safely.
MIT License
90 stars 32 forks source link

Device and service failed to run #3

Closed allibragi closed 4 years ago

allibragi commented 4 years ago

Hi, I'm trying to setup the powerpi on a Banana PI PRO and, aside that the board is not supported, I'm facing 2 issues:

ups.service - UPS Service Loaded: loaded (/lib/systemd/system/ups.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Wed 2020-08-12 19:43:42 UTC; 16s ago Process: 1660 ExecStart=/usr/bin/python /home/banano/raspberry_pi_ups/src/ups.py (code=exited, status=1/FAILURE) Main PID: 1660 (code=exited, status=1/FAILURE) Aug 12 19:43:41 bananapipro systemd[1]: ups.service: Unit entered failed state. Aug 12 19:43:41 bananapipro systemd[1]: ups.service: Failed with result 'exit-code'. Aug 12 19:43:42 bananapipro systemd[1]: ups.service: Service hold-off time over, scheduling restart. Aug 12 19:43:42 bananapipro systemd[1]: Stopped UPS Service. Aug 12 19:43:42 bananapipro systemd[1]: ups.service: Start request repeated too quickly. Aug 12 19:43:42 bananapipro systemd[1]: Failed to start UPS Service. Aug 12 19:43:42 bananapipro systemd[1]: ups.service: Unit entered failed state. Aug 12 19:43:42 bananapipro systemd[1]: ups.service: Failed with result 'exit-code'.

Anyhow the shipping was perfect and I've received the board without any problems. Thank you!

tjohn327 commented 4 years ago

Hi,

Banana Pi is not supported by Power Pi for safe shutdown and status monitoring as it was never tested on it. But I guess this issue can be solved. Nevertheless Power Pi can still power the Banana Pi through the 5V rail of the 40 pin connector if BananaPi supports being powered through the 5V rail. Other wise you'll have to use the USB A output of Power Pi.

Check the ups.service file located at /lib/systemd/system/ups.service. See if the path to python and ups.py after the ExecStart part is correct. Also. check if the username is correct.

After correction, run the following:

sudo systemctl daemon-reload
sudo systemctl enable ups.service
sudo systemctl restart ups.service
allibragi commented 4 years ago

Hi,

I've found the error in the process, it wasn't t able to find the RPi.GPIO library. I've installed it from the manufacturer repo (http://wiki.lemaker.org/BananaPro/Pi:GPIO_library).

For the powering I'm using a cable through the USB port. I think it could be possible to power it through the pins but i can't find any hint (plus I'm not experienced in this field). If anyone should come through this post and knows how to do it let me know.

tjohn327 commented 4 years ago

Hi, Thank you very much for the feedback. Have you connected the Power Pi to BananaPi as a HAT using the 40 Pin connector? If so, I don't think you need the cable to Power it, just turn the switch on and it should start powering the Banana Pi.

allibragi commented 4 years ago

If i connect the Power Pi by the pins and flip the switch the Banana Pi simply don't turn on. The leds on the PowerPi shows that the battery is charging and that the output power is on. If I power the PI normally the process see the HAT and shows the battery time left and that its not charging (obviously).

tjohn327 commented 4 years ago

That means Banana Pi does not support powering it through the 5V pins of the 40 pin connector.

allibragi commented 4 years ago

I'll use it by the USB port, is not much a problem. I eventually switch to a PI 4. Thanks for the help.