[SOLVED] udev and UPS problem

This forum is dedicated to advanced help and support :

Ask here your questions about advanced usage of Mageia. For example you may post here all your questions about network and automated installs, complex server configurations, kernel tuning, creating your own Mageia mirrors, and all tasks likely to be touchy even for skilled users.

[SOLVED] udev and UPS problem

Postby mackowiakp » Jun 11th, '13, 00:10

I have connected UPS battery backup to my PC via USB port. This PC works for me as my home server, media server, NAS etc. So no any graphic interface run on it. This PC is in ON state, 24h/day.
I use NUT server, working with upsd via loopback interface on the same machine. The USB cable is constantly connected both to PC and USB.
Very rare (once every 3-4 days) I get a messages that the connection between UPS and PC is down and after 5 min next message that UPS is not available. The reason is most likely the errors in firmware on the UPS I think, but it is not possible to change it. So I look for workaround.
The corresponding to UPS file in /dev dir disappears after that.
How do I restart the udevd to find the UPS back by PC? Is the command "udevadm trigger" sufficient for this?
Of course the solution is to restart the PC, but it interrupts of course the normal work of my "server".
Or any other ideas?
Last edited by mackowiakp on Jun 19th, '13, 16:57, edited 1 time in total.
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 660
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland

Re: udev and UPS problem

Postby wintpe » Jun 19th, '13, 16:44

udevadm control --reload-rules and then udevadm trigger

is what i found doing a search about so it looks like you have the solution already.

did you try it.

the first part is clearly for when you add a udev script and want it included in the scan

regards peter
Redhat 6 Certified Engineer (RHCE)
Sometimes my posts will sound short, or snappy, however its realy not my intention to offend, so accept my apologies in advance.
wintpe
 
Posts: 1204
Joined: May 22nd, '11, 17:08
Location: Rayleigh,, Essex , UK

Re: udev and UPS problem

Postby mackowiakp » Jun 19th, '13, 16:56

Finally I configured udev for UPS needs, and udev create by itself the /dev/ups for NUT to play with. Just several reboots and WORKS!
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 660
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland

Re: [SOLVED] udev and UPS problem

Postby wintpe » Jun 20th, '13, 11:41

well please share what you did so others may benefit.

regards peter
Redhat 6 Certified Engineer (RHCE)
Sometimes my posts will sound short, or snappy, however its realy not my intention to offend, so accept my apologies in advance.
wintpe
 
Posts: 1204
Joined: May 22nd, '11, 17:08
Location: Rayleigh,, Essex , UK

Re: [SOLVED] udev and UPS problem

Postby mackowiakp » Jun 20th, '13, 12:58

The configuration is strongly "UPS dependent". I use low-cost BluePower UPS with USB port which simulates serial port. The problem was that I have connected to PC another USB device with serial port simulation too. So for both serial port emulated devices, system assign random /dev/ttyXXX device.
So I simply I just add new udev rule like this:

filename -> 01-Bluepower-UPS.rules

content:

Code: Select all
SUBSYSTEMS=="usb",ATTRS{idVendor}=="0665", ATTRS{idProduct}=="5161", SYMLINK+="ups", GROUP="nut"


After that my UPS is always avaliable as /dev/ups, all the time it is connected to my PC.

Change idVendor and idProduct according to Your UPS model - take numbers from lsusb command.

Thats all. The configuration of NUT is another problem as I wrote hardly hardware dependent
Last edited by doktor5000 on Jun 21st, '13, 20:37, edited 1 time in total.
Reason: added code tags, to improve on clarity
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 660
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland


Return to Advanced support

Who is online

Users browsing this forum: No registered users and 1 guest