starknetwork Posted January 29, 2009 Share Posted January 29, 2009 Hi, I want to connect my UPS to my unRAID box, sadly my motherboard does not have a serial port. (I have managed to get the UPS communicating with unRAID in a vmware on a host machine with a Serial port). I have borrowed a USB-Serial adapter which is detected as a USB device, but does not come up as a serial port. Would a PCI Serial Card work with a stock unraid release (4.4.2)? Something like this would be ideal: http://www.newegg.com/Product/Product.aspx?Item=N82E16815158052 If not, how hard would it be to get a USB-Serial adapter to work in unRAID? Thanks Jake Quote Link to comment
WeeboTech Posted January 29, 2009 Share Posted January 29, 2009 There are only certain USB -> Serial adapters that will work with embedded linux drivers. Even then you will have to compile your own kernel. If the PCI card emulates a true 16550 serial port with matching IRQ's and ports, it should work without incident. i took a look at the manual and it did not say anything about linux and drivers, nor did a search turn up anything. It might go in smoothly. You may have to use a tool like setserial to set adjustments. Quote Link to comment
starknetwork Posted January 29, 2009 Author Share Posted January 29, 2009 I have been looking at the threads and notes on compiling the kernel and am sad to say its quite a bit beyond my skill set. I will aquire a PCI card and try my luck, if not another option I have is swapping the motherboard (I have an older motherboard that i know works with unraid which has a serial port). Thanks for your help. Quote Link to comment
SSD Posted January 29, 2009 Share Posted January 29, 2009 MY APC UPS has a RJ-45 plug that plugs into the back of the UPS, and a USB plug to go into the PC. It may be, if you have a similar cable with a serial port on the end, that you could get the cable like mine and connect with USB. (This may not work, just an idea). The other "out of the box" throught I had is that Biggy2872 posted some directions for sharing the UPS over the LAN. It may be possible to connect the UPS to another workstation, and have unRAID get its status through the network. Check out this post ... http://lime-technology.com/forum/index.php?topic=1528.msg27123#msg27123 Quote Link to comment
starknetwork Posted January 29, 2009 Author Share Posted January 29, 2009 The UPS is an APC BackUPS pro 1000, but it is quite old and only has an rs-232 port on the back. I currently plan to only have the unRAID server on 24*7, though I think I will use the LAN idea in the mean time until I get something else sorted. Cheers, Jake Quote Link to comment
Biggy2872 Posted January 29, 2009 Share Posted January 29, 2009 The UPS is an APC BackUPS pro 1000, but it is quite old and only has an rs-232 port on the back. I currently plan to only have the unRAID server on 24*7, though I think I will use the LAN idea in the mean time until I get something else sorted. Cheers, Jake Remember, you are doing the opposite as I did.... You will be installing the version of apcupsd on your "other" computer to be the master. You will need to make changes to the apcupsd on the unraid server everytime you boot to recognize the "other computer". I will see if I can come up with the correct lines of code to use and make a new unmenu package with those lines if you would like. Let me figure out what changes need to be made first. Cheers, Matt Quote Link to comment
Biggy2872 Posted January 29, 2009 Share Posted January 29, 2009 The UPS is an APC BackUPS pro 1000, but it is quite old and only has an rs-232 port on the back. I currently plan to only have the unRAID server on 24*7, though I think I will use the LAN idea in the mean time until I get something else sorted. Cheers, Jake Remember, you are doing the opposite as I did.... You will be installing the version of apcupsd on your "other" computer to be the master. You will need to make changes to the apcupsd on the unraid server everytime you boot to recognize the "other computer". I will see if I can come up with the correct lines of code to use and make a new unmenu package with those lines if you would like. Let me figure out what changes need to be made first. Cheers, Matt Ok, so I figured out what changes I needed to make to the conf file on my windows machine and then came up with the command lines to change the configuration file from telnet(so that you don't have to reboot to apply them) Stop apcupsd ( use killall -g apcupsd) run the following commands: sed -i -e "s:^\(UPSCABLE \)smart:\1ether:" /etc/apcupsd/apcupsd.conf sed -i -e "s:^\(UPSTYPE \)usb:\1net:" /etc/apcupsd/apcupsd.conf sed -i -e "s/^#DEVICE \/dev\/ttyS0/DEVICE IP:3551/" /etc/apcupsd/apcupsd.conf sed -i -e "s:^#\(NETTIME \)60:\130:" /etc/apcupsd/apcupsd.conf Now restart apcupsd with /sbin/apcupsd NOTE THE VALUES OF THE RED TEXT MUST BE CHANGED IP is the ip address(static) of the master computer (the one plugged into the ups) 30 is the polling time.. you need to make sure that it is less than the amount of time you set your master to turn off after power outtage, I have my server shutting down after 60 seconds and my slave computer polls every 30 seconds.. I recommend 30 seconds(you only need to cahnge the value above if you want something other than 30 seconds. example, if you want polling time to be every 60 seconds then the command would be: sed -i -e "s:^#\(NETTIME \)60:\160:" /etc/apcupsd/apcupsd.conf I have included a package manager .conf as well that reflects these changes... remember that you need to edit the values above in the .conf as well. PACKAGE_NAME apcupsd - A daemon for controlling APC UPS devices PACKAGE_DESCR Apcupsd can be used for power management and controlling most PACKAGE_DESCR of APC's UPS models on Unix and Windows machines. <br>Apcupsd works with most of APC's PACKAGE_DESCR Smart-UPS models as well as most simple signalling models such as Back-UPS and BackUPS-Office. PACKAGE_URL http://www.linuxpackages.net/redirect.php?id=12025&url=http://www.linuxpackages.net/download.php?id=12025 PACKAGE_FILE apcupsd-3.14.3-i486-1kjz.tgz PACKAGE_INSTALLED /sbin/apcaccess PACKAGE_DEPENDENCIES /usr/bin/mail, /sbin/powerdown PACKAGE_MD5 1768e5f28f6e3ed7b2228607f401f7c4 PACKAGE_INSTALLATION installpkg apcupsd-3.14.3-i486-1kjz.tgz PACKAGE_INSTALLATION sed -i -e "s:^\(UPSCABLE \)smart:\1ether:" /etc/apcupsd/apcupsd.conf PACKAGE_INSTALLATION sed -i -e "s:^\(UPSTYPE \)usb:\1net:" /etc/apcupsd/apcupsd.conf PACKAGE_INSTALLATION sed -i -e "s/^DEVICE \/dev\/ttyS0/DEVICE IP:3551/" /etc/apcupsd/apcupsd.conf PACKAGE_INSTALLATION sed -i -e "s:^#\(NETTIME \)60:\130:" /etc/apcupsd/apcupsd.conf PACKAGE_INSTALLATION sed -i -e "s/WALL=wall/WALL=\"mail -s 'unRAID_Server_UPS_Alert'\"/" /etc/apcupsd/apccontrol PACKAGE_INSTALLATION /sbin/apcupsd PACKAGE_INSTALLATION #Now, put into place the shutdown script replacement PACKAGE_INSTALLATION echo "/sbin/powerdown" >/etc/apcupsd/doshutdown PACKAGE_INSTALLATION echo "exit 99" >>/etc/apcupsd/doshutdown PACKAGE_INSTALLATION chmod 755 /etc/apcupsd/doshutdown PACKAGE_INSTALLATION sed -i -e "s/\/sbin\/poweroff/\/etc\/apcupsd\/apccontrol killpower; \/sbin\/poweroff/" /etc/rc.d/rc.6 PACKAGE_VERSION_TEST apcaccess status 2>&1 | grep RELEASE | awk '{print $3}' PACKAGE_VERSION_STRING 3.14.3 PACKAGE_MEMORY_USAGE Light (10K to 500K) Cheers, Matt Quote Link to comment
Biggy2872 Posted January 29, 2009 Share Posted January 29, 2009 fixed the a typo in the posted .conf... if you downloaded it, get the new version. Sorry. Cheers, Matt Quote Link to comment
starknetwork Posted January 29, 2009 Author Share Posted January 29, 2009 Cheers Mark , I'll give this a go. Thanks again. Jake Quote Link to comment
RobJ Posted January 29, 2009 Share Posted January 29, 2009 You have not mentioned what motherboard you have. Are you sure that it does not have a plug or connector (sorry, my mind has gone blank, cannot remember the correct term) for a serial port on the board itself? Some do. Quote Link to comment
starknetwork Posted January 29, 2009 Author Share Posted January 29, 2009 You have not mentioned what motherboard you have. Are you sure that it does not have a plug or connector (sorry, my mind has gone blank, cannot remember the correct term) for a serial port on the board itself? Some do. Oh dear, never even considered that! you are quite right, it does have a serial port header (Biostar TA690G). That should make things a lot simpler. Thank you! Jake Quote Link to comment
Biggy2872 Posted January 29, 2009 Share Posted January 29, 2009 You have not mentioned what motherboard you have. Are you sure that it does not have a plug or connector (sorry, my mind has gone blank, cannot remember the correct term) for a serial port on the board itself? Some do. Oh dear, never even considered that! you are quite right, it does have a serial port header (Biostar TA690G). That should make things a lot simpler. Thank you! Jake I just want to mention that you will still need a new unmenu package for apcupsd(assuming you use unmenu) or some special lines in your go script to configure apcupsd on boot to use the serial port (it defaults to usb). If you need additonal help with the configuration of apcupsd, feel free to PM or post back here. In your configuration file you will need to set: UPSTYPE apcsmart or UPSTYPE dumb depending on what kind of information it provides (the full list of information for smart and only if it is on battery or wall power for dumb) UPSCABLE should be set to UPSCABLE simple DEVICE needs to be your com port DEVICE /dev/tty** (depeding on how your com port gets assigned by unraid) Cheers, Matt Note: you may need to do some playing around with the config file to get everything working.. see the apcupsd documentation on their website (http://www.apcupsd.com/manual/) Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.