Re: [Nut-upsuser] APC BACK UPS 2200 model BZ2200BI-BR (New output)

2015-12-30 Thread Charles Lepple
On Fri, Sep 11, 2015 at 10:54 AM, Mario Lobo  wrote:
> I know the battery is fully charged and that the load is more than 7.2%.
>
> The battery voltage seems correct.

Mario,

I realize some of the variables are not yet correct, but is this
better than before? I would like to merge the solis_debug branch in to
the master branch.

Bruno,

Any ideas? Mario mentioned his model is getting mis-detected as a Solis 1.0.

-- 
- Charles Lepple

___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] APC BACK UPS 2200 model BZ2200BI-BR (New output)

2015-09-11 Thread Charles Lepple
On Sep 11, 2015, at 8:11 AM, Mario Lobo  wrote:
> 
> On Thu, 10 Sep 2015 22:31:08 -0400
> Charles Lepple  wrote:
> 
>> On Sep 9, 2015, at 2:06 PM, Mario Lobo  wrote:
>>> 
>>> By the constance of header and footer bytes, I think something
>>> different is going on now.
>> 
>> Right, this is the resync code that @rpvelloso suggested.
>> 
>> https://github.com/networkupstools/nut/issues/231#issuecomment-138971923
>> 
>>> It still identifying as a Solis 1.0 (which is not) but at least it
>>> is doing it on its own, without gdb.
>> 
>> If I remember correctly, Bruno was mainly looking for OB/LB status,
>> so he mapped the APC model to the nearest Solis model. I've CC'd him
>> in case he has any other insights.
>> 
>> Bruno, the mailing list thread starts here:
>> http://article.gmane.org/gmane.comp.monitoring.nut.user/9306 and
>> here: http://article.gmane.org/gmane.comp.monitoring.nut.user/9317
>> 
> 
> Charles;
> 
> Do you think I could try this solis with nut and see what comes up?
> 
> Or you think it is not worth it yet?

The only way we will know if this works is if someone tests it...

It looks like the low-battery signal is calculated from the charge. I am not 
sure what effect the incorrect voltages will have on that calculation (I have 
not seen any numbers) but if they are all off by a constant factor, it should 
work.

-- 
Charles Lepple
clepple@gmail




___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] APC BACK UPS 2200 model BZ2200BI-BR (New output

2015-09-10 Thread Charles Lepple
On Sep 9, 2015, at 2:06 PM, Mario Lobo  wrote:
> 
> By the constance of header and footer bytes, I think something
> different is going on now.

Right, this is the resync code that @rpvelloso suggested.

https://github.com/networkupstools/nut/issues/231#issuecomment-138971923

> It still identifying as a Solis 1.0 (which is not) but at least it is
> doing it on its own, without gdb.

If I remember correctly, Bruno was mainly looking for OB/LB status, so he 
mapped the APC model to the nearest Solis model. I've CC'd him in case he has 
any other insights.

Bruno, the mailing list thread starts here: 
http://article.gmane.org/gmane.comp.monitoring.nut.user/9306 and here: 
http://article.gmane.org/gmane.comp.monitoring.nut.user/9317

-- 
Charles Lepple
clepple@gmail




___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] APC BACK UPS 2200 model BZ2200BI-BR (update)

2015-09-09 Thread Mario Lobo
On Tue, 8 Sep 2015 22:25:54 -0400
Charles Lepple  wrote:

> @rpvelloso on Github suggested some changes (driver version v0.64)
> that should help with the initial sync:
> 
> https://github.com/networkupstools/nut/commit/debc8e0280ea4de9a0db5ca34aa66705b285f61f
> 
> It's the solis_debug branch on Github.
> 
> Does that help? I'm concerned that it might get out of sync later,
> but I don't want to change too much at once.

I'll give it a shot !!!


-- 
Mario Lobo
http://www.mallavoodoo.com.br
FreeBSD since 2.2.8 [not Pro-Audio YET!!]

"UNIX was not designed to stop you from doing stupid things, 
because that would also stop you from doing clever things."

