DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2008-04-23 18:46:52

Viracocha
Member
Registered: 2008-04-16
Posts: 12

DNS-323 and UPS

Hi everyone,

I'm just investigating the possibility of being able to make the DNS shut down when using a UPS and it's running on battery power. I've looked it up and it seems there's a daemon for Linux for APC (apcupsd) that should allow for this. I'm a linux newbie though, so I'm not sure if it's possible to run it on the linux version running on the DNS. I would assume it would have to be compiled for this system but I'm not sure how I would go about it.

I haven't gotten the UPS yet, but was wondering if anyone here has experience with this already that could give me a few pointers.

Thanks in advance,
Pedro

Offline

 

#2 2008-04-23 19:25:11

mig
Member
From: Seattle, WA
Registered: 2006-12-21
Posts: 532

Re: DNS-323 and UPS

NUT is another UPS tool that could be used http://eu1.networkupstools.org/
There was some discussion on this previously http://dns323.kood.org/forum/t1407-support.html


DNS-323 • 2x Seagate Barracuda ES 7200.10 ST3250620NS 250GB SATAII (3.0Gb/s) 7200RPM 16MB • RAID1 • FW1.03 • ext2 
Fonz's v0.3 fun_plug http://www.inreto.de/dns323/fun-plug

Offline

 

#3 2008-04-23 20:42:33

Viracocha
Member
Registered: 2008-04-16
Posts: 12

Re: DNS-323 and UPS

I feel like an idiot for not doing a thorough search before posting. That post you mentioned seems a little bit dated and didn't look like there was a final solution. I just looked through the list of optware packages and it shows apcupsd_3.14.3-1_arm.ipk. Does this mean that it was compiled for the 323 and maybe we could use that for what we need?

It's disappointing that UPS support seems to be very lacking, as the NAS is a prime candidate since it runs 24/7 usually.

Offline

 

#4 2008-04-23 21:27:19

mig
Member
From: Seattle, WA
Registered: 2006-12-21
Posts: 532

Re: DNS-323 and UPS

I seem to remember that apcupsd needed a kernel module (something like USB_HID [human interface device] )
and NUT, although harder to configure, was easier to compile because it did not rely on additional
kernel modules.

You are correct, there was no final solution posted for that thread.  I have worked around the
problem by connecting my UPS to my Linkstation Pro NAS running debian and apcupsd.  In the
event of a power failure, the Linkstation Pro shuts down the DNS-323 with a remote command.


DNS-323 • 2x Seagate Barracuda ES 7200.10 ST3250620NS 250GB SATAII (3.0Gb/s) 7200RPM 16MB • RAID1 • FW1.03 • ext2 
Fonz's v0.3 fun_plug http://www.inreto.de/dns323/fun-plug

Offline

 

#5 2008-04-23 22:15:25

Viracocha
Member
Registered: 2008-04-16
Posts: 12

Re: DNS-323 and UPS

mig wrote:

You are correct, there was no final solution posted for that thread.  I have worked around the
problem by connecting my UPS to my Linkstation Pro NAS running debian and apcupsd.  In the
event of a power failure, the Linkstation Pro shuts down the DNS-323 with a remote command.

I was hoping to have the DNS connected to the UPS by the USB port, so that I didn't need to have a computer turned on 24/7. It would kind of defeat the purpose of having the NAS in the first place. Right now I'm working with it in an office setting so I can't adventure too far, though I am thinking of getting a personal one that I can play with, as I can see there's lots of potential in it.

Offline

 

#6 2008-04-24 06:00:13

mig
Member
From: Seattle, WA
Registered: 2006-12-21
Posts: 532

Re: DNS-323 and UPS

Viracocha wrote:

I was hoping to have the DNS connected to the UPS by the USB port, so that I didn't need to have a computer turned on 24/7.

Yes, USB direct connection is the preferred solution, but until someone compiles apcupsd or NUT to run on
the DNS-323, I'll have to settle for the remote shutdown solution.

Last edited by mig (2008-04-24 06:01:40)


DNS-323 • 2x Seagate Barracuda ES 7200.10 ST3250620NS 250GB SATAII (3.0Gb/s) 7200RPM 16MB • RAID1 • FW1.03 • ext2 
Fonz's v0.3 fun_plug http://www.inreto.de/dns323/fun-plug

Offline

 

#7 2008-04-24 07:23:50

bzhou
Member
Registered: 2008-02-15
Posts: 171

Re: DNS-323 and UPS

The apcupsd ipk is in optware/dns323 feed.
I just added nut to optware with usb and snmp support, it should be in the feed shortly. With optware build environment, not difficult at all to build the ipks.
See http://www.nslu2-linux.org/wiki/Optware/Dns323 for optware ipkg setup instructions.
Cheers!

Offline

 

#8 2008-06-02 04:30:22

shadow349
Member
Registered: 2008-05-12
Posts: 9

Re: DNS-323 and UPS

I just got apcupsd running on my unit.

Since I'm using chroot Debian, I did:

apt-get install apcupsd
apt-get install apcupsd-cgi
mkdir -p /usr/local/modules
cd /usr/local/modules
wget http://dev.skcserver.de/dns323/modules_ … /usbhid.ko
/sbin/insmod /usr/local/modules/usbhid.ko
mount -t usbfs none /proc/bus/usb
cd /usr/local/src
wget 'http://voxel.dl.sourceforge.net/sourceforge/apcupsd/apcupsd-3.14.4.tar.gz'
gunzip -dc apcupsd-3.14.4.tar.gz | tar vfx -
cd apcupsd-3.14.4/examples
sh make-hiddev
vi /etc/apcupsd/apcupsd.conf
    Edited:
       UPSNAME apc1500
       UPSCABLE usb
       UPSTYPE usb
       LOCKFILE /var/lock
       UPSCLASS standalone
       UPSMODE disable
/etc/init.d/apcupsd start

Note that there was a lot of stuff between those steps, so I am not 100% sure it covers everything.

I also added the following to /linuxrc:

mount -t usbfs none /proc/bus/usb
/sbin/insmod /usr/local/modules/usbhid.ko
/etc/init.d/apcupsd start >>/var/log/apcupsd.log 2>&1

I also linked in the cgis that were installed in:

/usr/lib/cgi-bin/apcupsd

into my lighttpd document directory so I could access the status via a web browser.

Hope this will be of use to someone.

Last edited by shadow349 (2008-06-02 04:31:41)

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB