NoriAbe
Posts: 28
Joined: Sat Sep 19, 2020 1:45 am

UB port activities on RasPi 3B and 4B

Sat Mar 25, 2023 6:54 am

Hi, today I realized USB ports acitvities between 3B and 4B are different.
I'm wondering those differences causes problems. So I'm thinking USB
ports activitiy on my Ras Pi 3B is wrong.

Both behaviors are from D- line (I think), USB 2.0 ports.

These are the behaviors from Ras Pi 3B.
3b-1.jpg
3b-1.jpg (107.29 KiB) Viewed 315 times
3b-2.jpg
3b-2.jpg (98.4 KiB) Viewed 315 times

And these are the behaviors from Ras Pi 4B.
4b.jpg
4b.jpg (252.34 KiB) Viewed 315 times
4B's behavior seems to be more stable than that of 3B.

Does anybody have experiences USB devices behaves incorrectly due to bad USB port behavior on Ras Pi 3B?
Last edited by NoriAbe on Sat Mar 25, 2023 9:51 am, edited 2 times in total.

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2850
Joined: Thu Jul 11, 2013 2:37 pm

Re: UB port activities on RasPi 3B and 4B

Sat Mar 25, 2023 7:28 am

What are you trying to measure?
Rockets are loud.
https://astro-pi.org

NoriAbe
Posts: 28
Joined: Sat Sep 19, 2020 1:45 am

Re: USB port activities on RasPi 3B and 4B

Sat Mar 25, 2023 11:28 am

I was trying to see the difference of USB port behavior between Ras Pi 3B and 4B.
Currently I have a problem USB port looses data if Ras Pi 3B is connected to LAN.
But I can not see the problem on Ras Pi 4B. That's why I tried to see the difference.

I know 3B has internal USB hub. It handles LAN port as well. I'm wondering such
structure may cause the problem.

Without internet LAN cable connection, no problem, USB port receives whole data
correctly. Strange ....

Do you have any Idea to avoid such problem on Rasp Pi 3B?

Otherwise do you have an idea to update the ethernet driver on Ras Pi 3B.
Currently smsc95xx is used.

Or do you have an idea to update USB driver?
Last edited by NoriAbe on Sat Mar 25, 2023 12:01 pm, edited 1 time in total.

NoriAbe
Posts: 28
Joined: Sat Sep 19, 2020 1:45 am

Re: USB port activities on RasPi 3B and 4B

Sat Mar 25, 2023 11:42 am

Actually this post is related to this :

viewtopic.php?p=2092371&hilit=Pi+keyboard#p2092371

For mr it seems ethernet communication disturbs USB port activities.
Have you experienced similar problems? Do you have any idea to solve this problem?
Such structure, USB hub handles both ethernet and USB ports, on Ras Pi 3B has serious
communication problems?

And can we solve the problem if I use "xvisor"? From my understanding, it's an ethernet
driver for Ras Pi 3B. Will it be helpuful?

Corrent conditions are :

pi@raspberrypi:~ $ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 10 (buster)
Release: 10
Codename: buster
Last edited by NoriAbe on Sat Mar 25, 2023 2:26 pm, edited 1 time in total.

NoriAbe
Posts: 28
Joined: Sat Sep 19, 2020 1:45 am

Re: USB port activities on RasPi 3B and 4B

Sat Mar 25, 2023 1:09 pm

I realized some error massages in dmsg response :

[ 4.057697] smsc95xx v2.0.0
[ 4.120344] libphy: smsc95xx-mdiobus: probed
[ 4.121325] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:37:ad:0f
.
.
.
[ 14.040273] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[ 14.055498] smsc95xx 1-1.1:1.0 eth0: Link is Down
[ 19.275212] smsc95xx 1-1.1:1.0 eth0: Link is Up - 100Mbps/Full - flow control off

Are these comments helpful?

And is this related to this issue*

https://github.com/raspberrypi/linux/issues/2744

ejolson
Posts: 10965
Joined: Tue Mar 18, 2014 11:47 am

Re: USB port activities on RasPi 3B and 4B

Sat Mar 25, 2023 2:57 pm

NoriAbe wrote:
Sat Mar 25, 2023 11:42 am
For mr it seems ethernet communication disturbs USB port activities.
Have you experienced similar problems? Do you have any idea to solve this problem?
Does WiFi disturb your USB?

You are right that Ethernet and the USB ports share the same bandwidth in the Pi 3B. In fact, this is the case with all Pi models before the 4B. The solution to this hardware constraint is the 4B.

It may be possible to run the Ethernet of the 3B in 10Mbps compatible mode and avoid enough contention that your USB ports are reliable. There is also the possibility of using an external hub and choosing a multi over a single-TT hub. I'm not sure that will help, though.

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2850
Joined: Thu Jul 11, 2013 2:37 pm

Re: UB port activities on RasPi 3B and 4B

Sat Mar 25, 2023 4:23 pm

NoriAbe wrote: I was trying to see the difference of USB port behavior between Ras Pi 3B and 4B.
Currently I have a problem USB port looses data if Ras Pi 3B is connected to LAN.
But I can not see the problem on Ras Pi 4B. That's why I tried to see the difference.
Yes, but what are the measurements in your first post? Why are they relevant?
Rockets are loud.
https://astro-pi.org

NoriAbe
Posts: 28
Joined: Sat Sep 19, 2020 1:45 am

Re: UB port activities on RasPi 3B and 4B

Sun Mar 26, 2023 3:01 am

Thanks, ejolson!
It may be possible to run the Ethernet of the 3B in 10Mbps compatible mode and avoid enough contention that your USB ports are reliable.

By the way, how can I do that?

Current settings :
2023-03-26_11-48-12.jpg
2023-03-26_11-48-12.jpg (143.88 KiB) Viewed 174 times

ejolson
Posts: 10965
Joined: Tue Mar 18, 2014 11:47 am

Re: UB port activities on RasPi 3B and 4B

Sun Mar 26, 2023 3:38 am

NoriAbe wrote:
Sun Mar 26, 2023 3:01 am
Thanks, ejolson!
It may be possible to run the Ethernet of the 3B in 10Mbps compatible mode and avoid enough contention that your USB ports are reliable.

By the way, how can I do that?

Current settings :

2023-03-26_11-48-12.jpg
I'd try

Code: Select all

# ethtool -s eth0 speed 10
to set the speed to 10Mb/s. It takes about 30 seconds to renegotiate and then the Pi should be back online.

After that I get

Code: Select all

# iperf3 -s # on the Pi
-----------------------------------------------------------
Server listening on 5201 (test #1)
-----------------------------------------------------------
Accepted connection from 192.168.174.177, port 43696
[  5] local 192.168.174.144 port 5201 connected to 192.168.174.177 port 43706
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  1.12 MBytes  9.41 Mbits/sec                  
[  5]   1.00-2.00   sec  1.12 MBytes  9.41 Mbits/sec                  
[  5]   2.00-3.00   sec  1.12 MBytes  9.42 Mbits/sec                  
[  5]   3.00-4.00   sec  1.12 MBytes  9.42 Mbits/sec                  
[  5]   4.00-5.00   sec  1.12 MBytes  9.42 Mbits/sec                  
[  5]   5.00-6.00   sec  1.12 MBytes  9.42 Mbits/sec                  
[  5]   6.00-7.00   sec  1.12 MBytes  9.41 Mbits/sec                  
[  5]   7.00-8.00   sec  1.12 MBytes  9.42 Mbits/sec                  
[  5]   8.00-9.00   sec  1.12 MBytes  9.42 Mbits/sec                  
[  5]   9.00-10.00  sec  1.12 MBytes  9.41 Mbits/sec                  
[  5]  10.00-10.12  sec   136 KBytes  9.38 Mbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.12  sec  11.4 MBytes  9.41 Mbits/sec                  receiver
-----------------------------------------------------------
Server listening on 5201 (test #2)
-----------------------------------------------------------
when from a PC on the same subnet I type

Code: Select all

# iperf3 -c 192.168.174.144 # a PC on the same subnet
Connecting to host 192.168.174.144, port 5201
[  5] local 192.168.174.177 port 57150 connected to 192.168.174.144 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  1.53 MBytes  12.8 Mbits/sec    0   80.6 KBytes       
[  5]   1.00-2.00   sec  1.48 MBytes  12.5 Mbits/sec    0    137 KBytes       
[  5]   2.00-3.00   sec  1.43 MBytes  12.0 Mbits/sec    0    187 KBytes       
[  5]   3.00-4.00   sec   851 KBytes  6.97 Mbits/sec    0    187 KBytes       
[  5]   4.00-5.00   sec  1.25 MBytes  10.5 Mbits/sec    0    187 KBytes       
[  5]   5.00-6.00   sec  1.25 MBytes  10.5 Mbits/sec    0    187 KBytes       
[  5]   6.00-7.00   sec   851 KBytes  6.97 Mbits/sec    0    187 KBytes       
[  5]   7.00-8.00   sec  1.25 MBytes  10.5 Mbits/sec    0    187 KBytes       
[  5]   8.00-9.00   sec  1.25 MBytes  10.5 Mbits/sec    0    187 KBytes       
[  5]   9.00-10.00  sec  1.25 MBytes  10.5 Mbits/sec    0    187 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  12.3 MBytes  10.3 Mbits/sec    0             sender
[  5]   0.00-10.12  sec  11.4 MBytes  9.41 Mbits/sec                  receiver

iperf Done.
This indicates the Pi is running just under 10 Mb/s.

NoriAbe
Posts: 28
Joined: Sat Sep 19, 2020 1:45 am

Re: USB port activities on RasPi 3B and 4B

Sun Mar 26, 2023 6:46 am

Yes, but what are the measurements in your first post? Why are they relevant?
I just wanted to see USB behavior. I was just struggling ...

Sorry for confusing.

NoriAbe
Posts: 28
Joined: Sat Sep 19, 2020 1:45 am

Re: USB port activities on RasPi 3B and 4B

Sun Mar 26, 2023 7:09 am

# ethtool -s eth0 speed 10
I tried, but it did not make any changes.

I also tried "iperf3" command to analyze it.
pi@raspberrypi:~ $ iperf3 -s
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
Accepted connection from 192.168.2.180, port 53448
[ 5] local 192.168.2.190 port 5201 connected to 192.168.2.180 port 53450
[ ID] Interval Transfer Bitrate
[ 5] 0.00-1.00 sec 11.2 MBytes 93.9 Mbits/sec
[ 5] 1.00-2.00 sec 11.2 MBytes 94.1 Mbits/sec
[ 5] 2.00-3.00 sec 11.2 MBytes 93.7 Mbits/sec
[ 5] 3.00-4.00 sec 11.2 MBytes 94.1 Mbits/sec
[ 5] 4.00-5.00 sec 11.2 MBytes 94.1 Mbits/sec
[ 5] 5.00-6.00 sec 11.2 MBytes 94.1 Mbits/sec
[ 5] 6.00-7.00 sec 11.2 MBytes 94.1 Mbits/sec
[ 5] 7.00-8.00 sec 11.2 MBytes 94.1 Mbits/sec
[ 5] 8.00-9.00 sec 11.2 MBytes 94.1 Mbits/sec
[ 5] 9.00-10.00 sec 11.2 MBytes 94.1 Mbits/sec
[ 5] 10.00-10.01 sec 86.3 KBytes 91.2 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate
[ 5] 0.00-10.01 sec 112 MBytes 94.1 Mbits/sec receiver
Still 100Mbps?

And one more question.

After sending above command, I got a response.
pi@raspberrypi:~ $ sudo ethtool -s eth0 speed 10
Cannot advertise speed 10
What does this mean?
My command request was not proccessed correctly?

But this shows 10Mbps, I think? (Speed: 10Mb/s)

Code: Select all

Ciperf3: interrupt - the server has terminated
pi@raspberrypi:~ $ ethtool eth0
Settings for eth0:
	Supported ports: [ TP MII ]
	Supported link modes:   10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	Supported pause frame use: Symmetric Receive-only
	Supports auto-negotiation: Yes
	Supported FEC modes: Not reported
	Advertised link modes:  10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	Advertised pause frame use: No
	Advertised auto-negotiation: Yes
	Advertised FEC modes: Not reported
	Link partner advertised link modes:  10baseT/Half 10baseT/Full 
	                                     100baseT/Half 100baseT/Full 
	Link partner advertised pause frame use: Symmetric
	Link partner advertised auto-negotiation: Yes
	Link partner advertised FEC modes: Not reported
	Speed: 10Mb/s
	Duplex: Full
	Port: MII
	PHYAD: 1
	Transceiver: internal
	Auto-negotiation: on
Cannot get wake-on-lan settings: Operation not permitted
	Current message level: 0x00000007 (7)
			       drv probe link
	Link detected: yes

NoriAbe
Posts: 28
Joined: Sat Sep 19, 2020 1:45 am

Re: UB port activities on RasPi 3B and 4B

Sun Mar 26, 2023 9:01 am

Code: Select all

[pi@raspberrypi:~ $ sudo ethtool -s eth0 speed 10
Cannot advertise speed 10
I could make it. Following a wesite, I tried thecommands shown below.

Code: Select all

# ethtool -s eth0 autoneg on
# ethtool -s eth0 autoneg off
Now it's OK. I can not see "Cannot advertise speed 10".

But still problem happens.

By the way, curent Duplex, Auto-negotiation, wake-on-lan
settings OK?

It seems Auto-negotiation must be off. Once it is changed
to on, speed changes to 100Mbps.

The latest response is :

Code: Select all

pi@raspberrypi:~ $ ethtool eth0
Settings for eth0:
	Supported ports: [ TP MII ]
	Supported link modes:   10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	Supported pause frame use: Symmetric Receive-only
	Supports auto-negotiation: Yes
	Supported FEC modes: Not reported
	Advertised link modes:  10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	Advertised pause frame use: No
	Advertised auto-negotiation: No
	Advertised FEC modes: Not reported
	Speed: 10Mb/s
	Duplex: Full
	Port: MII
	PHYAD: 1
	Transceiver: internal
	Auto-negotiation: off
Cannot get wake-on-lan settings: Operation not permitted
	Current message level: 0x00000007 (7)
			       drv probe link
	Link detected: yes

ejolson
Posts: 10965
Joined: Tue Mar 18, 2014 11:47 am

Re: UB port activities on RasPi 3B and 4B

Sun Mar 26, 2023 3:01 pm

NoriAbe wrote:
Sun Mar 26, 2023 9:01 am

Code: Select all

[pi@raspberrypi:~ $ sudo ethtool -s eth0 speed 10
Cannot advertise speed 10
I could make it. Following a wesite, I tried thecommands shown below.

Code: Select all

# ethtool -s eth0 autoneg on
# ethtool -s eth0 autoneg off
Now it's OK. I can not see "Cannot advertise speed 10".

But still problem happens.

By the way, curent Duplex, Auto-negotiation, wake-on-lan
settings OK?

It seems Auto-negotiation must be off. Once it is changed
to on, speed changes to 100Mbps.

The latest response is :

Code: Select all

pi@raspberrypi:~ $ ethtool eth0
Settings for eth0:
	Supported ports: [ TP MII ]
	Supported link modes:   10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	Supported pause frame use: Symmetric Receive-only
	Supports auto-negotiation: Yes
	Supported FEC modes: Not reported
	Advertised link modes:  10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	Advertised pause frame use: No
	Advertised auto-negotiation: No
	Advertised FEC modes: Not reported
	Speed: 10Mb/s
	Duplex: Full
	Port: MII
	PHYAD: 1
	Transceiver: internal
	Auto-negotiation: off
Cannot get wake-on-lan settings: Operation not permitted
	Current message level: 0x00000007 (7)
			       drv probe link
	Link detected: yes
That's a good catch.

When I said renegotiate in my previous post, I meant for the switch to pick up the fact that the Pi was set to 10Mb/s.

Does the slower Ethernet speed help with the USB problem?

NoriAbe
Posts: 28
Joined: Sat Sep 19, 2020 1:45 am

Re: UB port activities on RasPi 3B and 4B

Sun Mar 26, 2023 10:37 pm

Does the slower Ethernet speed help with the USB problem?
Unfortunately, No.
I'll try again today.

I have a concern.
Even if I succeeded setting, getting above "10Mb/s" result, it went back to
100Mb/s once it's restarted. Does it mean "NOT SET COMPLETELY"?


By the way, I found some settings for "cmdline.txt".
Do these help to solve the problem?

- dwc_otg.lpm_enable
- smsc95xx.turbo_mode

https://www.raspberrypi.com/documentati ... spi-config

ejolson
Posts: 10965
Joined: Tue Mar 18, 2014 11:47 am

Re: UB port activities on RasPi 3B and 4B

Sun Mar 26, 2023 11:03 pm

NoriAbe wrote:
Sun Mar 26, 2023 10:37 pm
Does the slower Ethernet speed help with the USB problem?
Unfortunately, No.
I'll try again today.

I have a concern.
Even if I succeeded setting, getting above "10Mb/s" result, it went back to
100Mb/s once it's restarted. Does it mean "NOT SET COMPLETELY"?


By the way, I found some settings for "cmdline.txt".
Do these help to solve the problem?

- dwc_otg.lpm_enable
- smsc95xx.turbo_mode

https://www.raspberrypi.com/documentati ... spi-config
It's not expected those ethtool settings would be persistent across reboots. For that one would generally add the needed ethtool commands to one of the system startup scripts. In my opinion, there is no point worrying about persistence unless 10 Mb/s actually helps resolve the USB problem.

Return to “Troubleshooting”