Zaitchik
Posts: 10
Joined: Wed May 01, 2019 5:53 pm

Raspberry PI 3B+ and NUT (Network UPS Tools)

Thu May 16, 2019 12:39 pm

Hello to all.

I have a Powercom SPD-850U UPS. After many attempts to make friends with this UPS with my Raspberry PI 3B + via NUT, I came to the conclusion - NUT works great with Raspbian (2018-03-13), the first one that supports 3B +, but does not work well with the latest version of Raspbian (2019-04- 08).

Until the last update, the latest version of Raspbian did not work with NUT at all. Now the NUT driver can only be started after manually reconnecting the USB connector after each restart of the Raspberry. This is progress, but not a solution to the problem.

The trouble is a fact.
If the developers are reading this forum, maybe they will tell me how to run the latest version of Raspbian in compatibility mode with the previous algorithm of USB ports? "Nuclear option" - dwc_otg.speed = 1 in /boot/cmdline.txt has no effect.

I am sorry, I missed one important detail. When the last Raspbian (2019-04-08) is used, reconnecting the USB connector is effective only when Rasspberry starts up without an ethernet cable.
Last edited by Zaitchik on Thu May 16, 2019 2:25 pm, edited 1 time in total.

User avatar
B.Goode
Posts: 14317
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Raspberry PI 3B+ and NUT (Network UPS Tools)

Thu May 16, 2019 2:06 pm

Raspbian is probably only one of many platforms that the developers of NUT support, so maybe they don't monitor this forum.

You might be more certain of your problem coming to their attention if you use either the NUT Users mailing list http://lists.alioth.debian.org/mailman/ ... ut-upsuser or the NUT Developers mailing list http://lists.alioth.debian.org/mailman/ ... nut-upsdev

Zaitchik
Posts: 10
Joined: Wed May 01, 2019 5:53 pm

Re: Raspberry PI 3B+ and NUT (Network UPS Tools)

Thu May 16, 2019 2:22 pm

B.Goode wrote:
Thu May 16, 2019 2:06 pm
I appeal specifically to the developers of Raspbian.

If something worked before, but now it does not work, it was obviously broken by those who changed something. NUT has not changed for a very long time.

I read a great discussion of problems with ethernet speed. Probably solving one problem gave rise to another problem.

User avatar
B.Goode
Posts: 14317
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Raspberry PI 3B+ and NUT (Network UPS Tools)

Thu May 16, 2019 4:14 pm

I have drawn your post to the attention of the forum Moderator, since it is unlikely that the Raspberry Pi Foundation developers will be aware of it otherwise.

But I wonder if your problems might be power supply related? (Recursive joke not intended.)

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 31502
Joined: Sat Jul 30, 2011 7:41 pm

Re: Raspberry PI 3B+ and NUT (Network UPS Tools)

Thu May 16, 2019 6:27 pm

Zaitchik wrote:
Thu May 16, 2019 2:22 pm
B.Goode wrote:
Thu May 16, 2019 2:06 pm
I appeal specifically to the developers of Raspbian.

If something worked before, but now it does not work, it was obviously broken by those who changed something. NUT has not changed for a very long time.

I read a great discussion of problems with ethernet speed. Probably solving one problem gave rise to another problem.
Please create an issue on our issue tracker on github. You need the Linux repo here https://github.com/raspberrypi/linux
Principal Software Engineer at Raspberry Pi Ltd.
Working in the Applications Team.

Zaitchik
Posts: 10
Joined: Wed May 01, 2019 5:53 pm

Re: Raspberry PI 3B+ and NUT (Network UPS Tools)

Sat May 18, 2019 11:45 am

jamesh wrote: Please create an issue on our issue tracker on github. You need the Linux repo here https://github.com/raspberrypi/linux
I tried.
My God! That's where it is - the hell of "free software"!
B.Goode wrote:
Thu May 16, 2019 4:14 pm
But I wonder if your problems might be power supply related?
It is unlikely that the "power supply" problems are first absent on the old version of the operating system, and then suddenly appear on the new one. No reports of problems with the power source is displayed.

By the way ...
Maybe someone knows. Is there a way to run RPI 3B + in 3B mode? Google says, dudes successfully used NUT in November 2018. But they did not indicate which version of Raspberry was used. And since on RPI 3B + this is only possible on Raspbian (2018-03-13), I guess they used an earlier version of Raspberry Pi
Last edited by Zaitchik on Sat May 18, 2019 5:48 pm, edited 1 time in total.