___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] APC BACK UPS 2200 model BZ2200BI-BR (New output

2015-09-09 Thread Mario Lobo
On Tue, 8 Sep 2015 22:25:54 -0400
Charles Lepple  wrote:

> @rpvelloso on Github suggested some changes (driver version v0.64)
> that should help with the initial sync:
> 
> https://github.com/networkupstools/nut/commit/debc8e0280ea4de9a0db5ca34aa66705b285f61f
> 
> It's the solis_debug branch on Github.
> 
> Does that help? I'm concerned that it might get out of sync later,
> but I don't want to change too much at once.


Hi Charles !

By the constance of header and footer bytes, I think something
different is going on now.

It still identifying as a Solis 1.0 (which is not) but at least it is
doing it on its own, without gdb.

Here is the output:

/usr/local/libexec/nut/solis -a lobos -u root -D -D -D 
Network UPS Tools - APC/Microsol Solis UPS driver 0.64 (2.7.3.1)
   0.00 debug level is '3'
   0.001843 getbaseinfo: sending CMD_UPSCONT and ENDCHAR to sync
   1.330248 getbaseinfo: received 25 bytes from ser_get_buf_len()
   1.330283 CommReceive: RecPack: (25 bytes) => bb 47 88 ad 1b 0a
a0 18 02 30 14 10 0b 1.330298  00 00 00 01 00 09 a1 49 5e 5e 25 fe

Detected Solis 1.0 on /dev/cuaU0
UPS Date 1999/10/09
System Date 2015/09/09 day of week Wed
UPS internal Time 16:20:48
Shutdown programming not activated

   1.330381 getupdateinfo: requesting 25 bytes from
ser_get_buf_len() 
2.414226 getupdateinfo: received 25 bytes from
ser_get_buf_len() 
2.414259 CommReceive: RecPack: (25 bytes) => bb
46 88 ac 02 0a a0 09 02 31 14 10 0b 
2.414274  00 00 00 01 00 09 a1
49 5e 5e fc fe 
2.414566 dstate_init: sock /var/db/nut/solis-lobos
open on fd 5 
2.414600 getupdateinfo: requesting 25 bytes from
ser_get_buf_len() 
3.499203 getupdateinfo: received 25 bytes from
ser_get_buf_len() 
3.499237 CommReceive: RecPack: (25 bytes) => bb
46 83 ac 03 0a a0 09 02 32 14 10 0b 
3.499253  00 00 00 01 00 09 a1
49 5e 5e f9 fe 

4.436557 getupdateinfo: requesting 25 bytes from
ser_get_buf_len() 
4.585178 getupdateinfo: received 25 bytes from
ser_get_buf_len() 
4.585209 CommReceive: RecPack: (25 bytes) => bb
47 83 ad 19 0a a0 0c 02 33 14 10 0b 
4.585224  00 00 00 01 00 09 a1
49 5e 5e 15 fe 
6.440663 getupdateinfo: requesting 25 bytes from
ser_get_buf_len() 
6.440711 getupdateinfo: received 25 bytes from
ser_get_buf_len() 
6.440731 CommReceive: RecPack: (25 bytes) => bb
46 83 ac 1b 0a a0 1e 02 34 14 10 0b 
6.440745  00 00 00 01 00 09 a1
49 5e 5e 28 fe 
8.482557 getupdateinfo: requesting 25 bytes from
ser_get_buf_len() 
8.482601 getupdateinfo: received 25 bytes from
ser_get_buf_len() 
8.482620 CommReceive: RecPack: (25 bytes) => bb
46 82 ad 1a 0a a0 20 02 35 14 10 0b 
8.482636  00 00 00 01 00 09 a1
49 5e 5e 2a fe 
10.485513 getupdateinfo: requesting 25 bytes from
ser_get_buf_len() 
10.48 getupdateinfo: received 25 bytes from
ser_get_buf_len() 
10.485575 CommReceive: RecPack: (25 bytes) => bb
46 83 ad 19 09 a0 02 02 37 14 10 0b 
10.485590  00 00 00 01 00 09 a1
49 5e 5e 0d fe 12.513556 getupdateinfo: requesting 25 bytes from
ser_get_buf_len() 
12.513599 getupdateinfo: received 25 bytes from
ser_get_buf_len() 
12.513619 CommReceive: RecPack: (25 bytes) => bb
46 87 ad 01 0a a0 31 02 39 14 10 0b 
12.513634  00 00 00 01 00 09 a1
49 5e 5e 2b fe 
14.533025 getupdateinfo: requesting 25 bytes from
ser_get_buf_len() 
14.533089 getupdateinfo: received 25 bytes from
ser_get_buf_len() 
14.533110 CommReceive: RecPack: (25 bytes) => bb
47 88 ad 1c 0a a0 0c 02 3b 14 10 0b 
14.533125  00 00 00 01 00 09 a1
49 5e 5e 25 fe 
16.540632 getupdateinfo: requesting 25 bytes from
ser_get_buf_len() 
16.540693 getupdateinfo: received 25 bytes from
ser_get_buf_len() 
16.540713 CommReceive: RecPack: (25 bytes) => bb
47 88 ad 1c 0b a0 54 02 01 15 10 0b 
16.540728  00 00 00 01 00 09 a1
49 5e 5e 35 fe 
18.578527 getupdateinfo: requesting 25 bytes from
ser_get_buf_len() 
18.578570 getupdateinfo: received 25 bytes from
ser_get_buf_len() 
18.578589 CommReceive: RecPack: (25 bytes) => bb
46 83 ad 19 0a a0 13 02 03 15 10 0b 
18.578604  00 00 00 01 00 09 a1
49 5e 5e ec fe 
20.586804 getupdateinfo: requesting 25 bytes from
ser_get_buf_len() 
20.586847 getupdateinfo: received 25 bytes from
ser_get_buf_len() 
20.586866 CommReceive: RecPack: (25 bytes) => bb
46 88 ad 1d 0a a0 0b 02 04 15 10 0b 
20.586881  00 00 00 01 00 09 a1
49 5e 5e ee fe 
22.628979 getupdateinfo: requesting 25 bytes from
ser_get_buf_len() 
22.629064 getupdateinfo: received 25 bytes from
ser_get_buf_len() 
22.629091 CommReceive: RecPack: (25 bytes) => bb
46 88 ad 1b 0a a0 06 02 06 15 10 0b 
22.629107  00 00 00 01 00 09 a1
49 5e 5e e9 fe 
24.634147 getupdateinfo: requesting 25 bytes from
ser_get_buf_len() 
24.634214 getupdateinfo: received 25 bytes from
ser_get_buf_len() 
24.634234 CommReceive: RecPack: (25 bytes) => bb
47 88 ad 02 0b a0 07 02 08 15 10 0b 

Re: [Nut-upsuser] APC BACK UPS 2200 model BZ2200BI-BR (update)

2015-09-08 Thread Charles Lepple
@rpvelloso on Github suggested some changes (driver version v0.64) that should 
help with the initial sync:

https://github.com/networkupstools/nut/commit/debc8e0280ea4de9a0db5ca34aa66705b285f61f

It's the solis_debug branch on Github.

Does that help? I'm concerned that it might get out of sync later, but I don't 
want to change too much at once.
___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] APC BACK UPS 2200 model BZ2200BI-BR (update)

