Re: Flickering connection to UPS (again, but now I'm sure it is Ok under Windows)

2021-05-09 Thread Hans Petter Selasky

On 5/7/21 11:41 PM, Lev Serebryakov wrote:

On 07.05.2021 17:14, Hans Petter Selasky wrote:


ster kernel: xhci_roothub_exec: port status=0x000202a0
May  7 14:39:08 hamster kernel: xhci_roothub_exec: type=0x23 
request=0x01 wLen=0x wValue=0x0010 wIndex=0x0002

May  7 14:39:08 hamster kernel: xhci_roothub_exec: UR_CLEAR_PORT_FEATURE
May  7 14:39:08 hamster kernel: xhci_device_state_change: May  7 
14:39:08 hamster kernel: ugen0.6:  at usbus0 
(disconnected)


The value reported by XHCI PORTSC, 0x000202a0, indicates:

BIT5-8 : 5) Link is in the RxDetect State
BIT9 : Port Power (PP) – RWS. Default = ‘1’
BIT17 : Connect Status Change (CSC)

It is clear that the XHCI controller has received a disconnect event 
from the UPS.
Can you check the other OS'es where this supposedly does not happen, 
if the UPS device attaches to the XHCI or EHCI controller?


Windows 10 Device Manager shows it under "Intel(R) USB 3.1 eXtensible 
Host Controller". This laptop (with Windows 10) has only USB-C ports...


I've captured sessions on Windows with "Device Monitoring Studio" and 
WireShark (it was two sessions, not one) and uploaded them at


http://lev.serebryakov.spb.ru/_sklad/ups/

ups-windows-dms.dump - dump from "Device Monitoring Studio"
ups-windows-dms.log  - log from "Device Monitoring Studio"
ups-windows-wireshark.pcapng - dump from WireShark
ups-windows-wireshark.txt    - dissection export from WireShark.

My FreeBSD laptop (Lenovo T540p) has both USB 2.0 an USB 3.0 ports, and 
UPS flickers in both.



Did you start any driver for the UPS?
On FreeBSD — I'm not (`nut` supports this UPS, but it detects device 
slower than UPS stay connected).


Windows 10, Windows installs something generic and not very useful (it 
shows battery level as 0%), but "provided" software (very crude one) 
works and shows plausible information.


Windows 10 shows it as "HID UPS Battery" in device manager.



Hi,

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.


--HPS
___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: Flickering connection to UPS (again, but now I'm sure it is Ok under Windows)

2021-05-09 Thread Hans Petter Selasky

On 5/9/21 8:51 PM, Hans Petter Selasky wrote:


Could you do:

usbdump -i usbusX -f Y -s 65536 -vvv


Then connect the device and run nut.

If you don't run nut, does the same attach/detach happen?

--HPS
___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Problem reports for u...@freebsd.org that need special attention

2021-05-09 Thread bugzilla-noreply
To view an individual PR, use:
  https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=(Bug Id).

The following is a listing of current problems submitted by FreeBSD users,
which need special attention. These represent problem reports covering
all versions including experimental development code and obsolete releases.

Status  |Bug Id | Description
+---+---
Open|213877 | xhci reset causes panic on SuperMicro A1SRi-2758F 
Open|234578 | Support for Sierra Wireless EM7455 modem  
Open|247964 | Low read throughput on Sandisk Extreme external S 

3 problems total for which you should take action.
___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: Touchscreen "TSTP MTouch"

2021-05-09 Thread Oliver Fromme
Hans Petter Selasky wrote:
 > On 5/7/21 7:29 PM, Oliver Fromme wrote:
 > > I've bought a 7" touchscreen.  It's intended for an RPi, but
 > > it can also be connected to a standard PC via HDMI + USB,
 > > which is what I do.  Vendor & product ID is 0x0416 & 0xc168.
 > > 
 > > The actual display works fine with Xorg as usual.  But I'm
 > > having problems getting the touch feature to work.
 > > 
 > > According to the vendor, it's a standard USB HID interface
 > > that works without additional driver in Windows, and is also
 > > supported by Linux (apparently for several years already).
 > > It's supposed to work out of the box with typical Linux
 > > distributions on the RPi.
 > 
 > Webcamd may need to be compiled with a special option to attach to your 
 > device. See "make config" in the port. Should create an evdev which you 
 > should be able to reach via X11.

I checked the port options again and added the "MOUSE" option
(now I have COMPAT32, DVB, INPUT, MOUSE and WEBCAM).
That didn't make a difference, though.
I assume I don't have to enable the KEYBOARD option, right?
This isn't really a keyboard device after all.

 > > System:  FreeBSD 13.0-STABLE-20210418 amd64
 > > CUSE:  Cuse v0.1.36 @ /dev/cuse
 > > webcamd port:  webcamd-5.10.6.1_2
 > > 
 > > I've created a small devd snipped that starts the webcamd
 > > service when the vendor ID and product ID are matched.
 > > These are the log messages when I insert the USB plug:
 > 
 > Does "webcamd -l" list the device?

Yes:
# webcamd -l
Available device(s):
[...]
webcamd [-d ugen1.5] -N TSTP-MTouch -S unknown -M 0

 > If you start it from the command line, does it attach?

No, it behaves exactly the same as when started via devd.

 > You may also want to trace the USB traffic:
 > 
 > usbdump -i usbus0 -f 2 -s 65536 -vvv
 > 
 > To see why "error reading report description" fails.

Ok, I did that.
I'm afraid that I'm not much of a USB protocol expert, so I
can't make much sense of the output.  But I notice that there
are several lines containing "ERR=STALLED"; that doesn't
sound good.

I have attached the complete output below.

Regards
  - Olli

# usbdump -i usbus1 -f 5 -s 65536 -vvv
22:56:30.509616 usbus1.5 SUBM-CTRL-EP=,SPD=FULL,NFR=1,SLEN=8,IVAL=0
 frame[0] WRITE 8 bytes
   00 05 05 00 00 00 00 00  -- -- -- -- -- -- -- --  ||
 flags 0x50 
 status 0xea3a3 

22:56:30.509833 usbus1.5 
DONE-CTRL-EP=,SPD=FULL,NFR=1,SLEN=0,IVAL=0,ERR=0
 frame[0] WRITE 8 bytes
 flags 0x50 
 status 0xca3a1 

22:56:30.509841 usbus1.5 SUBM-CTRL-EP=,SPD=FULL,NFR=1,SLEN=0,IVAL=0
 frame[0] WRITE 0 bytes
 flags 0x10 
 status 0xca0a3 

22:56:30.509956 usbus1.5 
DONE-CTRL-EP=,SPD=FULL,NFR=1,SLEN=0,IVAL=0,ERR=0
 frame[0] WRITE 0 bytes
 flags 0x10 
 status 0xea0a1 

22:56:30.529698 usbus1.5 SUBM-CTRL-EP=0080,SPD=FULL,NFR=2,SLEN=8,IVAL=0
 frame[0] WRITE 8 bytes
   80 06 00 01 00 00 08 00  -- -- -- -- -- -- -- --  ||
 frame[1] READ 8 bytes
 flags 0x10 
 status 0xea1a3 

22:56:30.529833 usbus1.5 
DONE-CTRL-EP=0080,SPD=FULL,NFR=2,SLEN=8,IVAL=0,ERR=0
 frame[0] WRITE 8 bytes
 frame[1] READ 8 bytes
   12 01 00 02 00 00 00 40  -- -- -- -- -- -- -- --  |...@|
 flags 0x10 
 status 0xca1a1 

22:56:30.536138 usbus1.5 SUBM-CTRL-EP=0080,SPD=FULL,NFR=2,SLEN=8,IVAL=0
 frame[0] WRITE 8 bytes
   80 06 00 01 00 00 12 00  -- -- -- -- -- -- -- --  ||
 frame[1] READ 18 bytes
 flags 0x10 
 status 0xea1a3 

22:56:30.536332 usbus1.5 
DONE-CTRL-EP=0080,SPD=FULL,NFR=2,SLEN=20,IVAL=0,ERR=0
 frame[0] WRITE 8 bytes
 frame[1] READ 18 bytes
   12 01 00 02 00 00 00 40  16 04 68 C1 00 00 01 02  |...@..h.|
 0010  03 01 -- -- -- -- -- --  -- -- -- -- -- -- -- --  |..  |
 flags 0x10 
 status 0xca1a1 

22:56:30.536344 usbus1.5 SUBM-CTRL-EP=0080,SPD=FULL,NFR=2,SLEN=8,IVAL=0
 frame[0] WRITE 8 bytes
   80 06 00 03 00 00 02 00  -- -- -- -- -- -- -- --  ||
 frame[1] READ 2 bytes
 flags 0x10 
 status 0xca1a3 

22:56:30.536457 usbus1.5 
DONE-CTRL-EP=0080,SPD=FULL,NFR=2,SLEN=4,IVAL=0,ERR=0
 frame[0] WRITE 8 bytes
 frame[1] READ 2 bytes
   04 03 -- -- -- -- -- --  -- -- -- -- -- -- -- --  |..  |
 flags 0x10 
 status 0xea1a1 

22:56:30.536463 usbus1.5 SUBM-CTRL-EP=0080,SPD=FULL,NFR=2,SLEN=8,IVAL=0
 frame[0] WRITE 8 bytes
   80 06 00 03 00 00 04 00  -- -- -- -- -- -- -- --  ||
 frame[1] READ 4 bytes
 flags 0x10 
 status 0xea1a3 

22:56:30.536581 usbus1.5 
DONE-CTRL-EP=0080,SPD=FULL,NFR=2,SLEN=4,IVAL=0,ERR=0
 frame[0] WRITE 8 bytes
 frame[1] READ 4 bytes
   04 03 09 04 -- -- -- --  -- -- -- -- -- -- -- --  ||
 flags 0x10 
 status 0xca1a1 

22:56:30.536589 usbus1.5 SUBM-CTRL-EP=0080,SPD=FULL,NFR=2,SLEN=8,IVAL=0
 frame[0] WRITE 8 bytes
   80 06 03 03 09 04 02 00  -- -- -- -- -- -- -- --  ||
 frame[1] READ 2 bytes
 flags 0x10 
 status 0xca1a3 

22:56:30.536831 usbus1.5 
DONE-CTRL-

Re: Touchscreen "TSTP MTouch"

2021-05-09 Thread Hans Petter Selasky

On 5/9/21 11:25 PM, Oliver Fromme wrote:

22:56:30.540897 usbus1.5 SUBM-CTRL-EP=,SPD=FULL,NFR=1,SLEN=8,IVAL=0
  frame[0] WRITE 8 bytes
    21 0B 01 00 00 00 00 00  -- -- -- -- -- -- -- --  |!...|
  flags 0x10 
  status 0xca1a3


After sending what appears like a HID set report request, the device 
stops responding. Looks like a firmware bug.


Is it possible to upgrade the firmware on the touchscreen?



usb_error_t
usbd_req_set_protocol(struct usb_device *udev, struct mtx *mtx,
uint8_t iface_index, uint16_t report)
{
struct usb_interface *iface = usbd_get_iface(udev, iface_index);
struct usb_device_request req;

if ((iface == NULL) || (iface->idesc == NULL)) {
return (USB_ERR_INVAL);
}
DPRINTFN(5, "iface=%p, report=%d, endpt=%d\n",
iface, report, iface->idesc->bInterfaceNumber);

req.bmRequestType = UT_WRITE_CLASS_INTERFACE;
req.bRequest = UR_SET_PROTOCOL;
USETW(req.wValue, report);
req.wIndex[0] = iface->idesc->bInterfaceNumber;
req.wIndex[1] = 0;
USETW(req.wLength, 0);
return (usbd_do_request(udev, mtx, &req, 0));
}


--HPS
___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"