User avatar
B.Goode
Posts: 14317
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Raspberry PI 3B+ and NUT (Network UPS Tools)

Sat May 18, 2019 11:52 am

I have tried to put you in contact with the Raspberry Pi Foundation. I have nothing further to contribute.

Zaitchik
Posts: 10
Joined: Wed May 01, 2019 5:53 pm

Re: Raspberry PI 3B+ and NUT (Network UPS Tools)

Tue Jun 25, 2019 2:38 pm

Hey somebody! Can I hope the problem will ever be fixed?

BlueFyre
Posts: 5
Joined: Tue Jun 25, 2019 9:28 pm

Re: Raspberry PI 3B+ and NUT (Network UPS Tools)

Wed Jun 26, 2019 12:00 am

I've got the same issue. Some amount of restarting nut-server and nut-client (and others) might cause the connection to be reestablished (but it doesn't always work). I sometimes have to go physically replug the USB connection to get it working again

RonR
Posts: 2908
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Raspberry PI 3B+ and NUT (Network UPS Tools)

Sun Jul 28, 2019 9:32 am

I've been using NUT on 3 Raspberry Pi's for over a year now and haven't had any connection/communications problems using any version of Raspbian Stretch or Buster. The server runs on a 3B+ and I have another 3B+ and a 4B as clients. The UPS is a CyberPower CP1350PFCLCD. Power failures are not uncommon here and NUT has performed perfectly.

I wrote the attached scripts to automate the installation and removal of NUT (run them as root or with sudo). See the enclosed nut.txt for details.
Attachments
nut.zip
(2.85 KiB) Downloaded 383 times
Last edited by RonR on Thu Apr 30, 2020 10:51 pm, edited 1 time in total.

Zaitchik
Posts: 10
Joined: Wed May 01, 2019 5:53 pm

Re: Raspberry PI 3B+ and NUT (Network UPS Tools)

Thu Aug 08, 2019 11:35 am

Guys !! There is a way to get NUT to work on Raspberry 3B +. The developer advised.
https://github.com/raspberrypi/linux/issues/2977
I quote:
  "Simply add dtoverlay = dwc2 to config.txt and reboot."

Zaitchik
Posts: 10
Joined: Wed May 01, 2019 5:53 pm

Re: Raspberry PI 3B+ and NUT (Network UPS Tools)

Thu Aug 08, 2019 1:01 pm

RonR wrote:
Sun Jul 28, 2019 9:32 am
The UPS is a CyberPower CP1350PFCLCD. Power failures are not uncommon here and NUT has performed perfectly.
This UPS is of a higher class than mine ... maybe it has a faster USB port. Perhaps the optimized Raspbian driver was not fully compatible only with slow devices.

By the way, the developer warned that the above solution leads to a decrease in the speed of USB.

jeanrocco
Posts: 9
Joined: Sun Jan 27, 2013 4:11 pm

Re: Raspberry PI 3B+ and NUT (Network UPS Tools)

Sun Dec 08, 2019 4:28 am

