Re: Touchscreen "TSTP MTouch"

2021-05-10 Thread Oliver Fromme
Hans Petter Selasky wrote:
 > 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.

I see.  It's supposed to work out of the box with Linux, and the
reviews on Amazon indicate that it really does.  So, I guess,
either I got a defective product, or maybe Linux has a way to
work around the bug.

 > Is it possible to upgrade the firmware on the touchscreen?

The manual doesn't mention firmware upgrades.  The display shipped
with a lot of accessories, but no software.

I could try connecting it to a Windows machine and see what happens.

Regards
 - Olli


-- 
Oliver Fromme, Munich

``We are all but compressed light'' - Albert Einstein
___
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-10 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, , 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"


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 

Re: Touchscreen "TSTP MTouch"

2021-05-07 Thread Hans Petter Selasky

On 5/7/21 7:29 PM, Oliver Fromme wrote:

Hi,

I'm not sure if this is the right place to ask ... This is
the first time I'm trying to get this sort of device to work,
so please be gentle. :-)

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.


Hi,

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.




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?

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

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.

--HPS


16:43:17 kernel: ugen0.2:  at usbus0
16:43:17 kernel: ums1 on uhub2
16:43:17 kernel: ums1:  on 
usbus0
16:43:17 kernel: ums1: error reading report description
16:43:17 kernel: device_attach: ums1 attach returned 12
16:43:17 kernel: ums1 on uhub2
16:43:17 kernel: ums1:  on 
usbus0
16:43:17 kernel: ums1: error reading report description
16:43:17 kernel: device_attach: ums1 attach returned 12
16:43:19 webcamd[75654]: webcamd: Cannot find USB device
16:43:20 webcamd[75646]: webcamd: Cannot find USB device

I tried both USB3 and USB2 ports; same result.
The output from ``usbconfig dump_all_desc'' is attached below.

At this point I'm not sure how to proceed.
Is there anything I can do?  Or is this a lost case?

On a related note, are there any touchscreens that are *known*
to work with FreeBSD?  I tried searching the web, but wasn't
able to find anything useful.

Regards
  - Olli

ugen0.2:  at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA)

   bLength = 0x0012
   bDescriptorType = 0x0001
   bcdUSB = 0x0200
   bDeviceClass = 0x  
   bDeviceSubClass = 0x
   bDeviceProtocol = 0x
   bMaxPacketSize0 = 0x0040
   idVendor = 0x0416
   idProduct = 0xc168
   bcdDevice = 0x
   iManufacturer = 0x0001  
   iProduct = 0x0002  
   iSerialNumber = 0x0003  
   bNumConfigurations = 0x0001

  Configuration index 0

 bLength = 0x0009
 bDescriptorType = 0x0002
 wTotalLength = 0x0049
 bNumInterfaces = 0x0002
 bConfigurationValue = 0x0001
 iConfiguration = 0x  
 bmAttributes = 0x00a0
 bMaxPower = 0x0032

 Interface 0
   bLength = 0x0009
   bDescriptorType = 0x0004
   bInterfaceNumber = 0x
   bAlternateSetting = 0x
   bNumEndpoints = 0x0002
   bInterfaceClass = 0x0003  
   bInterfaceSubClass = 0x0001
   bInterfaceProtocol = 0x0002
   iInterface = 0x  

   Additional Descriptor

   bLength = 0x09
   bDescriptorType = 0x21
   bDescriptorSubType = 0x11
RAW dump:
0x00 | 0x09, 0x21, 0x11, 0x01, 0x00, 0x01, 0x22, 0xdf,
0x08 | 0x02

  Endpoint 0
 bLength = 0x0007
 bDescriptorType = 0x0005
 bEndpointAddress = 0x0081  
 bmAttributes = 0x0003  
 wMaxPacketSize = 0x0040
 bInterval = 0x0005
 bRefresh = 0x
 bSynchAddress = 0x

  Endpoint 1
 bLength = 0x0007
 bDescriptorType = 0x0005
 bEndpointAddress = 0x0002  
 bmAttributes = 0x0003  
 wMaxPacketSize = 0x0040
 bInterval = 0x0008
 bRefresh = 0x
 bSynchAddress = 0x


 Interface 1
   bLength = 0x0009
   bDescriptorType = 0x0004
   bInterfaceNumber = 0x0001
   bAlternateSetting = 0x
   bNumEndpoints = 0x0002
   bInterfaceClass = 0x0003  
   bInterfaceSubClass = 0x0001
   bInterfaceProtocol = 0x0002
   iInterface = 0x  

   Additional Descriptor

   bLength = 0x09
   bDescriptorType = 0x21
   bDescriptorSubType = 0x11
RAW dump:
0x00 | 0x09, 0x21, 0x11, 0x01, 0x00, 0x01, 0x22, 0x8e,
0x08 | 0x00

  Endpoint 0
 bLength = 0x0007
 bDescriptorType = 0x0005
 bEndpointAddress = 0x0083  
 bmAttributes = 0x0003  
 wMaxPacketSize = 0x0040
 bInterval = 0x0008
 bRefresh = 0x
 bSynchAddress = 0x

  Endpoint 1
 bLength = 0x0007
 bDescriptorType = 0x0005
 bEndpointAddress = 0x0004  
 

Touchscreen "TSTP MTouch"

2021-05-07 Thread Oliver Fromme
Hi,

I'm not sure if this is the right place to ask ... This is
the first time I'm trying to get this sort of device to work,
so please be gentle. :-)

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.

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:

16:43:17 kernel: ugen0.2:  at usbus0
16:43:17 kernel: ums1 on uhub2
16:43:17 kernel: ums1:  on 
usbus0
16:43:17 kernel: ums1: error reading report description
16:43:17 kernel: device_attach: ums1 attach returned 12
16:43:17 kernel: ums1 on uhub2
16:43:17 kernel: ums1:  on 
usbus0
16:43:17 kernel: ums1: error reading report description
16:43:17 kernel: device_attach: ums1 attach returned 12
16:43:19 webcamd[75654]: webcamd: Cannot find USB device
16:43:20 webcamd[75646]: webcamd: Cannot find USB device

I tried both USB3 and USB2 ports; same result.
The output from ``usbconfig dump_all_desc'' is attached below.

At this point I'm not sure how to proceed.
Is there anything I can do?  Or is this a lost case?

On a related note, are there any touchscreens that are *known*
to work with FreeBSD?  I tried searching the web, but wasn't
able to find anything useful.

Regards
 - Olli

ugen0.2:  at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA)

  bLength = 0x0012 
  bDescriptorType = 0x0001 
  bcdUSB = 0x0200 
  bDeviceClass = 0x  
  bDeviceSubClass = 0x 
  bDeviceProtocol = 0x 
  bMaxPacketSize0 = 0x0040 
  idVendor = 0x0416 
  idProduct = 0xc168 
  bcdDevice = 0x 
  iManufacturer = 0x0001  
  iProduct = 0x0002  
  iSerialNumber = 0x0003  
  bNumConfigurations = 0x0001 

 Configuration index 0

bLength = 0x0009 
bDescriptorType = 0x0002 
wTotalLength = 0x0049 
bNumInterfaces = 0x0002 
bConfigurationValue = 0x0001 
iConfiguration = 0x  
bmAttributes = 0x00a0 
bMaxPower = 0x0032 

Interface 0
  bLength = 0x0009 
  bDescriptorType = 0x0004 
  bInterfaceNumber = 0x 
  bAlternateSetting = 0x 
  bNumEndpoints = 0x0002 
  bInterfaceClass = 0x0003  
  bInterfaceSubClass = 0x0001 
  bInterfaceProtocol = 0x0002 
  iInterface = 0x  

  Additional Descriptor

  bLength = 0x09
  bDescriptorType = 0x21
  bDescriptorSubType = 0x11
   RAW dump: 
   0x00 | 0x09, 0x21, 0x11, 0x01, 0x00, 0x01, 0x22, 0xdf, 
   0x08 | 0x02

 Endpoint 0
bLength = 0x0007 
bDescriptorType = 0x0005 
bEndpointAddress = 0x0081  
bmAttributes = 0x0003  
wMaxPacketSize = 0x0040 
bInterval = 0x0005 
bRefresh = 0x 
bSynchAddress = 0x 

 Endpoint 1
bLength = 0x0007 
bDescriptorType = 0x0005 
bEndpointAddress = 0x0002  
bmAttributes = 0x0003  
wMaxPacketSize = 0x0040 
bInterval = 0x0008 
bRefresh = 0x 
bSynchAddress = 0x 


Interface 1
  bLength = 0x0009 
  bDescriptorType = 0x0004 
  bInterfaceNumber = 0x0001 
  bAlternateSetting = 0x 
  bNumEndpoints = 0x0002 
  bInterfaceClass = 0x0003  
  bInterfaceSubClass = 0x0001 
  bInterfaceProtocol = 0x0002 
  iInterface = 0x  

  Additional Descriptor

  bLength = 0x09
  bDescriptorType = 0x21
  bDescriptorSubType = 0x11
   RAW dump: 
   0x00 | 0x09, 0x21, 0x11, 0x01, 0x00, 0x01, 0x22, 0x8e, 
   0x08 | 0x00

 Endpoint 0
bLength = 0x0007 
bDescriptorType = 0x0005 
bEndpointAddress = 0x0083  
bmAttributes = 0x0003  
wMaxPacketSize = 0x0040 
bInterval = 0x0008 
bRefresh = 0x 
bSynchAddress = 0x 

 Endpoint 1
bLength = 0x0007 
bDescriptorType = 0x0005 
bEndpointAddress = 0x0004  
bmAttributes = 0x0003  
wMaxPacketSize = 0x0040 
bInterval = 0x0008 
bRefresh = 0x 
bSynchAddress = 0x 



-- 
Oliver Fromme, Munich

``We are all but compressed light'' - Albert Einstein
___
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"