2015-08-26 Thread Charles Lepple
On Aug 26, 2015, at 4:43 PM, Mario Lobo ml...@digiart.art.br wrote:
 
 1) run stty -f /dev/cuaU0 raw jusbefore running solis

What about this: run solis first, let it fail, then run stty?

The default settings look wrong, but in theory the driver should fix them up. 
___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] APC BACK UPS 2200 model BZ2200BI-BR (update)

2015-08-26 Thread Mario Lobo
Hi Charles;

I tried both of your suggestions:

1) run stty -f /dev/cuaU0 raw jusbefore running solis
2) Unplug/plug, and run solis right after.

The problem still persists.

[~]stty -a -f /dev/cuaU0
speed 9600 baud; 0 rows; 0 columns;
lflags: icanon isig iexten echo echoe -echok echoke -echonl echoctl
-echoprt -altwerase -noflsh -tostop -flusho -pendin -nokerninfo
-extproc
iflags: -istrip icrnl -inlcr -igncr ixon -ixoff ixany imaxbel -ignbrk
brkint -inpck -ignpar -parmrk
oflags: opost onlcr -ocrnl tab0 -onocr -onlret
cflags: cread cs8 -parenb -parodd hupcl clocal -cstopb -crtscts -dsrflow
-dtrflow -mdmbuf
cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = undef;
eol2 = undef; erase = ^?; erase2 = ^H; intr = ^C; kill = ^U;
lnext = ^V; min = 1; quit = ^\; reprint = ^R; start = ^Q;
status = ^T; stop = ^S; susp = ^Z; time = 0; werase = ^W;

Thanks,

-- 
Mario Lobo
http://www.mallavoodoo.com.br
FreeBSD since 2.2.8 [not Pro-Audio YET!!]

UNIX was not designed to stop you from doing stupid things, 
because that would also stop you from doing clever things.



On Tue, 25 Aug 2015 21:59:08 -0400
Charles Lepple clep...@gmail.com wrote:

 stty -a -f /dev/cuaU0



___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] APC BACK UPS 2200 model BZ2200BI-BR (update)

2015-08-25 Thread Charles Lepple
Turns out another user reported the same issue with a slightly different model: 
https://github.com/networkupstools/nut/issues/231 
https://github.com/networkupstools/nut/issues/231

The stty -f /dev/cuaU0 raw trick should help, but I am confused as to why 
FreeBSD has different raw settings than what is set up at the same time as 
the baud rate: 
https://github.com/networkupstools/nut/blob/master/drivers/serial.c#L163 
https://github.com/networkupstools/nut/blob/master/drivers/serial.c#L163

Before running stty raw, can you please send the output of stty -a -f 
/dev/cuaU0?

-- 
Charles Lepple
clepple@gmail