This is to thank RonR for his script (https://www.raspberrypi.org/forums/down ... p?id=31259) to install NUT on a RPI, in my case a model 3B V1.2 with an old but still working Tripplite SMART750USB . This is the first intelligible walkthrough I came across to untangle "nut"'s config chaos ... what a major pain for such a simple goal !!! Reading the script is very instructive. Using the script "as is" worked partly, I only had to rename the server to tripplite_usb, no problem there, but I still have to use "upsdrvctl start" and "upsd" manually to get it running. In fact, I'm using under root "crontab -e: @reboot /bin/sleep 10; /sbin/upsdrvctl start; /sbin/upsd" to get the whole thing to behave at reboot. It works for me this way, and I'm too pissed to learn why this pesky app. is giving me such troubles !!! I"m not publishing this to complain, .... well not entirely true..., but to share my experience with other users and maybe come across someone smarter who can figure it out. jrb.

jeanrocco
Posts: 9
Joined: Sun Jan 27, 2013 4:11 pm

Re: Raspberry PI 3B+ and NUT (Network UPS Tools)

Sun Dec 08, 2019 4:45 am

RonR wrote:
Sun Jul 28, 2019 9:32 am

I wrote the attached scripts to automate the installation and removal of NUT (run them as root or with sudo). See the enclosed nut.txt for details.
This is to thank RonR for his script (https://www.raspberrypi.org/forums/down ... p?id=31259) to install NUT on a RPI, in my case a model 3B V1.2 with an old but still working Tripplite SMART750USB . This is the first intelligible walkthrough I came across to untangle "nut"'s config chaos ... what a major pain for such a simple goal !!! Reading the script is very instructive. Using the script "as is" worked partly, I only had to rename the server to tripplite_usb, no problem there, but I still have to use "upsdrvctl start" and "upsd" manually to get it running. In fact, I'm using under root "crontab -e: @reboot /bin/sleep 10; /sbin/upsdrvctl start; /sbin/upsd" to get the whole thing to behave at reboot. It works for me this way, and I'm too pissed to learn why this pesky app. is giving me such troubles !!! I"m not publishing this to complain, .... well not entirely true..., but to share my experience with other users and maybe come across someone smarter who can figure it out. jrb.

RonR
Posts: 2908
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Raspberry PI 3B+ and NUT (Network UPS Tools)

Sun Dec 08, 2019 6:07 am

jeanrocco wrote:
Sun Dec 08, 2019 4:45 am
This is to thank RonR for his script (https://www.raspberrypi.org/forums/down ... p?id=31259) to install NUT on a RPI, in my case a model 3B V1.2 with an old but still working Tripplite SMART750USB .
...
Using the script "as is" worked partly, I only had to rename the server to tripplite_usb, no problem there,...

According to the NUT Hardware compatibility list, you should NOT have changed the driver from usbhid-ups to tripplite_usb for the SMART750USB. What caused you to make that change?

jeanrocco
Posts: 9
Joined: Sun Jan 27, 2013 4:11 pm

Re: Raspberry PI 3B+ and NUT (Network UPS Tools)

Sun Dec 08, 2019 7:20 am

[/quote]

According to the NUT Hardware compatibility list, you should NOT have changed the driver from usbhid-ups to tripplite_usb for the SMART750USB. What caused you to make that change?
[quote/]
"upsdrvctl start" told me usbhid-usb was not working and that i should use tripplite-usb for this ups, even though the doc. says otherwise and using your script unmodified, it failed to work of course.
I don't know where to look to resolve the manual restart of the driver and upsd, "ps aux" initially shows upsd belonging to root but after a manual restart another upsd process belongs to nut, I can come up with better data if you want.
jrb.

sorry for my poor text formatting...

RonR
Posts: 2908
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Raspberry PI 3B+ and NUT (Network UPS Tools)

Sun Dec 08, 2019 8:18 am

@jeanrocco

You might try removing the "pollinterval = 5" line from /etc/nut/ups.conf and reboot.

If it still isn't happy, leave "pollinterval = 5" out and try switching back to the usbhid-ups driver.

jeanrocco
Posts: 9
Joined: Sun Jan 27, 2013 4:11 pm

Re: Raspberry PI 3B+ and NUT (Network UPS Tools)

Sun Dec 08, 2019 8:27 pm

RonR wrote:
Sun Dec 08, 2019 8:18 am
@jeanrocco

You might try removing the "pollinterval = 5" line from /etc/nut/ups.conf and reboot.

If it still isn't happy, leave "pollinterval = 5" out and try switching back to the usbhid-ups driver.
Ok, I tried that: "pollinterval =5" out with usbhid-ups driver...

sudo upsdrvctl start
Network UPS Tools - UPS driver controller 2.7.4
Network UPS Tools - Generic HID driver 0.41 (2.7.4)
USB communication driver 0.33
This Tripp Lite device (09ae/0001) is not supported by usbhid-ups.
Please use the tripplite_usb driver instead

sudo systemctl status nut-driver.service
● nut-driver.service - Network UPS Tools - power device driver controller
Loaded: loaded (/lib/systemd/system/nut-driver.service; static; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2019-12-08 14:06:38 EST; 11min ago
Process: 479 ExecStart=/sbin/upsdrvctl start (code=exited, status=1/FAILURE)

CPU: 50ms

Dec 08 14:06:38 raspberrypi3_b upsdrvctl[479]: Please use the tripplite_usb driver instead.
Dec 08 14:06:38 raspberrypi3_b upsdrvctl[479]: Network UPS Tools - Generic HID driver 0.41 (2.7.4)
Dec 08 14:06:38 raspberrypi3_b upsdrvctl[479]: USB communication driver 0.33
Dec 08 14:06:38 raspberrypi3_b upsdrvctl[479]: No matching HID UPS found
Dec 08 14:06:38 raspberrypi3_b upsdrvctl[479]: Driver failed to start (exit status=1)
Dec 08 14:06:38 raspberrypi3_b upsdrvctl[479]: Network UPS Tools - UPS driver controller 2.7.4
Dec 08 14:06:38 raspberrypi3_b systemd[1]: nut-driver.service: Control process exited, code=exited status=1
Dec 08 14:06:38 raspberrypi3_b systemd[1]: Failed to start Network UPS Tools - power device driver controller.
Dec 08 14:06:38 raspberrypi3_b systemd[1]: nut-driver.service: Unit entered failed state.
Dec 08 14:06:38 raspberrypi3_b systemd[1]: nut-driver.service: Failed with result 'exit-code'.

Next try with:
[pbx]
# driver = usbhid-ups
driver = tripplite_usb
port = auto
# pollinterval = 5

ps aux|grep nut
root 626 0.0 0.2 4984 2156 ? Ss 14:31 0:00 /lib/nut/upsmon
nut 627 0.0 0.4 7160 4188 ? S 14:31 0:00 /lib/nut/upsmon
pi 2326 0.0 0.0 4372 576 pts/0 S+ 14:32 0:00 grep --color=auto nut

ps aux|grep ups
root 626 0.0 0.2 4984 2156 ? Ss 14:31 0:00 /lib/nut/upsmon
nut 627 0.0 0.4 7160 4188 ? S 14:31 0:00 /lib/nut/upsmon
pi 2795 0.0 0.0 4372 548 pts/0 S+ 14:32 0:00 grep --color=auto ups

*** notice, upsd is not there...

and:

sudo systemctl status nut-driver.service
● nut-driver.service - Network UPS Tools - power device driver controller
Loaded: loaded (/lib/systemd/system/nut-driver.service; static; vendor preset: enabled)
Active: inactive (dead) since Sun 2019-12-08 14:30:50 EST; 2min 30s ago
Process: 621 ExecStop=/sbin/upsdrvctl stop (code=exited, status=0/SUCCESS)
Process: 457 ExecStart=/sbin/upsdrvctl start (code=exited, status=0/SUCCESS)
Main PID: 596 (code=exited, status=0/SUCCESS)
CPU: 75ms

Dec 08 14:30:47 raspberrypi3_b upsdrvctl[457]: Detected a UPS: TRIPP LITE/TRIPP LITE SMART750USB
Dec 08 14:30:47 raspberrypi3_b upsdrvctl[457]: Using OMNIVS 2001 protocol (2001)
Dec 08 14:30:49 raspberrypi3_b upsdrvctl[457]: Unit ID not retrieved (not available on all models)
Dec 08 14:30:49 raspberrypi3_b tripplite_usb[596]: Startup successful
Dec 08 14:30:49 raspberrypi3_b upsdrvctl[457]: Network UPS Tools - UPS driver controller 2.7.4
Dec 08 14:30:49 raspberrypi3_b systemd[1]: Started Network UPS Tools - power device driver controller.
Dec 08 14:30:50 raspberrypi3_b upsdrvctl[621]: Network UPS Tools - UPS driver controller 2.7.4
Dec 08 14:30:50 raspberrypi3_b systemd[1]: nut-driver.service: Unit not needed anymore. Stopping.
Dec 08 14:30:50 raspberrypi3_b systemd[1]: Stopping Network UPS Tools - power device driver controller...
Dec 08 14:30:50 raspberrypi3_b systemd[1]: Stopped Network UPS Tools - power device driver controller.

Now I start upsdrvctl with:

sudo upsdrvctl start
Network UPS Tools - UPS driver controller 2.7.4
Network UPS Tools - Tripp Lite OMNIVS / SMARTPRO driver 0.29 (2.7.4)
Warning: This is an experimental driver.
Some features may not function correctly.

Detected a UPS: TRIPP LITE/TRIPP LITE SMART750USB
Using OMNIVS 2001 protocol (2001)
Unit ID not retrieved (not available on all models)
Attached to Tripp Lite SMART750USB

pi@raspberrypi3_b:~ $ ps aux|grep nut
root 626 0.0 0.2 4984 2156 ? Ss 14:31 0:00 /lib/nut/upsmon
nut 627 0.0 0.4 7160 4192 ? S 14:31 0:00 /lib/nut/upsmon
nut 3497 0.4 0.0 3100 212 ? Ss 14:38 0:00 /lib/nut/tripplite_usb -a pbx

... upsd is still not there so:

sudo upsd
Network UPS Tools upsd 2.7.4
fopen /var/run/nut/upsd.pid: No such file or directory
listening on 192.168.1.193 port 3493
listening on 127.0.0.1 port 3493
Connected to UPS [pbx]: tripplite_usb-pbx

pi@raspberrypi3_b:~ $ ps aux|grep nut
root 626 0.0 0.2 4984 2156 ? Ss 14:31 0:00 /lib/nut/upsmon
nut 627 0.0 0.4 7160 4192 ? S 14:31 0:00 /lib/nut/upsmon
nut 3497 0.5 0.1 3100 1444 ? Ss 14:38 0:01 /lib/nut/tripplite_usb -a pbx
nut 3522 0.0 0.0 4984 300 ? Ss 14:42 0:00 /lib/nut/upsd

*** Everything works from here ... I even receive a notification COMMOK after modifying notify-cmd.sh like so: (using an old IP address mailing notifier...)

sudo cat notify-cmd.sh
==========
#!/bin/sh

echo $NOTIFYTYPE > /tmp/MyIP.log
echo "Subject: Message de l'UPS: $NOTIFYTYPE" > /tmp/MyIP1.log
echo "From: rpi3B@UPS" >> /tmp/MyIP1.log
echo "Date: `date -R`" >> /tmp/MyIP1.log
echo "" >> /tmp/MyIP1.log
echo "Salut mon petit JR..." >> /tmp/MyIP1.log
echo "" >> /tmp/MyIP1.log
echo "la raison: $NOTIFYTYPE" >> /tmp/MyIP1.log
echo "Uptime est: `uptime | cut -d ',' -f1 | sed 's/^.\{12\}//g'`" >> /tmp/MyIP1.log
echo "" >> /tmp/MyIP1.log
echo "---- " >> /tmp/MyIP1.log
echo "de la part de rpi3b !!!" >> /tmp/MyIP1.log
echo "" >> /tmp/MyIP1.log
echo "" >> /tmp/MyIP1.log

curl --url smtps://smtp.videotron.ca:465 --mail-from root@firewall --mail-rcpt mygmail@gmail.com --upload-file /tmp/MyIP1.log --ssl-reqd --user myisp_smtp_username:password --insecure -v
==========

It looks like a systemd fart, and don't get me started on "bloatmare" systemd, or a permission issue, root vs nut. Now since it now works for me as I described earlier I'm very happy with "nut" as is, but I refuse to dig any deeper exactly for the same reasons I don't dig systemd; overly complex learning curve for a once in a blue moon usage for an amateur like me. But if you spot the problem within this long post, I'll gladly fix it. Thank's !

jeanrocco
Posts: 9
Joined: Sun Jan 27, 2013 4:11 pm

Re: Raspberry PI 3B+ and NUT (Network UPS Tools)

Mon Dec 09, 2019 6:06 pm

RonR wrote:
Sun Dec 08, 2019 8:18 am
@jeanrocco

You might try removing the "pollinterval = 5" ...
@RonR

I guess the tone of my last post was a bit harsh and shortsighted, if it's the case, I'm sorry !
Your nut's scripts for the RPI's should be advertised more publicly, they helped me a lot to get nut going, maybe not by the book but enough to be usable. Thank's again. jrb.

RonR
Posts: 2908
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Raspberry PI 3B+ and NUT (Network UPS Tools)

Mon Dec 09, 2019 9:18 pm

jeanrocco wrote:
Mon Dec 09, 2019 6:06 pm
RonR wrote:
Sun Dec 08, 2019 8:18 am
@jeanrocco

You might try removing the "pollinterval = 5" ...
@RonR

I guess the tone of my last post was a bit harsh and shortsighted, if it's the case, I'm sorry !
Your nut's scripts for the RPI's should be advertised more publicly, they helped me a lot to get nut going, maybe not by the book but enough to be usable. Thank's again. jrb.

No offense taken. I understand your frustration and wish I could offer more help, but I've used only Cyberpower UPS's in recent years and don't have any experience with Tripp Lite units.

jeanrocco
Posts: 9
Joined: Sun Jan 27, 2013 4:11 pm

Re: Raspberry PI 3B+ and NUT (Network UPS Tools)

Tue Dec 10, 2019 1:06 am

RonR wrote:
Sun Dec 08, 2019 8:18 am

...
Your nut's scripts ....
@RonR

:o no pun intended ! :lol: english is funny !

Have a good one !!!

Return to “Troubleshooting”