From owner-freebsd-usb@freebsd.org Tue May 11 11:33:53 2021 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D8B4E63414B for ; Tue, 11 May 2021 11:33:53 +0000 (UTC) (envelope-from lev@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FfbR55ktLz3nXJ; Tue, 11 May 2021 11:33:53 +0000 (UTC) (envelope-from lev@FreeBSD.org) Received: from onlyone.not-for.work (onlyone.not-for.work [148.251.9.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: lev/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 9D72821FF9; Tue, 11 May 2021 11:33:53 +0000 (UTC) (envelope-from lev@FreeBSD.org) Received: from [192.168.134.16] (unknown [94.19.224.8]) (Authenticated sender: lev@serebryakov.spb.ru) by onlyone.not-for.work (Postfix) with ESMTPSA id AB92E431C; Tue, 11 May 2021 14:33:51 +0300 (MSK) Reply-To: lev@FreeBSD.org Subject: Re: Flickering connection to UPS (again, but now I'm sure it is Ok under Windows) To: Hans Petter Selasky , freebsd-usb@freebsd.org References: <98420b49-dc9a-0a5f-bcfe-e0a0e11a5994@selasky.org> <0c52bcf1-3b1a-a746-9ac3-26bdb4c46354@FreeBSD.org> <6e52d05d-8668-8c38-6745-a4edec50741d@selasky.org> <9a7b3be1-d606-cca6-d6c0-7ebefdfd4753@FreeBSD.org> <0814e5e8-45dd-14c8-3206-40eab0dc286e@selasky.org> <035b4eb7-58bd-8555-3416-39e0ec0a665e@FreeBSD.org> From: Lev Serebryakov Organization: FreeBSD Message-ID: Date: Tue, 11 May 2021 14:33:51 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 May 2021 11:33:53 -0000 On 09.05.2021 21:51, Hans Petter Selasky wrote: > Could you do: > > usbdump -i usbusX -f Y -s 65536 -vvv > > Where X.Y are the numbers after ugen for this device. Are you certain that NUT only execute exactly the same commands like the windows tool for this UPS? Does apcupsd work for this device too? I've never used NUT myself. Ok, results are encouraging: If NUT's (user-mode) driver starts fast enough to detect UPS, UPS stops to disconnect and works! After that, NUT could be stopped and/or restarted, but UPS remains connected. It is almost impossible to achieve with running NUT on startup (as UPS flickering from system power-up and there is no guarantee, that startup scripts will run in proper moment). Even `devd` could be not fast enough :-( Traffic received with usbdump is here: http://lev.serebryakov.spb.ru/_sklad/ups/ups-freebsd-with-nut-no-flickr-usbdump.txt Looks like, I need small kernel-level driver which "prime" HID UPSes on connect with pre-canned requests to stop them from disconnect. -- // Lev Serebryakov