On Jan 2, 2015, at 4:27 PM, Mike Raath <raathm at gmail.com> wrote:> Maybe usbpassthrough is something I should look at? I'll do some reading.You may have found this already, but this (plus the followup KB item #1021345) seems to imply that you can bind the USB-to-serial adapter to the NUT VM: http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1022290 You should be able to do "USB 2.0/1.1 Host-Connected" with that cable. In fact, if the host supports USB 3.0, it may help to move the converter to a non-3.0 port. This is in addition to the comments from Dan (hyouko at gmail) regarding the start character. -- Charles Lepple clepple at gmail
Thanks Dan and Charles - I've found the usb passthrough will be a non-starter (not supported on my host). Dan - is your recommendation to build Nut from source or just the driver? I'm trying to build the whole project but am obviously missing dependencies... I've come across a configure error syntax error near unexpected token `CPPUNIT,' which I've seen in a previous discussion you (Charles) had with another user should be missing pkg-config dependency, but I do have pkg-config installed. I haven't been able to track down an idiot proof installation guide. Happy to continue to hack but if there is a guide it will speed me up. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20150103/3d52d228/attachment.html>
hyouko at gmail.com
2015-Jan-04 15:53 UTC
[Nut-upsuser] Data stale error after short while
> I'm trying to build the whole project but am obviously missing > dependencies... I've come across a configure error > > syntax error near unexpected token `CPPUNIT,'Did you rerun the autogen.sh script after installing pkg-config and before launching configure?> which I've seen in a previous discussion you (Charles) had with another user > should be missing pkg-config dependency, but I do have pkg-config installed. > I haven't been able to track down an idiot proof installation guide. Happy > to continue to hack but if there is a guide it will speed me up.I'm not overly familiar with ubuntu et similia, however I installed ubuntu server 14.04.1 on a vm and got it working like this: sudo apt install build-essential autoconf libtool pkg-config libusb-dev cd /path/to/nut_source_dir/ ./autogen.sh ./configure \ --without-all \ --without-ssl \ --with-usb \ --with-drivers=nutdrv_qx \ --sysconfdir=/etc/nut \ --with-drvpath=/lib/nut \ --with-statepath=/var/run/nut \ --with-altpidpath=/var/run/nut \ --with-pidpath=/var/run/nut \ --datadir=/usr/share/nut \ --with-udev-dir=/lib/udev \ --with-systemdsystemunitdir=/lib/systemd/system \ --with-user=nut \ --with-group=nut make (well, probably that configure line can be shrunk a little..) Provided that you have already installed and configured the nut-server package, you can simply launch the driver: sudo /path/to/nut_source_dir/drivers/nutdrv_qx -a ups_name -DDD Hope this helps.
> Hope this helps.It did - thanks! I managed to hack around a bit earlier and did produce the driver binary but thought I would try from fresh with your steps and got the binary. Unfortunately the problem is still there... after a while connection is lost, updates stop, and upsc reports stale data. Log attached. What I'm thinking now is that I should run a cron job that regularly (every 5 minutes?) restarts the driver. Just killing and restarting nutdrv_qx doesn't work though, since the new process fails with unsupported device errors. Ideally what I need is for the USB driver to reattach itself in the cron and I think that would probably work. It's a hack, but should probably work. No idea where to start on this though. Let me know if you think I'm barking up the wrong tree. Something that puzzles me - when I restart the driver after a disconnect, this is a typical output from the driver with -DDDDD log level. It clearly can see, but not communicate with, the UPS. I've pasted it inline rather than gzipped it because it's short output. Hope that's ok within the forum. $ sudo ~/nut/nut/drivers/nutdrv_qx -a apollo-ups -DDDDD Network UPS Tools - Generic Q* USB driver 0.12 (2.7.2-signed-142-gbcaa206) USB communication driver 0.32 0.000000 debug level is '5' 0.001382 upsdrv_initups... 0.037904 Checking device (0665/5161) (002/004) 1.031424 - VendorID: 0665 1.031937 - ProductID: 5161 1.032277 - Manufacturer: unknown 1.032583 - Product: WayTech USB-RS232 Interface (V1.0) Baud rate 2400bps 1.032743 - Serial Number: unknown 1.032854 - Bus: 002 1.032963 Trying to match device 1.033077 Device matches 1.033218 nut_usb_set_altinterface: skipped usb_set_altinterface(udev, 0) 1.033353 send_to_all: SETINFO ups.vendorid "0665" 1.033473 send_to_all: SETINFO ups.productid "5161" 1.058070 send: QGS 2.060333 read: No error (-110) 2.060857 qx_process_answer: short reply (input.voltage) 2.080004 send: QGS 3.083062 read: No error (-110) 3.083557 qx_process_answer: short reply (input.voltage) 3.103189 send: QGS 4.105282 read: No error (-110) 4.105819 qx_process_answer: short reply (input.voltage) 4.116063 send: M 5.119279 read: No error (-110) 5.121211 qx_process_answer: short reply (ups.firmware.aux) 5.133023 send: M 6.135221 read: No error (-110) 6.135755 qx_process_answer: short reply (ups.firmware.aux) 6.146109 send: M 7.148251 read: No error (-110) 7.148774 qx_process_answer: short reply (ups.firmware.aux) 7.158990 send: M 8.160351 read: No error (-110) 8.160908 qx_process_answer: short reply (ups.firmware.aux) 8.172010 send: M 9.175280 read: No error (-110) 9.175757 qx_process_answer: short reply (ups.firmware.aux) 9.186153 send: M 10.188259 read: No error (-110) 10.188747 qx_process_answer: short reply (ups.firmware.aux) 10.204020 send: QS 11.206260 read: No error (-110) 11.206790 qx_process_answer: short reply (input.voltage) 11.222048 send: QS 12.224222 read: No error (-110) 12.224701 qx_process_answer: short reply (input.voltage) 12.240085 send: QS 13.242540 read: No error (-110) 13.243050 qx_process_answer: short reply (input.voltage) 13.253967 send: D 14.256905 read: No error (-110) 14.257403 qx_process_answer: short reply (input.voltage) 14.268058 send: D 15.269799 read: No error (-110) 15.270300 qx_process_answer: short reply (input.voltage) 15.281049 send: D 16.284067 read: No error (-110) 16.284590 qx_process_answer: short reply (input.voltage) 16.299050 send: Q1 17.300777 read: No error (-110) 17.301277 qx_process_answer: short reply (input.voltage) 17.315854 send: Q1 18.317540 read: No error (-110) 18.318041 qx_process_answer: short reply (input.voltage) 18.333092 send: Q1 19.335789 read: No error (-110) 19.336262 qx_process_answer: short reply (input.voltage) 19.351048 send: Q1 20.353004 read: No error (-110) 20.354717 qx_process_answer: short reply (input.voltage) 20.370944 send: Q1 21.372268 read: No error (-110) 21.372835 qx_process_answer: short reply (input.voltage) 21.387944 send: Q1 22.389204 read: No error (-110) 22.389728 qx_process_answer: short reply (input.voltage) 22.404025 send: Q1 23.407009 read: No error (-110) 23.408849 qx_process_answer: short reply (input.voltage) 23.424381 send: Q1 24.427777 read: No error (-110) 24.428277 qx_process_answer: short reply (input.voltage) 24.443050 send: Q1 25.446739 read: No error (-110) 25.447259 qx_process_answer: short reply (input.voltage) 25.461983 send: Q1 26.462939 read: No error (-110) 26.463578 qx_process_answer: short reply (input.voltage) 26.477954 send: Q1 27.480749 read: No error (-110) 27.481263 qx_process_answer: short reply (input.voltage) 27.496052 send: Q1 28.499032 read: No error (-110) 28.499557 qx_process_answer: short reply (input.voltage) 28.499856 Device not supported! 28.500069 Device not supported! -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20150105/b9282709/attachment-0001.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: nutdr_qx-txt.tar.gz Type: application/x-gzip Size: 53857 bytes Desc: not available URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20150105/b9282709/attachment-0001.bin>
hyouko at gmail.com
2015-Jan-06 16:13 UTC
[Nut-upsuser] Fwd: Data stale error after short while
mmh.. I looked quickly at the logs: - from time to time some character is swapped with something other (just like in the 'F' reply of your previous logs), but this shouldn't be a big problem; - then, suddenly, the queries timeout (just like when you relaunch the driver after a stale) - this is the problem. We need to make sure this isn't something vm-related (if so, having almost zero experience with it, I'm not the right person to help): - can you test it with the same os out of a vm? or - can you setup a vm with an old version of ubuntu server (I'm thinking of 10.04) and see if it behaves differently? (We had atleast one somewhat similar issue in the past - with a different driver -, claimed to be caused by usb/kernel interactions, GitHub #122) - you previously said you were not able to restart blazer_usb but successfully (albeit unintentionally) shut down the UPS after the driver stopped working: is this reproducible? Can you log the launch of blazer_usb with the 'k' switch (and still with -DDD) after the driver stops working? Also: - have you tried playing with poll interval ('i' option)? - do you see any difference if you launch, as root, the driver with the '-u root' option?