linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ttyACM strange chars appearing at connect
@ 2020-05-19 12:14 Joakim Tjernlund
  2020-05-19 12:54 ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Joakim Tjernlund @ 2020-05-19 12:14 UTC (permalink / raw)
  To: linux-usb

Whenever we connect a Linux laptop(4.19.118) to our ttyACM serial gadget we can see som strange
chars appearing in our gadget:
03�`3�03�x�x(in hex: 3033 efbf bd60 33ef bfbd 3033 efbf bd78 efbf bd78)
They appear witch c.a 1 sec in between.
I assume it is the laptops ACM driver emitting those, but why? Can these chars be turned off?

 Jocke

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: ttyACM strange chars appearing at connect
  2020-05-19 12:14 ttyACM strange chars appearing at connect Joakim Tjernlund
@ 2020-05-19 12:54 ` Greg KH
  2020-05-19 13:24   ` Joakim Tjernlund
  2020-05-20 12:43   ` Joakim Tjernlund
  0 siblings, 2 replies; 6+ messages in thread
From: Greg KH @ 2020-05-19 12:54 UTC (permalink / raw)
  To: Joakim Tjernlund; +Cc: linux-usb

On Tue, May 19, 2020 at 12:14:55PM +0000, Joakim Tjernlund wrote:
> Whenever we connect a Linux laptop(4.19.118) to our ttyACM serial gadget we can see som strange
> chars appearing in our gadget:
> 03�`3�03�x�x(in hex: 3033 efbf bd60 33ef bfbd 3033 efbf bd78 efbf bd78)
> They appear witch c.a 1 sec in between.
> I assume it is the laptops ACM driver emitting those, but why? Can these chars be turned off?

It's a program on your laptop probing the device.  Usually modemmanager
or something like that.

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: ttyACM strange chars appearing at connect
  2020-05-19 12:54 ` Greg KH
@ 2020-05-19 13:24   ` Joakim Tjernlund
  2020-05-20 12:43   ` Joakim Tjernlund
  1 sibling, 0 replies; 6+ messages in thread
From: Joakim Tjernlund @ 2020-05-19 13:24 UTC (permalink / raw)
  To: gregkh; +Cc: linux-usb

On Tue, 2020-05-19 at 14:54 +0200, Greg KH wrote:
> CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
> 
> 
> On Tue, May 19, 2020 at 12:14:55PM +0000, Joakim Tjernlund wrote:
> > Whenever we connect a Linux laptop(4.19.118) to our ttyACM serial gadget we can see som strange
> > chars appearing in our gadget:
> > 03�`3�03�x�x(in hex: 3033 efbf bd60 33ef bfbd 3033 efbf bd78 efbf bd78)
> > They appear witch c.a 1 sec in between.
> > I assume it is the laptops ACM driver emitting those, but why? Can these chars be turned off?
> 
> It's a program on your laptop probing the device.  Usually modemmanager
> or something like that.

Ahh, makes sense. Now I need to see how to turn it off(NetworManager pulls it in) ...

 Jocke

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: ttyACM strange chars appearing at connect
  2020-05-19 12:54 ` Greg KH
  2020-05-19 13:24   ` Joakim Tjernlund
@ 2020-05-20 12:43   ` Joakim Tjernlund
  2020-05-20 13:08     ` Dan Williams
  1 sibling, 1 reply; 6+ messages in thread
From: Joakim Tjernlund @ 2020-05-20 12:43 UTC (permalink / raw)
  To: gregkh; +Cc: linux-usb

On Tue, 2020-05-19 at 14:54 +0200, Greg KH wrote:
> CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
> 
> 
> On Tue, May 19, 2020 at 12:14:55PM +0000, Joakim Tjernlund wrote:
> > Whenever we connect a Linux laptop(4.19.118) to our ttyACM serial gadget we can see som strange
> > chars appearing in our gadget:
> > 03�`3�03�x�x(in hex: 3033 efbf bd60 33ef bfbd 3033 efbf bd78 efbf bd78)
> > They appear witch c.a 1 sec in between.
> > I assume it is the laptops ACM driver emitting those, but why? Can these chars be turned off?
> 
> It's a program on your laptop probing the device.  Usually modemmanager
> or something like that.
> 
> greg k-h

Right you were, it was modemmanager :)

Fixing that I can occasion se in my DE:
[Wed May 20 14:03:16 2020] cdc_ether 1-6.2:1.0 usb0: unregister 'cdc_ether' usb-0000:00:14.0-6.2, CDC Ethernet Device
[Wed May 20 14:03:25 2020] usb usb1-port6: disabled by hub (EMI?), re-enabling...
[Wed May 20 14:03:25 2020] usb 1-6: USB disconnect, device number 85
[Wed May 20 14:03:25 2020] cdc_acm 1-6.3:1.1: acm_ctrl_irq - usb_submit_urb failed: -19
[Wed May 20 14:03:25 2020] usb 1-6-port2: attempt power cycle
[Wed May 20 14:03:26 2020] usb 1-6.3: USB disconnect, device number 86
[Wed May 20 14:03:26 2020] cdc_acm 1-6.3:1.1: failed to set dtr/rts
[Wed May 20 14:03:26 2020] usb 1-6: new high-speed USB device number 94 using xhci_hcd
[Wed May 20 14:03:27 2020] hub 1-6:1.0: USB hub found
[Wed May 20 14:03:27 2020] hub 1-6:1.0: 3 ports detected
[Wed May 20 14:03:27 2020] usb 1-6.2: new high-speed USB device number 95 using xhci_hcd
[Wed May 20 14:03:27 2020] cdc_ether 1-6.2:1.0 usb0: register 'cdc_ether' at usb-0000:00:14.0-6.2, CDC Ethernet Device, 7e:1d:06:c0:3f:3c
[Wed May 20 14:03:27 2020] usb 1-6.3: new high-speed USB device number 96 using xhci_hcd
[Wed May 20 14:03:27 2020] cdc_acm 1-6.3:1.1: ttyACM0: USB ACM device

This "disabled by hub (EMI?), re-enabling" may be from:
  EM interference sometimes causes bad shielded USB devices to 
  be shutdown by the hub, this hack enables them again.

But a another side effect from this is that I get a lot of garbage chars in the other end, like:
 h�^@^@� ^@^@� ^@
or
 X���)H��4Ğ^���
I wonder if this can be caused by the USB/ACM driver ?

 Jocke

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: ttyACM strange chars appearing at connect
  2020-05-20 12:43   ` Joakim Tjernlund
@ 2020-05-20 13:08     ` Dan Williams
  2020-05-20 13:29       ` Joakim Tjernlund
  0 siblings, 1 reply; 6+ messages in thread
From: Dan Williams @ 2020-05-20 13:08 UTC (permalink / raw)
  To: Joakim Tjernlund, gregkh; +Cc: linux-usb

On Wed, 2020-05-20 at 12:43 +0000, Joakim Tjernlund wrote:
> On Tue, 2020-05-19 at 14:54 +0200, Greg KH wrote:
> > CAUTION: This email originated from outside of the organization. Do
> > not click links or open attachments unless you recognize the sender
> > and know the content is safe.
> > 
> > 
> > On Tue, May 19, 2020 at 12:14:55PM +0000, Joakim Tjernlund wrote:
> > > Whenever we connect a Linux laptop(4.19.118) to our ttyACM serial
> > > gadget we can see som strange
> > > chars appearing in our gadget:
> > > 03�`3�03�x�x(in hex: 3033 efbf bd60 33ef bfbd 3033 efbf bd78 efbf
> > > bd78)
> > > They appear witch c.a 1 sec in between.
> > > I assume it is the laptops ACM driver emitting those, but why?
> > > Can these chars be turned off?
> > 
> > It's a program on your laptop probing the device.  Usually
> > modemmanager
> > or something like that.
> > 
> > greg k-h
> 
> Right you were, it was modemmanager :)

If the device has a unique ID that isn't a modem, it can be added to
ModemManager's blacklist.

Also note that recent versions of ModemManager flipped the logic and
will only probe *known* modems, require explicit requests to probe
possible modems, and of course won't probe anything on the blacklist.

Dan

> Fixing that I can occasion se in my DE:
> [Wed May 20 14:03:16 2020] cdc_ether 1-6.2:1.0 usb0: unregister
> 'cdc_ether' usb-0000:00:14.0-6.2, CDC Ethernet Device
> [Wed May 20 14:03:25 2020] usb usb1-port6: disabled by hub (EMI?),
> re-enabling...
> [Wed May 20 14:03:25 2020] usb 1-6: USB disconnect, device number 85
> [Wed May 20 14:03:25 2020] cdc_acm 1-6.3:1.1: acm_ctrl_irq -
> usb_submit_urb failed: -19
> [Wed May 20 14:03:25 2020] usb 1-6-port2: attempt power cycle
> [Wed May 20 14:03:26 2020] usb 1-6.3: USB disconnect, device number
> 86
> [Wed May 20 14:03:26 2020] cdc_acm 1-6.3:1.1: failed to set dtr/rts
> [Wed May 20 14:03:26 2020] usb 1-6: new high-speed USB device number
> 94 using xhci_hcd
> [Wed May 20 14:03:27 2020] hub 1-6:1.0: USB hub found
> [Wed May 20 14:03:27 2020] hub 1-6:1.0: 3 ports detected
> [Wed May 20 14:03:27 2020] usb 1-6.2: new high-speed USB device
> number 95 using xhci_hcd
> [Wed May 20 14:03:27 2020] cdc_ether 1-6.2:1.0 usb0: register
> 'cdc_ether' at usb-0000:00:14.0-6.2, CDC Ethernet Device,
> 7e:1d:06:c0:3f:3c
> [Wed May 20 14:03:27 2020] usb 1-6.3: new high-speed USB device
> number 96 using xhci_hcd
> [Wed May 20 14:03:27 2020] cdc_acm 1-6.3:1.1: ttyACM0: USB ACM device
> 
> This "disabled by hub (EMI?), re-enabling" may be from:
>   EM interference sometimes causes bad shielded USB devices to 
>   be shutdown by the hub, this hack enables them again.
> 
> But a another side effect from this is that I get a lot of garbage
> chars in the other end, like:
>  h�^@^@� ^@^@� ^@
> or
>  X���)H��4Ğ^���
> I wonder if this can be caused by the USB/ACM driver ?
> 
>  Jocke


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: ttyACM strange chars appearing at connect
  2020-05-20 13:08     ` Dan Williams
@ 2020-05-20 13:29       ` Joakim Tjernlund
  0 siblings, 0 replies; 6+ messages in thread
From: Joakim Tjernlund @ 2020-05-20 13:29 UTC (permalink / raw)
  To: gregkh, dcbw; +Cc: linux-usb

On Wed, 2020-05-20 at 08:08 -0500, Dan Williams wrote:
> On Wed, 2020-05-20 at 12:43 +0000, Joakim Tjernlund wrote:
> > On Tue, 2020-05-19 at 14:54 +0200, Greg KH wrote:
> > > CAUTION: This email originated from outside of the organization. Do
> > > not click links or open attachments unless you recognize the sender
> > > and know the content is safe.
> > > 
> > > 
> > > On Tue, May 19, 2020 at 12:14:55PM +0000, Joakim Tjernlund wrote:
> > > > Whenever we connect a Linux laptop(4.19.118) to our ttyACM serial
> > > > gadget we can see som strange
> > > > chars appearing in our gadget:
> > > > 03�`3�03�x�x(in hex: 3033 efbf bd60 33ef bfbd 3033 efbf bd78 efbf
> > > > bd78)
> > > > They appear witch c.a 1 sec in between.
> > > > I assume it is the laptops ACM driver emitting those, but why?
> > > > Can these chars be turned off?
> > > 
> > > It's a program on your laptop probing the device.  Usually
> > > modemmanager
> > > or something like that.
> > > 
> > > greg k-h
> > 
> > Right you were, it was modemmanager :)
> 
> If the device has a unique ID that isn't a modem, it can be added to
> ModemManager's blacklist.

Yes, I did that:
cat /etc/udev/rules.d/70-mm-usb-LC-blacklist.rules 
ACTION!="add|change|move|bind", GOTO="mm_usb_device_blacklist_end"
SUBSYSTEM!="usb", GOTO="mm_usb_device_blacklist_end"

# XTM LC serial port
ATTRS{idVendor}=="0424", ATTRS{idProduct}=="274e", ENV{ID_MM_TTY_BLACKLIST}="1"

LABEL="mm_usb_device_blacklist_end"

> 
> Also note that recent versions of ModemManager flipped the logic and
> will only probe *known* modems, require explicit requests to probe
> possible modems, and of course won't probe anything on the blacklist.

I got 1.12.6, not new enough I guess?

> 
> Dan
> 
> > Fixing that I can occasion se in my DE:
> > [Wed May 20 14:03:16 2020] cdc_ether 1-6.2:1.0 usb0: unregister
> > 'cdc_ether' usb-0000:00:14.0-6.2, CDC Ethernet Device
> > [Wed May 20 14:03:25 2020] usb usb1-port6: disabled by hub (EMI?),
> > re-enabling...
> > [Wed May 20 14:03:25 2020] usb 1-6: USB disconnect, device number 85
> > [Wed May 20 14:03:25 2020] cdc_acm 1-6.3:1.1: acm_ctrl_irq -
> > usb_submit_urb failed: -19
> > [Wed May 20 14:03:25 2020] usb 1-6-port2: attempt power cycle
> > [Wed May 20 14:03:26 2020] usb 1-6.3: USB disconnect, device number
> > 86
> > [Wed May 20 14:03:26 2020] cdc_acm 1-6.3:1.1: failed to set dtr/rts
> > [Wed May 20 14:03:26 2020] usb 1-6: new high-speed USB device number
> > 94 using xhci_hcd
> > [Wed May 20 14:03:27 2020] hub 1-6:1.0: USB hub found
> > [Wed May 20 14:03:27 2020] hub 1-6:1.0: 3 ports detected
> > [Wed May 20 14:03:27 2020] usb 1-6.2: new high-speed USB device
> > number 95 using xhci_hcd
> > [Wed May 20 14:03:27 2020] cdc_ether 1-6.2:1.0 usb0: register
> > 'cdc_ether' at usb-0000:00:14.0-6.2, CDC Ethernet Device,
> > 7e:1d:06:c0:3f:3c
> > [Wed May 20 14:03:27 2020] usb 1-6.3: new high-speed USB device
> > number 96 using xhci_hcd
> > [Wed May 20 14:03:27 2020] cdc_acm 1-6.3:1.1: ttyACM0: USB ACM device
> > 
> > This "disabled by hub (EMI?), re-enabling" may be from:
> >   EM interference sometimes causes bad shielded USB devices to 
> >   be shutdown by the hub, this hack enables them again.
> > 
> > But a another side effect from this is that I get a lot of garbage
> > chars in the other end, like:
> >  h�^@^@� ^@^@� ^@
> > or
> >  X���)H��4Ğ^���
> > I wonder if this can be caused by the USB/ACM driver ?
> > 
> >  Jocke


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-05-20 13:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-19 12:14 ttyACM strange chars appearing at connect Joakim Tjernlund
2020-05-19 12:54 ` Greg KH
2020-05-19 13:24   ` Joakim Tjernlund
2020-05-20 12:43   ` Joakim Tjernlund
2020-05-20 13:08     ` Dan Williams
2020-05-20 13:29       ` Joakim Tjernlund

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).