search for: upsfd

Displaying 20 results from an estimated 41 matches for "upsfd".

Did you mean: upsd
2011 Oct 03
2
patch: Replace many usleep and some sleep calls with nanosleep
...set DSR Index: b/drivers/powerpanel.c =================================================================== --- a/drivers/powerpanel.c 2011-05-31 13:36:49.000000000 +0300 +++ b/drivers/powerpanel.c 2011-08-17 00:40:17.000000000 +0300 @@ -165,7 +165,7 @@ void upsdrv_initups(void) } ser_set_dtr(upsfd, 1); - usleep(10000); + struct timespec delay = {0, 10e6}; nanosleep(&delay, NULL); if (subdriver[mode]->initups() > 0) { upslogx(LOG_INFO, "CyberPower UPS with %s protocol on %s detected", subdriver[mode]->version, device_path); @@ -173,7 +173,7 @@ void upsdrv_ini...
2005 Dec 19
0
new(er) SEC driver.
...; *(buf+SEC_SIZE-1) = '\0'; /* set the command .. in buf */ if (sec_support(i)) { if (sec_varlist[i].flags & SEC_FLAG_WR) { /* can be stored, will return on next poll */ upsdebugx(SEC_LOG_INFO, "setting: %s:%s -> %s", name, val, buf); sec_send(upsfd, SEC_SETCMD, sec_varlist[i].cmd, buf, strlen(buf)); if (sec_recv(upsfd, buf, SEC_SIZE) != 0) /* not succeeded */ return STAT_SET_UNKNOWN; } else { strncpy(sec_value(i), val, SEC_MAX_VARSIZE-1); *(sec_value(i)+SEC_MAX_VARSIZE-1) = '\0'; } } return STAT_SET...
2006 May 12
1
Fwd: RE New xanto driver for NUT
Dear Andreas, some googling revealed, you created a driver for the xanto series of online-usv.de. In what state it is currently? I've to manage a S2000 and would like to use nut for it, is it usable by now? Do you need another tester? TIA, Pete
2011 Mar 05
19
[RFC apcsmart V3 00/18] apcsmart driver updates
Sorry for a bit longer delay than I anticipated, I was stuffed with the work. This is the next iteration of the patch adding some functionality to apcsmart driver, and relying on 'ignorelb' recently added. Follow up from previous thread: http://www.mail-archive.com/nut-upsdev at lists.alioth.debian.org/msg02331.html Main differences is that V3 is split into many small patches, so the
2011 Jan 25
1
[RFC] Updates to ACP smart driver
This patch introduces a handful of new options, I mentioned earlier in: http://www.mail-archive.com/nut-upsdev at lists.alioth.debian.org/msg02088.html See the large commit message in the follow-up for the details and rationale. I realize it's a bit larger diff - so if it's required I can split it into few smaller ones. Michal Soltys (1): APC smart driver update and new features.
2006 Dec 05
3
megatec over USB - new driver patch
...; (max)) ? (max) : (x))) - static float batt_charge_pct(float battvolt) { float value; @@ -178,15 +173,14 @@ return value * 100; } - static int check_ups(void) { char buffer[RECV_BUFFER_LEN]; int ret; upsdebugx(2, "Sending \"F\" command..."); - ser_send_pace(upsfd, SEND_PACE, "F%c", ENDCHAR); - ret = ser_get_line(upsfd, buffer, RECV_BUFFER_LEN, ENDCHAR, IGNCHARS, READ_TIMEOUT, 0); + comm->send("F%c", ENDCHAR); + ret = comm->recv(buffer, RECV_BUFFER_LEN, ENDCHAR, IGNCHARS); if (ret < F_CMD_REPLY_LEN) { upsdebugx(2, "Wron...
2011 Oct 03
0
patch: Fix [-Wunused-but-set-variable]
...void upsdrv_shutdown(void) * work, else:*/ /* fatalx(EXIT_FAILURE, "Shutdown only supported with the Generic Driver, type 6 and special cable"); */ /*fatalx(EXIT_FAILURE, "shutdown not supported");*/ - int i, ret; + int i; for(i=0;i<=5;i++) { - ret = ser_send_char(upsfd, '#'); + ser_send_char(upsfd, '#'); usleep(50000); } } Index: b/drivers/metasys.c =================================================================== --- a/drivers/metasys.c 2011-05-31 13:36:49.000000000 +0300 +++ b/drivers/metasys.c 2011-08-17 00:23:22.000000000 +0300 @@ -96...
2011 Feb 07
4
[PATCH/RFC v2 0/3] Updates to ACP smart driver
This is 2nd version of the earlier patch featuring a few new features and fixes to the apcsmart driver, following the remarks in: http://www.mail-archive.com/nut-upsdev at lists.alioth.debian.org/msg02294.html Major changes from v1: - handle battery.charge and battery.runtime checks at main.c level - handle "immutable but writable" conflict gracefully at driver level -
2007 Dec 02
1
Driver bestfcom - Timing problem with Fortress LI1420
...??????int ret; -???????char ch, buf[256]; +???????unsigned char ch; +???????char buf[256]; ? ????????/* Check for the Inverter status alarm if pending : ???????? * "\r\n{Inverter: ? ? On}\r\n=>" @@ -190,10 +191,12 @@ ????????????????POLL_ALERT, alert_handler, 0, 20); ? ????????ser_send(upsfd, cmd); +???????sleep(UPSDELAY); ? ????????/* delete command echo up to \012 but no further */ ????????for (ch = '\0'; ch != '\012'; ser_get_char(upsfd, &ch, 0, 10)); ? +???????sleep(UPSDELAY); ????????/* get command response?*/ ????????ret = ser_get_line(upsfd, result, resultsiz...
2007 Feb 01
2
Re: [Nut-upsuser] Ablerex 625L USB version
...< Q1_CMD_REPLY_LEN) { > upsdebugx(1, "UPS doesn't return any information > about its status."); > *************** > *** 564,571 **** > { > upslogx(LOG_INFO, "Shutting down UPS immediately."); > > ! ser_send_pace(upsfd, SEND_PACE, "C%c", ENDCHAR); > ! ser_send_pace(upsfd, SEND_PACE, "S%02dR%04d%c", > shutdown_delay, start_delay, ENDCHAR); > } > > > --- 569,576 ---- > { > upslogx(LOG_INFO, "Shutting down UPS immediately."); > > !...
2009 Jul 06
3
Smart-UPS RT 3000 Baud Rate
...t I have found so far. 1. It's a Smart-UPS RT 3000 XL 2. The 940-0095B cable now uses an RJ45 connector at the UPS end. 3. It now requires a baud rate of 9600 instead of the 2400 used previously. Can anyone tell me if modifying drivers/apcsmart.c void upsdrv_initups(void) { char *cable; upsfd = ser_open(device_path); ser_set_speed(upsfd, device_path, B2400); to void upsdrv_initups(void) { char *cable; upsfd = ser_open(device_path); ser_set_speed(upsfd, device_path, B9600); all that is required in order to get nut to talk to it, or will other things need changing? Regards, Ric...
2015 Apr 01
2
mge-shut driver fails almost after every reboot
Hello all, OS name: FreeNAS 9.3 NUT version: 2.7.2 NUT installed method: Bundled with FreenNAS 9.3 Device: EATON 5SC 1000 (http://powerquality.eaton.com/Products-services/Backup-Power-UPS/5SC.aspx?cx=5&wtredirect=www.eaton.com/5SC&GUID=B81251A4-F34E-4373-94B3-B4FB3D0CBCA8) Problem description: This was originally reported as bug to FreeNAS
2007 Jun 18
1
Megatec - modem control lines
...================================================================== --- trunk/drivers/megatec.c (revision 965) +++ trunk/drivers/megatec.c (working copy) @@ -853,13 +853,22 @@ void upsdrv_initups(void) { + int dtr_bit = TIOCM_DTR; + int rts_bit = TIOCM_RTS; + upsfd = ser_open(device_path); ser_set_speed(upsfd, device_path, B2400); + + ioctl(upsfd, TIOCMBIS, &dtr_bit); + ioctl(upsfd, TIOCMBIC, &rts_bit); } void upsdrv_cleanup(void) { + int dtr_bit = TIOCM_DTR; + + ioctl(upsfd, TIOCMBIC, &dtr_bit); ser...
2006 Jul 24
2
fentonups driver patch for Effekta MHD3000 UPS
...,38 **** --- 30,52 ---- #define DRV_VERSION "1.22" static int cap_upstemp = 0; + static int is_online = 0; static float lowvolt = 0, voltrange, chrglow = 0, chrgrange; static int lownorm, highnorm; + static void sendcr_and_clear_buf(void) + { + int ret; + + ret = ser_send(upsfd, "\r"); + + usleep(300000); + + if (ret != 1) + upslog(LOG_ERR, "sendcr_and_clear_buf: ser_send failed"); + ser_flush_in(upsfd, "", 0); + } + /* handle devices which don't give a properly formatted I string */ static int check_mtab2(const char *raw) {...
2006 Nov 26
1
Patch for optiups to support Zinto D from ONLINE USV-Systeme AG
...t;unsupported command>"); } + if ( _buf[0] == 0x06 ) + { + upsdebugx(2, "READ: <command done>"); + } else { upsdebugx(2, "READ: \"%s\"", _buf ); @@ -125,6 +141,7 @@ { upsdebugx(2, "SEND: \"%s\"", cmd ); ser_send( upsfd, cmd ); + if ( testvar(OPTI_ZINTO) ) ser_send( upsfd, "\r\n" ); return optireadline(); } @@ -179,12 +196,26 @@ { /* You do realize this will kill power to ourself. Would probably only * be useful for killing power for a slave computer */ + if ( testvar(OPTI_ZINTO) ) + {...
2015 Apr 02
0
mge-shut driver fails almost after every reboot
...in advance! > The only diff I see between shut in 2.7.1 and 2.7.2 is the following: --- ../nut-2.7.1/drivers/libshut.c 2013-10-02 14:16:42.000000000 +0200 +++ drivers/libshut.c 2014-02-25 16:39:34.000000000 +0100 @@ -312,7 +312,7 @@ /* FIXME: add variable baudrate detection */ *upsfd = ser_open(device_path); ser_set_speed(*upsfd, device_path, B2400); - setline(*upsfd, 0); + setline(*upsfd, 1); /* initialise communication */ if (!shut_synchronise(*upsfd)) This is tied to the PnP feature, and was reverted with the following commit: https://github.com/netwo...
2015 Apr 02
2
mge-shut driver fails almost after every reboot
...ff I see between shut in 2.7.1 and 2.7.2 is the following: > > --- ../nut-2.7.1/drivers/libshut.c 2013-10-02 14:16:42.000000000 +0200 > +++ drivers/libshut.c 2014-02-25 16:39:34.000000000 +0100 > @@ -312,7 +312,7 @@ > /* FIXME: add variable baudrate detection */ > *upsfd = ser_open(device_path); > ser_set_speed(*upsfd, device_path, B2400); > - setline(*upsfd, 0); > + setline(*upsfd, 1); > > /* initialise communication */ > if (!shut_synchronise(*upsfd)) > > > This is tied to the PnP feature, and was reverted with the...
2010 Apr 19
1
Patch for the bestfortress driver 0.02
...len; int retry; + char ch; int checksum_ok, is_online=1, is_off, low_batt, trimming, boosting; for (retry = 0; retry < 5; ++retry) { upsflushin (0, 0, "\r "); upssend ("f\r"); + while (ser_get_char(upsfd, &ch, 0, UPSDELAY) > 0 && ch != '\n'); // response starts with \r\n + temp[2] = 0; do { - if (upsrecv (temp+2, sizeof temp - 2, ENDCHAR, IGNCHARS) <= 0) { + if ((len = upsrecv (temp+2, sizeof temp -...
2009 Feb 04
2
[nut-commits] svn commit r1765 - in trunk: . drivers man
...LUE, "ups.delay.shutdown", "Override > shutdown delay (120s)"); > 959 addvar(VAR_VALUE, "ups.delay.start", "Override restart > delay (10s)"); This doesn't work without using getval() somewhere in the driver. > 971 ioctl(upsfd, TIOCMBIC, &rts_bit); > 972 ioctl(upsfd, TIOCMBIC, &dtr_bit); We have library functions in serial.c to handle this. Use them. Best regards, Arjen -- Please keep list traffic on the list
2006 Jan 27
0
[PATCH] fentonups patch to make it work with some powercom ups's
...include "main.h" #include "serial.h" @@ -176,11 +179,27 @@ static char *get_id(void) return NULL; } +static void set_powercom_lines (void) +{ +// straced from powercom's upsmon +//ioctl(4, TIOCMSET, [TIOCM_DTR|0x4000]) = 0 + + int dtr_bit = TIOCM_DTR|0x4000; + ioctl(upsfd, TIOCMSET, &dtr_bit); +} + void upsdrv_initinfo(void) { int modelnum, i, ret; char temp[256], model[32], *raw; + if (testvar("powercom")) { + set_powercom_lines(); +// straced from powercom's upsmon (reset?) + ret = ser_send(upsfd, "%c%c%c%c%c\r", 1, 2, 2...