___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser

Re: [Nut-upsuser] APC BACK UPS 2200 model BZ2200BI-BR (update)

2015-08-24 Thread Charles Lepple
On Aug 23, 2015, at 6:26 PM, Mario Lobo ml...@digiart.art.br wrote:
 
 I hope it helps!

It is a bit easier to read than the ktrace output. Here are the bytes received, 
without the other messages:

Network UPS Tools - Microsol Solis UPS driver 0.63 (2.7.3.1)
CommReceive: RecPack: (25 bytes) = 00 17 91 49 5e 5e bc fe bb 46 88 ac 1b 0a 
a0 ed 01 07 07 bb 46 82 ae 1b 09
CommReceive: RecPack: (25 bytes) = a0 04 02 06 1d 0d 03 00 00 00 01 00 17 91 
49 5e 5e dc fe bb 47 83 ad 1a 09
CommReceive: RecPack: (25 bytes) = a0 0a 02 07 1d 0d 03 00 00 00 01 00 17 91 
49 5e 5e e3 fe bb 46 88 ac 1a 0a
CommReceive: RecPack: (25 bytes) = a0 f4 01 08 1d 0d 03 00 00 00 01 00 17 91 
49 5e 5e d1 fe bb 46 88 ad 02 0b
CommReceive: RecPack: (25 bytes) = a0 0b 02 09 1d 0d 03 00 00 00 01 00 17 91 
49 5e 5e d4 fe bb 46 88 ad 1e 0a
CommReceive: RecPack: (25 bytes) = a0 1b 02 0a 1d 0d 03 00 00 00 01 00 17 91 
49 5e 5e 00 fe bb 46 88 ad 1d 0a
CommReceive: RecPack: (25 bytes) = a0 f6 01 0b 1d 0d 03 00 00 00 01 00 17 91 
49 5e 5e da fe bb 47 83 ac 1a 09
CommReceive: RecPack: (25 bytes) = a0 f4 01 0c 1d 0d 03 00 00 00 01 00 17 91 
49 5e 5e d0 fe bb 46 88 ad 1e 0a
CommReceive: RecPack: (25 bytes) = 0d 02 0d 1d 0d 03 00 00 00 01 00 17 91 49 
5e 5e f5 fe bb 47 83 ad 02 09 a0
CommReceive: RecPack: (25 bytes) = 02 0e 1d 0d 03 00 00 00 01 00 17 91 49 5e 
5e d9 fe bb 46 88 ac 1e 0b a0 1d
CommReceive: RecPack: (25 bytes) = 02 0f 1d 0d 03 00 00 00 01 00 17 91 49 5e 
5e 07 fe bb 47 88 ac 1c 0a a0 04
CommReceive: RecPack: (25 bytes) = 02 10 1d 0d 03 00 00 00 01 00 17 91 49 5e 
5e ed fe bb 46 88 ac 19 0a a0 07
CommReceive: RecPack: (25 bytes) = 02 11 1d 0d 03 00 00 00 01 00 17 91 49 5e 
5e ed fe bb 47 88 ad 23 0c a0 4c
CommReceive: RecPack: (25 bytes) = 02 12 1d 0d 03 00 00 00 01 00 17 91 49 5e 
5e 41 fe bb 46 83 ae 02 0a a0 1b
CommReceive: RecPack: (25 bytes) = 02 13 1d 0d 03 00 00 00 01 00 17 91 49 5e 
5e e9 fe bb 46 88 ad 1d 0a a0 f8
CommReceive: RecPack: (25 bytes) = 01 14 1d 0d 03 00 00 00 01 00 17 91 49 5e 
5e e5 fe bb 46 88 ae 1a 0a a0 ef
CommReceive: RecPack: (25 bytes) = 15 1d 0d 03 00 00 00 01 00 17 91 49 5e 5e 
db fe bb 46 88 ad 1b 0a a0 f2 01
CommReceive: RecPack: (25 bytes) = 1d 0d 03 00 00 00 01 00 17 91 49 5e 5e df 
fe bb 47 88 ad 1a 0a a0 f8 01 17
CommReceive: RecPack: (25 bytes) = 1d 0d 03 00 00 00 01 00 17 91 49 5e 5e e6 
fe bb 46 83 ad 02 0a a0 e3 01 18
CommReceive: RecPack: (25 bytes) = 1d 0d 03 00 00 00 01 00 17 91 49 5e 5e b4 
fe bb 47 88 ad 1d 0a a0 0f 02 19
Solis not detected! aborting ...

I highlighted the final character (0xfe/254). It seems as though the code 
expects the serial stream to always put the 0xfe character at the end of the 
buffer, but as you can see, that is not the case in the debug output. (The code 
loops twenty times, so it is not impossible for it to sync: this may be what 
happened when you ran the driver in gdb.)

We could modify the code to re-sync with the start character, but what concerns 
me is that a byte gets dropped occasionally. If you run stty -f /dev/cuaU0 
raw, then run the driver with the same debug flags, do you get the same sort 
of output, where the fe character moves left? You might also try unplugging 
the USB cable, then running the driver immediately after plugging it in again 
(maybe there is a buffer filling up - that happened a number of years ago on 
another USB interface on FreeBSD).

-- 
Charles Lepple
clepple@gmail



___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser

Re: [Nut-upsuser] APC BACK UPS 2200 model BZ2200BI-BR

2015-08-23 Thread Charles Lepple
On Aug 21, 2015, at 10:10 AM, Mario Lobo ml...@digiart.art.br wrote:
 
 Not sure what to look for yet. It might be easier to add in the debug
 calls to the source code-- can you try building NUT from source? If
 you installed via the ports tree (as opposed to binary packages), you
 should have most of the dependencies installed. You might also need
 libtool and autoconf, as mentioned in the second link below:
 
 http://www.networkupstools.org/docs/developer-guide.chunked/ar01s03.html#_source_code_management
 and
 http://www.networkupstools.org/docs/developer-guide.chunked/ar01s03.html#building
 
 
 Yes I did build it through ports. I try to build a debug version of it.

Mario,

I added a few debug statements throughout the solis driver:

https://github.com/networkupstools/nut/tree/solis_debug

If you run into trouble with the initial build, there will be a tarball 
snapshot here shortly that bypasses some of the autoconf/libtool issues (look 
for the nut-* link under step 5):

http://buildbot.networkupstools.org/public/nut/builders/Debian-x64-gcc/builds/389

-- 
Charles Lepple
clepple@gmail




___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] APC BACK UPS 2200 model BZ2200BI-BR (update)

2015-08-23 Thread Mario Lobo
On Sun, 23 Aug 2015 11:09:03 -0400
Charles Lepple clep...@gmail.com wrote:

 On Aug 21, 2015, at 10:10 AM, Mario Lobo ml...@digiart.art.br wrote:
  
  Not sure what to look for yet. It might be easier to add in the
  debug calls to the source code-- can you try building NUT from
  source? If you installed via the ports tree (as opposed to binary
  packages), you should have most of the dependencies installed. You
  might also need libtool and autoconf, as mentioned in the second
  link below:
  
  http://www.networkupstools.org/docs/developer-guide.chunked/ar01s03.html#_source_code_management
  and
  http://www.networkupstools.org/docs/developer-guide.chunked/ar01s03.html#building
  
  
  Yes I did build it through ports. I try to build a debug version of
  it.
 
 Mario,
 
 I added a few debug statements throughout the solis driver:
 
 https://github.com/networkupstools/nut/tree/solis_debug
 
 If you run into trouble with the initial build, there will be a
 tarball snapshot here shortly that bypasses some of the
 autoconf/libtool issues (look for the nut-* link under step 5):
 
 http://buildbot.networkupstools.org/public/nut/builders/Debian-x64-gcc/builds/389
 


Here is what I got from running the just-compiled  nut-2.7.3.1.tar.gz:


[~]/usr/local/libexec/nut/solis -a lobos -u root -D -D -D 

Network UPS Tools - Microsol Solis UPS driver 0.63 (2.7.3.1)
   0.00 debug level is '3'
   0.001946 getbaseinfo: sending CMD_UPSCONT and ENDCHAR to sync
   0.002111 getbaseinfo: requesting 25 bytes from ser_get_buf_len()
   0.963327 getbaseinfo: received 25 bytes from ser_get_buf_len()
   0.963360 CommReceive: RecPack: (25 bytes) = 00 17 91 49 5e 5e
bc fe bb 46 88 ac 1b 
   0.963375  0a a0 ed 01 07 07 bb 46 82 ae 1b 09
   0.963387 getbaseinfo: requesting 25 bytes from ser_get_buf_len()
   2.048306 getbaseinfo: received 25 bytes from ser_get_buf_len()
   2.048343 CommReceive: RecPack: (25 bytes) = a0 04 02 06 1d 0d
03 00 00 00 01 00 17 
   2.048358  91 49 5e 5e dc fe bb 47 83 ad 1a 09
   2.048371 getbaseinfo: requesting 25 bytes from ser_get_buf_len()
   3.132287 getbaseinfo: received 25 bytes from ser_get_buf_len()
   3.132321 CommReceive: RecPack: (25 bytes) = a0 0a 02 07 1d 0d
03 00 00 00 01 00 17 
   3.132337  91 49 5e 5e e3 fe bb 46 88 ac 1a 0a
   3.132350 getbaseinfo: requesting 25 bytes from ser_get_buf_len()
   4.217261 getbaseinfo: received 25 bytes from ser_get_buf_len()
   4.217294 CommReceive: RecPack: (25 bytes) = a0 f4 01 08 1d 0d
03 00 00 00 01 00 17 
   4.217309  91 49 5e 5e d1 fe bb 46 88 ad 02 0b
   4.217322 getbaseinfo: requesting 25 bytes from ser_get_buf_len()
   5.302236 getbaseinfo: received 25 bytes from ser_get_buf_len()
   5.302268 CommReceive: RecPack: (25 bytes) = a0 0b 02 09 1d 0d
03 00 00 00 01 00 17 
   5.302283  91 49 5e 5e d4 fe bb 46 88 ad 1e 0a
   5.302296 getbaseinfo: requesting 25 bytes from ser_get_buf_len()
   6.386210 getbaseinfo: received 25 bytes from ser_get_buf_len()
   6.386241 CommReceive: RecPack: (25 bytes) = a0 1b 02 0a 1d 0d
03 00 00 00 01 00 17 
   6.386256  91 49 5e 5e 00 fe bb 46 88 ad 1d 0a
   6.386269 getbaseinfo: requesting 25 bytes from ser_get_buf_len()
   7.471190 getbaseinfo: received 25 bytes from ser_get_buf_len()
   7.471222 CommReceive: RecPack: (25 bytes) = a0 f6 01 0b 1d 0d
03 00 00 00 01 00 17 
   7.471236  91 49 5e 5e da fe bb 47 83 ac 1a 09
   7.471249 getbaseinfo: requesting 25 bytes from ser_get_buf_len()
   8.557168 getbaseinfo: received 25 bytes from ser_get_buf_len()
   8.557200 CommReceive: RecPack: (25 bytes) = a0 f4 01 0c 1d 0d
03 00 00 00 01 00 17 
   8.557215  91 49 5e 5e d0 fe bb 46 88 ad 1e 0a
   8.557241 getbaseinfo: requesting 25 bytes from ser_get_buf_len()
   9.642144 getbaseinfo: received 25 bytes from ser_get_buf_len()
   9.642177 CommReceive: RecPack: (25 bytes) = 0d 02 0d 1d 0d 03
00 00 00 01 00 17 91 
   9.642192  49 5e 5e f5 fe bb 47 83 ad 02 09 a0
   9.642209 getbaseinfo: requesting 25 bytes from ser_get_buf_len()
  10.727265 getbaseinfo: received 25 bytes from ser_get_buf_len()
  10.727293 CommReceive: RecPack: (25 bytes) = 02 0e 1d 0d 03 00
00 00 01 00 17 91 49 
  10.727303  5e 5e d9 fe bb 46 88 ac 1e 0b a0 1d
  10.727313 getbaseinfo: requesting 25 bytes from ser_get_buf_len()
  11.811101 getbaseinfo: received 25 bytes from ser_get_buf_len()
  11.811136 CommReceive: RecPack: (25 bytes) = 02 0f 1d 0d 03 00
00 00 01 00 17 91 49 
  11.811151  5e 5e 07 fe bb 47 88 ac 1c 0a a0 04
  11.811164 getbaseinfo: requesting 25 bytes from ser_get_buf_len()
  12.896076 getbaseinfo: received 25 bytes from ser_get_buf_len()
  12.896112 CommReceive: RecPack: (25 bytes) = 02 10 1d 0d 03 00
00 00 01 00 17 91 49 
  12.896127  5e 5e ed fe bb 46 88 ac 19 0a a0 07
  12.896140 getbaseinfo: requesting 25 bytes from ser_get_buf_len()
  13.981054

Re: [Nut-upsuser] APC BACK UPS 2200 model BZ2200BI-BR

2015-08-23 Thread Mario Lobo
On Sun, 23 Aug 2015 11:09:03 -0400
Charles Lepple clep...@gmail.com wrote:

 On Aug 21, 2015, at 10:10 AM, Mario Lobo ml...@digiart.art.br wrote:
  
  Not sure what to look for yet. It might be easier to add in the
  debug calls to the source code-- can you try building NUT from
  source? If you installed via the ports tree (as opposed to binary
  packages), you should have most of the dependencies installed. You
  might also need libtool and autoconf, as mentioned in the second
  link below:
  
  http://www.networkupstools.org/docs/developer-guide.chunked/ar01s03.html#_source_code_management
  and
  http://www.networkupstools.org/docs/developer-guide.chunked/ar01s03.html#building
  
  
  Yes I did build it through ports. I try to build a debug version of
  it.
 
 Mario,
 
 I added a few debug statements throughout the solis driver:
 
 https://github.com/networkupstools/nut/tree/solis_debug
 
 If you run into trouble with the initial build, there will be a
 tarball snapshot here shortly that bypasses some of the
 autoconf/libtool issues (look for the nut-* link under step 5):
 
 http://buildbot.networkupstools.org/public/nut/builders/Debian-x64-gcc/builds/389
 

