LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 05-10-2018, 11:50 AM   #1
NewburyPi
LQ Newbie
 
Registered: May 2018
Location: Ottawa, Ontario
Distribution: Debian (RPi)
Posts: 7

Rep: Reputation: Disabled
Can't identify Physical USB ports for devices attached before power up.


Does anyone know of a way to get Linux (Debian Stretch) to check if there are any USB devices connected to it? Specifically if the devices have been attached from power up. The devices in question are a pair of Nano compatibles. If I plug them in after the system (RPi) is powered up, all is fine and I can see what ports they are attached to.

However, if they are plugged into the RPi before power up, there is no indication. Perhaps there is a way to get Linux to re-boot (re-power) the USB ports.

Any help would be great.

Dale
 
Old 05-10-2018, 12:23 PM   #2
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Debian
Posts: 6,142

Rep: Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314
This will list the devices
Code:
lsusb
 
Old 05-10-2018, 01:15 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
Can you post the exact model of Nano compatibles you are using and the model of Raspberry Pi?

My first guess would be an power up problem and the power supply can not handle the initial surge current.
 
Old 05-10-2018, 01:37 PM   #4
NewburyPi
LQ Newbie
 
Registered: May 2018
Location: Ottawa, Ontario
Distribution: Debian (RPi)
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by DavidMcCann View Post
This will list the devices
Code:
lsusb
I've tried that and get...

with the RPi powered up with Nanos attached:

Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

with plugging in the Nanos after the RPI has powered up:

Bus 001 Device 012: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
Bus 001 Device 013: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
 
Old 05-10-2018, 01:43 PM   #5
NewburyPi
LQ Newbie
 
Registered: May 2018
Location: Ottawa, Ontario
Distribution: Debian (RPi)
Posts: 7

Original Poster
Rep: Reputation: Disabled
I'm not sure of the Nano manufacturer but they were bought through buyapi.ca and are listed as "ATMEGA328P-20AU Arduino Compatible Nano V3.0 R3 Board" I am using a Raspberry Pi 3 Model B and am powering it with a 3 ampere 5 volt power supply.

I just tried a reboot with just a single Nano attached, and get the same situation. Only after I disconnect and reconnect the Nano is it seen.

pi@raspberrypi:~ $ lsusb
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
pi@raspberrypi:~ $ lsusb
Bus 001 Device 008: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
 
Old 05-10-2018, 03:13 PM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626
I too suspect that the issue is the bus is being read before enough time has passed on power up.
Could indeed be power/current issue.
Could be you need to put in a wait timer to scan usb at some place on boot.
 
Old 05-10-2018, 03:22 PM   #7
NewburyPi
LQ Newbie
 
Registered: May 2018
Location: Ottawa, Ontario
Distribution: Debian (RPi)
Posts: 7

Original Poster
Rep: Reputation: Disabled
Thanks. I'm not sure how to do that, but it seems to be worthwhile checking out. If the RPi tests for them before they are alive, it seems likely they would be overlooked. I'll also try to get power to the Nanos sooner. Right now, power is supplied by the USB bus. If I powered them directly from the power supply (at the same time the RPi is powered up) they may be awake in time.

Thanks again.
 
Old 05-10-2018, 03:29 PM   #8
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Moderator response

Moved: This thread is more suitable in <Linux - Embedded & Single-board computer> and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 05-10-2018, 07:24 PM   #9
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626
https://raspberrypi.stackexchange.co...-delay-at-boot

However one might be able to rescan usb instead of hotplugging them using a counter or cron or script at boot.
 
Old 05-11-2018, 08:01 AM   #10
NewburyPi
LQ Newbie
 
Registered: May 2018
Location: Ottawa, Ontario
Distribution: Debian (RPi)
Posts: 7

Original Poster
Rep: Reputation: Disabled
I had been considering that a power-up race condition was my issue, but even with the two Nano’s powered-up in advance of the RPi boot they are still not identified (lsusb).

However, in looking (read “with open eyes”) at the dmesg output I find that the RPi has been reporting an “error -32” when attempting to connect to them. Would you know where to find these error codes?

[ 1.121548] usb 1-1: new high-speed USB device number 2 using dwc_otg
[ 1.361811] usb 1-1: New USB device found, idVendor=0424, idProduct=9514
[ 1.361826] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 1.681576] usb 1-1.1: new high-speed USB device number 3 using dwc_otg
[ 1.811984] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00
[ 1.812025] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 2.001576] usb 1-1.5: new full-speed USB device number 4 using dwc_otg
[ 2.101542] usb 1-1.5: device descriptor read/64, error -32
[ 2.321548] usb 1-1.5: device descriptor read/64, error -32

[ 2.551627] usb 1-1.5: new full-speed USB device number 5 using dwc_otg
[ 2.651596] usb 1-1.5: device descriptor read/64, error -32
[ 2.871550] usb 1-1.5: device descriptor read/64, error -32

[ 2.991653] usb 1-1-port5: attempt power cycle
[ 3.651630] usb 1-1.5: new full-speed USB device number 6 using dwc_otg
[ 4.097919] usb 1-1.5: device not accepting address 6, error -32
[ 4.191621] usb 1-1.5: new full-speed USB device number 7 using dwc_otg
[ 4.637116] usb 1-1.5: device not accepting address 7, error -32
[ 4.637293] usb 1-1-port5: unable to enumerate USB device
 
Old 05-11-2018, 01:42 PM   #11
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626
I think it comes from usb.c grabbing a standard error but it won't really help you in this.

https://elixir.bootlin.com/linux/v4....usb/core/hub.c (put your version in)

http://www-numi.fnal.gov/offline_sof...em_errors.html

The problem seems to be corrected as you did to insert it later. Many Pi users report same problem. One web page suggested that once the usb port gets to an overcurrent you do need to power back down.

I don't know how your powered test was set up.

It may be possible to re-power or re-scan usb bus after boot.
 
Old 05-11-2018, 03:46 PM   #12
NewburyPi
LQ Newbie
 
Registered: May 2018
Location: Ottawa, Ontario
Distribution: Debian (RPi)
Posts: 7

Original Poster
Rep: Reputation: Disabled
Thanks jefro:

Thanks, I'll dig around a bit more.

The last time I tested. I had a 5V 3A power supply on the RPi and a separate 6V 2A supply on the nano(s), and it still failed (first with 2 Nanos then with a single Nano). Gonna take a look through a Python USB library on the weekend and see if it has anything to help.

Appreciate your time (and the links

Dale
Attached Thumbnails
Click image for larger version

Name:	2018-05-11 16.36.47.jpg
Views:	21
Size:	20.4 KB
ID:	27593  
 
Old 05-11-2018, 04:34 PM   #13
NewburyPi
LQ Newbie
 
Registered: May 2018
Location: Ottawa, Ontario
Distribution: Debian (RPi)
Posts: 7

Original Poster
Rep: Reputation: Disabled
So… I don’t have a root cause, but I might have a culprit. I have repeated my testing on:
• Arduino Uno
• Arduino Micro
• Adafruit Trinket
• Adafruit Pro Trinket
• OSEPP FTDI adapter
And all operated correctly. Which is to say, the RPi found them on boot up. No extra power supplies were necessary. Another POI, an OSEPP Nano also failed to be recognized on boot up. So, it may be a Nano issue. I will acquire an authentic Nano to test and let everyone know.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I identify USB ports? lucmove Linux - Hardware 2 05-05-2015 12:53 AM
How can I identify a physical USB-port? JZL240I-U Linux - Hardware 4 02-28-2014 02:17 AM
How to identify physical location of tape drive attached to Linux box from OS end linux.doubts Linux - Server 2 01-02-2014 11:20 AM
Ways to find attached (USB) devices zhjim Linux - Newbie 8 03-01-2010 07:37 AM
USB 2.0 ports: devices not detected, but works fine with USB 1.1 ports (Kubuntu 6.06) KWTm Linux - Hardware 1 05-09-2007 04:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 12:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration