Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

weird behaviour when switching PC's #721

Closed
tazhate opened this issue Jul 27, 2019 · 5 comments
Closed

weird behaviour when switching PC's #721

tazhate opened this issue Jul 27, 2019 · 5 comments
Labels
DDL HCL Qx protocol driver Driver based on Megatec Q<number> such as new nutdrv_qx, or obsoleted blazer and some others UPSmart Some UPS are shipped with UPSmart software which may imply common (Qx?) protocol USB VID=0001 PID=0000 (Fry's Electronics/MEC0003) Seems to be a generic USB chip interfacing many devices and protocols (Qx, USB HID, ATCL...) USB

Comments

@tazhate
Copy link

tazhate commented Jul 27, 2019

I have ups dexp mix 850va.

Here is my config:

[ups1]
       desc="dexp"
       port = auto
       driver = blazer_usb
       default.battery.voltage.high = 2.27
       default.battery.voltage.low = 1.72
       runtimecal = 240,100,720,50
       langid_fix=0x0409

It is seems working ok:

root@tazthink:~# upsc ups1
Init SSL without certificate database
battery.charge: 100
battery.runtime: 2400
battery.voltage: 13.60
battery.voltage.high: 2.27
battery.voltage.low: 1.72
battery.voltage.nominal: 0.0
device.mfr: 
device.model: 
device.type: ups
driver.name: blazer_usb
driver.parameter.langid_fix: 0x0409
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.parameter.runtimecal: 240,100,720,50
driver.parameter.synchronous: no
driver.version: 2.7.4
driver.version.internal: 0.12
input.current.nominal: 0.0
input.frequency: 49.9
input.voltage: 224.0
input.voltage.fault: 0.0
input.voltage.nominal: 0
output.voltage: 226.0
ups.beeper.status: disabled
ups.delay.shutdown: 30
ups.delay.start: 180
ups.firmware: V3.7
ups.load: 13
ups.mfr: 
ups.model: 
ups.productid: 0000
ups.status: OL
ups.temperature: 29.0
ups.type: offline / line interactive
ups.vendorid: 0001

but when i put usb cable into another machine - all values become zeroes, reboots and restarts doesnt help. all configs and versions of the nut is the same, the only difference is that second PC have only usb 2 instead of usb 3 at machine where everything works ok.

nut version: 2.7.4-5.1ubuntu2

root@eeepc:~# upsc ups1
Init SSL without certificate database
battery.charge: 1
battery.runtime: 33
battery.voltage: 0.00
battery.voltage.high: 2.27
battery.voltage.low: 1.72
battery.voltage.nominal: 0.0
device.mfr: 
device.model: 
device.type: ups
driver.name: blazer_usb
driver.parameter.langid_fix: 0x0409
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.parameter.runtimecal: 240,100,720,50
driver.parameter.synchronous: no
driver.version: 2.7.4
driver.version.internal: 0.12
input.current.nominal: 0.0
input.frequency: 0.0
input.frequency.nominal: 0
input.voltage: 0.0
input.voltage.fault: 0.0
input.voltage.nominal: 0
output.voltage: 0.0
ups.beeper.status: disabled
ups.delay.shutdown: 30
ups.delay.start: 180
ups.firmware: 
ups.load: 0
ups.mfr: 
ups.model: 
ups.productid: 0000
ups.status: OL
ups.temperature: 0.0
ups.type: online
ups.vendorid: 0001

is there any way to fix it?

@zykh
Copy link
Contributor

zykh commented Jul 30, 2019

@tazhate: could you please post the logs of the blazer_usb driver launched with a debug level of 3? (i.e. -DDD)
Also, do you notice any difference with the nutdrv_qx driver?

@tazhate
Copy link
Author

tazhate commented Jul 30, 2019

root@eeepc:~# /lib/nut/blazer_usb -DDD -a ups1
Network UPS Tools - Megatec/Q1 protocol USB driver 0.12 (2.7.4)
   0.000000	debug level is '3'
   0.004334	language ID workaround enabled (using '0x409')
   0.115898	Checking device (1D6B/0001) (005/001)
   0.143599	- VendorID: 1d6b
   0.143670	- ProductID: 0001
   0.143701	- Manufacturer: unknown
   0.143732	- Product: unknown
   0.143764	- Serial Number: unknown
   0.143796	- Bus: 005
   0.143827	- Device release number: 0415
   0.143859	Trying to match device
   0.143896	Device does not match - skipping
   0.143953	Checking device (1D6B/0001) (004/001)
   0.171706	- VendorID: 1d6b
   0.171784	- ProductID: 0001
   0.171814	- Manufacturer: unknown
   0.171843	- Product: unknown
   0.171872	- Serial Number: unknown
   0.171902	- Bus: 004
   0.171930	- Device release number: 0415
   0.171960	Trying to match device
   0.171995	Device does not match - skipping
   0.172056	Checking device (1D6B/0001) (003/001)
   0.199652	- VendorID: 1d6b
   0.199724	- ProductID: 0001
   0.199753	- Manufacturer: unknown
   0.199781	- Product: unknown
   0.199809	- Serial Number: unknown
   0.199837	- Bus: 003
   0.199866	- Device release number: 0415
   0.199894	Trying to match device
   0.199925	Device does not match - skipping
   0.199982	Checking device (0001/0000) (002/003)
   0.211976	- VendorID: 0001
   0.212063	- ProductID: 0000
   0.212093	- Manufacturer: unknown
   0.212123	- Product: MEC0003
   0.212152	- Serial Number: unknown
   0.212177	- Bus: 002
   0.212208	- Device release number: 0100
   0.212238	Trying to match device
   0.212271	Device matches
   0.212467	nut_usb_set_altinterface: skipped usb_set_altinterface(udev, 0)
   0.216937	First supported language ID: 0x409 (please report to the NUT maintainer!)
   0.217060	Trying megatec protocol...
   0.217098	send: Q1
   0.233946	received 96 (96)
   0.234029	read: (000.0 000.0 000.0 000 00.0 0.00 00.0 00000000
   0.234197	Status read in 1 tries
   0.234227	Supported UPS detected with megatec protocol
   0.234255	send: F
   0.243919	received 46 (46)
   0.243995	read: #000.0 0.0 00.00 00.0
   0.244087	Ratings read in 1 tries
   0.244121	send: I
   0.258911	received 80 (80)
   0.258995	read: #                                     
   0.259069	Vendor information read in 1 tries
   0.259156	battery runtime exponent : 1.585
   0.259201	battery runtime nominal  : 240.0
   0.259276	battery runtime estimate : 0.0
   0.259312	No charge time specified, using built in default [43200 seconds]
   0.259562	No idle load specified, using built in default [10.0 %]
   0.259670	send: Q1
   0.275917	received 96 (96)
   0.276001	read: (000.0 000.0 000.0 000 00.0 0.00 00.0 00000000
   0.276270	dstate_init: sock /var/run/nut/blazer_usb-ups1 open on fd 5
   0.276359	send: Q1
   0.292912	received 96 (96)
   0.292997	read: (000.0 000.0 000.0 000 00.0 0.0 No  No  No  No 
   0.293067	blazer_status: non numerical value [No]
   0.293096	Invalid status [No]
   0.293124	Communications with UPS lost: status read failed!
   2.278440	send: Q1
   2.294815	received 96 (96)
   2.294903	read: (000.0 000.0 000.0 000 00.0 0.00 00.0 00000000
   4.279447	send: Q1
   4.296797	received 96 (96)
   4.296868	read: (000.0 000.0 000.0 000 00.0 0.00 00.0 00000000

There is no any difference with nutdrv_qx driver :(

root@eeepc:~# /lib/nut/nutdrv_qx -DDD -a ups1
Network UPS Tools - Generic Q* USB/Serial driver 0.28 (2.7.4)
USB communication driver 0.33
   0.000000	debug level is '3'
   0.003789	upsdrv_initups...
   0.004188	Language ID workaround enabled (using '0x409')
   0.117155	Checking device (1D6B/0001) (005/001)
   0.144955	- VendorID: 1d6b
   0.145024	- ProductID: 0001
   0.145053	- Manufacturer: unknown
   0.145080	- Product: unknown
   0.145107	- Serial Number: unknown
   0.145134	- Bus: 005
   0.145162	- Device release number: 0415
   0.145189	Trying to match device
   0.145220	Device does not match - skipping
   0.145274	Checking device (1D6B/0001) (004/001)
   0.172913	- VendorID: 1d6b
   0.172984	- ProductID: 0001
   0.173013	- Manufacturer: unknown
   0.173040	- Product: unknown
   0.173066	- Serial Number: unknown
   0.173093	- Bus: 004
   0.173120	- Device release number: 0415
   0.173147	Trying to match device
   0.173179	Device does not match - skipping
   0.173232	Checking device (1D6B/0001) (003/001)
   0.200910	- VendorID: 1d6b
   0.200979	- ProductID: 0001
   0.201008	- Manufacturer: unknown
   0.201033	- Product: unknown
   0.201060	- Serial Number: unknown
   0.201087	- Bus: 003
   0.201114	- Device release number: 0415
   0.201140	Trying to match device
   0.201172	Device does not match - skipping
   0.201224	Checking device (0001/0000) (002/003)
   0.213154	- VendorID: 0001
   0.214296	- ProductID: 0000
   0.215534	- Manufacturer: unknown
   0.216697	- Product: MEC0003
   0.218054	- Serial Number: unknown
   0.219194	- Bus: 002
   0.220066	- Device release number: 0100
   0.220184	Trying to match device
   0.220606	Device matches
   0.231179	nut_usb_set_altinterface: skipped usb_set_altinterface(udev, 0)
   0.236203	First supported language ID: 0x409 (please report to the NUT maintainer!)
   0.236382	send: QGS
   0.236498	read: QGS
   0.237073	qx_process_answer: short reply (input.voltage)
   0.237208	send: QGS
   0.237398	read: QGS
   0.237517	qx_process_answer: short reply (input.voltage)
   0.237952	send: QGS
   0.238113	read: QGS
   0.238223	qx_process_answer: short reply (input.voltage)
   0.238421	send: M
   0.238853	read: M
   0.238973	voltronic_qs_protocol: invalid protocol [M]
   0.239196	send: M
   0.239661	read: M
   0.239797	voltronic_qs_protocol: invalid protocol [M]
   0.240005	send: M
   0.240454	read: M
   0.240578	voltronic_qs_protocol: invalid protocol [M]
   0.241168	send: M
   0.241433	read: M
   0.241822	voltronic_qs_hex_protocol: invalid protocol [M]
   0.241942	send: M
   0.242137	read: M
   0.242518	voltronic_qs_hex_protocol: invalid protocol [M]
   0.242634	send: M
   0.242819	read: M
   0.243217	voltronic_qs_hex_protocol: invalid protocol [M]
   0.243338	send: QS
   0.243771	read: QS
   0.243891	qx_process_answer: short reply (input.voltage)
   0.244352	send: QS
   0.244467	read: QS
   0.245100	qx_process_answer: short reply (input.voltage)
   0.245255	send: QS
   0.245431	read: QS
   0.245535	qx_process_answer: short reply (input.voltage)
   0.245640	send: D
   0.245745	read: D
   0.246218	qx_process_answer: short reply (input.voltage)
   0.246347	send: D
   0.246555	read: D
   0.246961	qx_process_answer: short reply (input.voltage)
   0.247130	send: D
   0.247330	read: D
   0.247714	qx_process_answer: short reply (input.voltage)
   0.247839	send: Q1
   0.265147	received 96 (96)
   0.265361	read: (000.0 000.0 000.0 000 00.0 0.00 00.0 00000000
   0.265855	send: ID
   0.265981	read: ID
   0.266182	send: Q1
   0.283180	received 96 (96)
   0.283395	read: (000.0 000.0 000.0 000 00.0 0.00 00.0 00000000
   0.283885	send: ID
   0.284005	read: ID
   0.284200	send: Q1
   0.301165	received 96 (96)
   0.301378	read: (000.0 000.0 000.0 000 00.0 0.00 00.0 00000000
   0.301518	send: ID
   0.301626	read: ID
   0.301737	send: Q1
   0.319202	received 96 (96)
   0.319412	read: (000.0 000.0 000.0 000 00.0 0.00 00.0 00000000
   0.319554	send: QPI
   0.319665	read: QPI
   0.319776	qx_process_answer: short reply (ups.firmware.aux)
   0.320297	send: Q1
   0.337163	received 96 (96)
   0.337378	read: (000.0 000.0 000.0 000 00.0 0.00 00.0 00000000
   0.337523	send: QPI
   0.337633	read: QPI
   0.337745	qx_process_answer: short reply (ups.firmware.aux)
   0.337861	send: Q1
   0.355166	received 96 (96)
   0.355380	read: (000.0 000.0 000.0 000 00.0 0.00 00.0 00000000
   0.355852	send: QPI
   0.355995	read: QPI
   0.356110	qx_process_answer: short reply (ups.firmware.aux)
   0.356591	send: Q1
   0.373260	received 96 (96)
   0.373469	read: (000.0 000.0 000.0 000 00.0 0.00 00.0 00000000
   0.373967	send: I
   0.389141	received 80 (80)
   0.389343	read: #                                     
   0.389467	ups_infoval_set: non significant value [ups.firmware]
   0.389587	send: Q1
   0.407174	received 96 (96)
   0.407385	read: (000.0 000.0 000.0 000 00.0 0.00 00.0 00000000
   0.407538	send: I
   0.422201	received 80 (80)
   0.422402	read: #                                     
   0.422523	ups_infoval_set: non significant value [ups.firmware]
   0.422642	send: Q1
   0.440168	received 96 (96)
   0.440379	read: (00 No  No  No  No  No  No  No  No  No  No  No 
   0.440497	ups_infoval_set: non numerical value [input.voltage: 00 No]
   0.440610	send: Q1
   0.458158	received 96 (96)
   0.458373	read: (000.0 000.0 000.0 000 00.0 0.00 00.0 00000000
   0.458526	send: FW?
   0.458635	read: FW?
   0.459105	qx_process_answer: short reply (ups.firmware)
   0.459232	send: Q1
   0.476159	received 96 (96)
   0.476513	read: (000.0 000.0 000.0 000 00.0 0.00 00.0 00000000
   0.476753	send: FW?
   0.477211	read: FW?
   0.477398	qx_process_answer: short reply (ups.firmware)
   0.477520	send: Q1
   0.494149	received 96 (96)
   0.494360	read: (000.0  No  No  No  No  No  No  No  No  No  No 
   0.494512	send: FW?
   0.494619	read: FW?
   0.494725	qx_process_answer: short reply (ups.firmware)
   0.495289	send: Q1
   0.512193	received 96 (96)
   0.512898	read: (000.0 000.0 000.0 000 00.0 0.00 00.0 00000000
   0.513057	Using protocol: Q1 0.07
   0.513578	upsdrv_initinfo...
   0.513715	send: Q1
   0.530170	received 96 (96)
   0.530385	read: (000.0 000.0 000.0 000 00.0 0.00 00.0 00000000
   0.530755	Can't autodetect number of battery packs [-1/0.00]
   0.531655	qx_initbattery: battery runtime exponent: 1.585
   0.531891	qx_initbattery: battery runtime nominal: 240.0
   0.532344	qx_initbattery: battery runtime estimate: 0.0
   0.532552	No charge time specified, using built in default [43200 seconds]
   0.533149	No idle load specified, using built in default [10.0 %]
   0.533375	upsdrv_updateinfo...
   0.533761	Quick update...
   0.533962	send: Q1
   0.551171	received 96 (96)
   0.551388	read: (000.0 000.0 000.0 000 00.0 0.00 00.0 00000000
   0.552048	dstate_init: sock /var/run/nut/nutdrv_qx-ups1 open on fd 5
   0.552581	upsdrv_updateinfo...
   0.552905	Quick update...
   0.553345	send: Q1
   0.570139	received 96 (96)
   0.570349	read: (000.0 000.0 000.0 000 00.0 0.00 00.0 00000000
   2.552703	upsdrv_updateinfo...
   2.552774	Quick update...
   2.552805	send: Q1
   2.569019	received 96 (96)
   2.569133	read: (000.0 000.0 000.0 000 00.0 0.00 00.0 00000000
   4.553811	upsdrv_updateinfo...
   4.553891	Quick update...
   4.553933	send: Q1
   4.570921	received 96 (96)
   4.571048	read: (000.0 000.0 000.0 000 00.0 0.00 00.0 00000000

@zykh
Copy link
Contributor

zykh commented Jul 30, 2019

hmm...
a few questions:

  1. if you replug the UPS to PC 1 (the one where data was retrieved correctly), does the driver get the missing data again?
  2. did PC 1 have perhaps the original software running before launching NUT?
  3. using nutdrv_qx from Add support for Hunnox HNX-850 #638 does any difference?

@tazhate
Copy link
Author

tazhate commented Aug 1, 2019

  1. yeah, after some time of uptime
  2. yeah, but it is not "original". it is upsmart, in windows vm.
  3. i'll check, thanks

@jimklimov jimklimov added USB Qx protocol driver Driver based on Megatec Q<number> such as new nutdrv_qx, or obsoleted blazer and some others USB VID=0001 PID=0000 (Fry's Electronics/MEC0003) Seems to be a generic USB chip interfacing many devices and protocols (Qx, USB HID, ATCL...) UPSmart Some UPS are shipped with UPSmart software which may imply common (Qx?) protocol labels Apr 10, 2022
jimklimov added a commit to jimklimov/nut that referenced this issue Apr 25, 2022
@CipherGeek
Copy link

Hello.

I faced a similar problem on debian 7 (NUT version 2.6.4-2.3), recently fixed it on debian 9 (NUT version 2.7.4-5.1) in the same way, but with an additional patch that allows you to build the project.

I had the following problems:

  1. the values ​​were shown only 1 time, and became static, which changed only after rebooting the PC and sometimes when removing and inserting the USB cable back;
  2. when trying to run a self-written script to test for receiving values ​​from the UPS, sometimes a data reading error occurred on the port (in a script that was also not tailored for my UPS) due to the length of the buffer;
  3. the values ​​were sometimes shown as zeros, which were updated to real ones, but also static ones when the script was launched (1-2 times) from point 2.

The problem is that the entire line of UPS from DEXP operates on a buffer length of 102 bytes, while NUT operates on 512 bytes. Both drivers suggested here did not help me.

Changing the buffer length to 102 bytes completely solved all the problems. NUT instantly picks up the transition to the battery and any changes in external power.

My configuration ups.conf:
[dexp]
driver = blazer_usb
port = auto
desc = "DEXP IEC LCD ONLINE 3000VA"
vendorid = 0001
productid = 0000
override.battery.charge.low = 10
default.battery.voltage.low = 63.6
default.battery.voltage.high = 81.7
override.battery.voltage.nominal = 72
override.battery.packs = 36
chargetime = 43200
idleload = 1%
langid_fix = 0x0409

My patches:
nut_2.7.4-5.1_(debian9.12-stretch)-patches.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DDL HCL Qx protocol driver Driver based on Megatec Q<number> such as new nutdrv_qx, or obsoleted blazer and some others UPSmart Some UPS are shipped with UPSmart software which may imply common (Qx?) protocol USB VID=0001 PID=0000 (Fry's Electronics/MEC0003) Seems to be a generic USB chip interfacing many devices and protocols (Qx, USB HID, ATCL...) USB
Projects
None yet
Development

No branches or pull requests

4 participants