Hi Charles!

Like I said on my last e-mail, I managed to build a debug version of
solis.

Here is an output:

==
653 upsdrv_initinfo();
(gdb) next
Detected Solis 1.0 on /dev/cuaU0
UPS Date 1999/09/23
System Date 2015/08/23 day of week Sun
UPS internal Time 13:02:49
Shutdown programming not atived
654 upsdrv_updateinfo();
(gdb) next
656 if (dstate_getinfo(driver.flag.ignorelb)) {
(gdb) next
679 dstate_init(progname, upsname);
(gdb) next
682 dstate_setinfo(driver.parameter.pollinterval, %d,
poll_interval); (gdb) next
685 dstate_setinfo(driver.parameter.synchronous, %s,
(gdb) next
689 if (dstate_getinfo(ups.mfr) != NULL)
(gdb) next
690 dstate_setinfo(device.mfr, %s,
dstate_getinfo(ups.mfr)); (gdb) next
691 if (dstate_getinfo(ups.model) != NULL)
(gdb) next
692 dstate_setinfo(device.model, %s,
dstate_getinfo(ups.model)); (gdb) next
693 if (dstate_getinfo(ups.serial) != NULL)
(gdb) next
696 if (nut_debug_level == 0) {
(gdb) next
697 background();
(gdb) next

Program exited normally.
(gdb) 
==

Funny... Under gdb, it detects something, even if it is a wrong ups. 

Running it straight, it outputs this:

[~]/usr/local/libexec/nut/solis -a lobos -u root
Network UPS Tools - Microsol Solis UPS driver 0.62 (2.7.3)
Solis not detected! aborting ...

I just downloaded nut-2.7.3.1.tar.gz from the link you provided and
I'll try to give it a spin. I can do it through the ports because there
aren't any code patches. Only script patches, so you're free to change
the code around as much as needed.

Thanks for sticking with me on this!
-- 
Mario Lobo
http://www.mallavoodoo.com.br
FreeBSD since 2.2.8 [not Pro-Audio YET!!]

UNIX was not designed to stop you from doing stupid things, 
because that would also stop you from doing clever things.

___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] APC BACK UPS 2200 model BZ2200BI-BR

2015-08-21 Thread Charles Lepple
On Aug 21, 2015, at 9:19 AM, Mario Lobo ml...@digiart.art.br wrote:
 
 On Aug 20, 2015, at 10:26 PM, Charles Lepple clep...@gmail.com wrote:
 
 On Aug 20, 2015, at 6:33 PM, Mario Lobo ml...@digiart.art.br wrote:
 
 ** cuaU0
 
 []/usr/local/libexec/nut/solis -D -a lobos -u root
 Network UPS Tools - Microsol Solis UPS driver 0.62 (2.7.3)
  0.00 debug level is '1'
 21.065536 Solis not detected! aborting ...
 
 It looks like /dev/cuaU0 is the port that was suggested for a 
 similarly-named model last year:
 
 http://article.gmane.org/gmane.comp.monitoring.nut.user/8554
 
 The binary patches mentioned in that thread have been superseded by source 
 code chances that are part of NUT 2.7.3.
 
 Unfortunately, as you have seen, the solis driver does not have much debug 
 output. What happens when you run it under ktrace?
 Man ... the output of ktrace is really big! it produced an output file
 of 200 k, attached to this e-mail (solis.txt).
 
 I don't even know what to look for!
 
 Do you have any ideas?

It's fairly large, but it compresses well. (Please keep the list CC'd - this is 
how people can find this information in the future.)

Not sure what to look for yet. It might be easier to add in the debug calls to 
the source code-- can you try building NUT from source? If you installed via 
the ports tree (as opposed to binary packages), you should have most of the 
dependencies installed. You might also need libtool and autoconf, as mentioned 
in the second link below:

http://www.networkupstools.org/docs/developer-guide.chunked/ar01s03.html#_source_code_management
 and 
http://www.networkupstools.org/docs/developer-guide.chunked/ar01s03.html#building

-- 
Charles Lepple
clepple@gmail




solis.txt.gz
Description: GNU Zip compressed data
___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser

Re: [Nut-upsuser] APC BACK UPS 2200 model BZ2200BI-BR

2015-08-20 Thread e430benz98
I am not an expert on this matter but I can tell you I am having issues with 
Freebsd 10.2 with a Tripp Lite ups myself 

Hopefully a dev can look in to FreeBSD 10.2

Sent from my LG G3.

-Original Message-
From: Mario Lobo ml...@digiart.art.br
To: nut-upsuser@lists.alioth.debian.org
Sent: Thu, 20 Aug 2015 3:50 PM
Subject: [Nut-upsuser] APC BACK UPS 2200 model BZ2200BI-BR

Hi;

I'm having some trouble to comunicate with my just bought (08/17/15)
Ups. According to SOLIS(8):

SUPPORTED HARDWARE

This driver has been tested with :

Solis 1000 VA
Solis 1500 VA
Solis 2000 VA
Solis 3000 VA
Back-UPS BZ1200-BR
Back-UPS BZ2200BI-BR

So solis is the one to go for.


Here is my scenario:

SW:  nut-2.7.3 (compiled from ports) 
OS:  FreeBSD 10.2-STABLE #2 r286923
UPS: APC BACK UPS 2200 model BZ2200BI-BR (usb interface)
 using a printer-like usb cable (bundled)

When I plug it in, here is what comes up:

ugen1.2: APC BY SCHNEIDER ELECTRIC at usbus1
umodem0: APC BY SCHNEIDER ELECTRIC APC USB SERIAL CONVERTER., 
class 2/0, rev 2.00/1.00, addr 2 on usbus1 
umodem0: data interface 1, has no CM over data, has no break


[]usbconfig list

ugen1.1: UHCI root HUB Intel at usbus1, cfg=0 md=HOST spd=FULL
(12Mbps) pwr=SAVE (0mA) 

ugen0.1: UHCI root HUB Intel at usbus0, cfg=0
md=HOST spd=FULL (12Mbps) pwr=SAVE (0mA) 

ugen2.1: EHCI root HUB Intelat usbus2, cfg=0 md=HOST spd=HIGH
(480Mbps) pwr=SAVE (0mA) 

ugen1.2:APC USB SERIAL CONVERTER. APC BY SCHNEIDER ELECTRIC at
usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA)


And here are the devices I get after pluging it in:

ttyU0
ttyU0.init
ttyU0.lock

cuaU0
cuaU0.init
cuaU0.lock

ugen1.2 (ugen1.2 - usb/1.2.0)

(no umodem0 device shows)


** ups.conf

[lobos]
  driver = solis
  port = /dev/ttyU0 (or cuaU0, or ugen1.2)


*** RESULTS

** ugen1.2

[]/usr/local/libexec/nut/solis -D -a lobos -u root
Network UPS Tools - Microsol Solis UPS driver 0.62 (2.7.3)
   0.00 debug level is '1'
   0.001551 tcgetattr(/dev/ugen1.2): Inappropriate ioctl for device

** ttyU0

[]/usr/local/libexec/nut/solis -D -a lobos -u root
Network UPS Tools - Microsol Solis UPS driver 0.62 (2.7.3)
   0.00 debug level is '1'
  21.249301 Solis not detected! aborting ...

** cuaU0

[]/usr/local/libexec/nut/solis -D -a lobos -u root
Network UPS Tools - Microsol Solis UPS driver 0.62 (2.7.3)
   0.00 debug level is '1'
  21.065536 Solis not detected! aborting ...


using 'upsdrvctl -t -u root start lobos' yields the same results.


On windows it works with the software that I downloaded for it
but the server is FreeBSD. Windows is just the desktop I use for
occasional audio production.


Would anyone have any pointers of what else I can try to make this
work?

Thanks for any suggestions. 

-- 
Mario Lobo
http://www.mallavoodoo.com.br
FreeBSD since 2.2.8 [not Pro-Audio YET!!]

UNIX was not designed to stop you from doing stupid things, 
because that would also stop you from doing clever things.

___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser
___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser

Re: [Nut-upsuser] APC BACK UPS 2200 model BZ2200BI-BR

2015-08-20 Thread Charles Lepple
On Aug 20, 2015, at 6:33 PM, Mario Lobo ml...@digiart.art.br wrote:
 
 ** cuaU0
 
 []/usr/local/libexec/nut/solis -D -a lobos -u root
 Network UPS Tools - Microsol Solis UPS driver 0.62 (2.7.3)
   0.00 debug level is '1'
  21.065536 Solis not detected! aborting ...

It looks like /dev/cuaU0 is the port that was suggested for a similarly-named 
model last year:

http://article.gmane.org/gmane.comp.monitoring.nut.user/8554

The binary patches mentioned in that thread have been superseded by source code 
chances that are part of NUT 2.7.3.

Unfortunately, as you have seen, the solis driver does not have much debug 
output. What happens when you run it under ktrace?

-- 
Charles Lepple
clepple@gmail




___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser