Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USB 2.1 when plugging in slowly. #2311

Closed
kevindehecker opened this issue Aug 26, 2018 · 22 comments
Closed

USB 2.1 when plugging in slowly. #2311

kevindehecker opened this issue Aug 26, 2018 · 22 comments
Assignees

Comments

@kevindehecker
Copy link
Contributor


Required Info
Camera Model D400
Firmware Version 05.09.14.00
Operating System & Version Win 10
Platform PC
SDK Version 2.15.0.163
Language N.A.
Segment Robot

Issue Description

When I plug in the realsense USB-C side too slow, the realsense enumerates as a usb 2 device. If I replug the other side, it enumerates as 3.2... See a video here: https://youtu.be/4IFmsG6Wk_U

I have reproduced this issue with:
-3 Realsenses new out of the box
-5 different types of cables (longer, shorter, usb 3, usb 3.1), among which the original black cable that came with the Realsense

Some cables required a gentler touch than others, but with the cable in the video it is almost always happening like that.

Mysteriously, I cannot reproduce the issue when using a USB C to USB-C cable... (my laptop also has usb-c directly)? The Realsense is then detected as a 3.0 device by the way, which may be notable to debug this problem.

On a side note, we are putting Realsenses on drones, but we've been having many connection issues. We have now switched cables and boards to the point things seem relatively stable, but still we seem to lose connection to the camera every now and then. Sometimes that even seems to take down all other USB devices with it. Of course, these problems are very hard to reproduce as they tend to happen after take off, so I'm jumping at any connection issue which I can reproduce :)

@dorodnic
Copy link
Contributor

Slow-insertion is currently a known issue, we are looking for firmware work-arounds, but as you mentioned using Type-C to Type-C cable also solves this issue.

Regarding the second part of your question, it is probably not related to cable insertion speed, but rather to the general setup. What platform and usb controller do you use in the robot? I'm not an electrical engineer, but perhaps there are some power jumps during take-off? Is it possible to put the camera on a dedicated power-source?

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Aug 26, 2018

There was a case involving RealSense in robotics where the USB cable reportedly jostled out of the camera's USB port a bit and caused disconnection.

I have a similar issue with the joypad controllers on my USB hub, where the cable can wiggle back out of the port a little during play as the pad is moved around and cause the pad to disconnect (stopping control inputs). My wired mouse also does disconnects and connects in the same hub when moving the mouse around

Either side of the camera's USB port are two small holes. These can be used with a USB cable with locking screws on to firmly fix the cable into the port.

The subject was discussed on the Intel support forum in the link below. The cable supplier Newnex, which can provide equipment for extending the 400 Series' cable length up to 100 m over fiber cable, offers a locking cable and gives a link for the cable at the end of the discussion.

https://communities.intel.com/message/532162#532162

@kevindehecker
Copy link
Contributor Author

A good to hear, I was hoping for a firmware fix for the slow insertion issue. Any kind of time frame? As it happens, I can only reach the usb-c side on the drone and when aforementioned other connection issues appear I go from bad to worse.

FYI we are now using the UP Core board (switched from an Odroid, which we really couldn't get stable with the Realsense; the complete usb system would crash too often in erratic ways). On the particular drone I'm working on right now, the [DelftaCopter](https://www.youtube.com/watch?v=wj0gV08Hdr8 , here still with previous vision system), the power system for the vision is system is completely separate and has quite large margins, so it is unlikely that it causes issues (if you want to know, we are powering from a dedicated 10A 5V BEC, which gets power from a 6S lipo. Voltage drop (e.g. during take off )on the 6S will never come close for the BEC to come into problems, at least not before very vital other systems fail :) )

Like I said, the problems we now still have are not reproducible easily, if they will be and if they point to the RealSense I will probably be posting issues soon thereafter. For instance, it seems, that one day a particular USB cable works perfectly, but the next day we have nothing but trouble with it. But then the cable still works fine on my laptop+realsense...
We are considering soldering the usb c side directly on the Realsense board and see where that leads us, even though hot gluing the whole thing did not seem to sort much effect. (I'll search if they have these screw type connectors on 20cm cables as well, could be interesting to try out!)

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Aug 26, 2018

Are you using the camera in a full-size USB 3.0 port on your Up Core board? If your Up Core model has a USB 3.0 OTG port (a micro USB port that needs a special adapter or cable to connect a USB 3.0 device to it) and you have the camera plugged into one of thise then these may encounter power problems with RealSense 400 Series cameras. Intel support agent Juan mentions it:

https://communities.intel.com/message/548593#548593

@kevindehecker
Copy link
Contributor Author

It's a full size USB 3 type A connector, the Core doesn't have an OTG port broken out as far as I know.

@MartyG-RealSense
Copy link
Collaborator

Thanks! The Up Core Plus model has an additional USB 3.0 OTG port, so I just wanted to make sure whether you had an ordinary Core or a Core Plus.

@kevindehecker
Copy link
Contributor Author

Well, I just managed to repeatedly reproduce one of these weird usb problems...! Not 100% sure the Realsense is to blame completely, but it's in the mix I'd say.

On the drone (which was static on the table at all times during these tests) with the Up Core I'm interacting with the autopilot hardware through a standard ftdi uart usb cable. However, for the purpose of this test I'm not using it at all, it is just connected. My software starts the realsense api, but does not activate any of the streams. So, basically, it's just spinning. After a few seconds (up to a few minutes), funky stuff starts to happen: the ftdi device loses connection. Relevant dmesg og:

[  154.718014] usb 1-4: USB disconnect, device number 3
[  154.719002] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
[  154.719101] ftdi_sio 1-4:1.0: device disconnected
[  155.275482] usb 1-4: new full-speed USB device number 5 using xhci_hcd
[  155.421141] usb 1-4: New USB device found, idVendor=0403, idProduct=6001
[  155.421152] usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  155.421159] usb 1-4: Product: TTL232R-3V3
[  155.421164] usb 1-4: Manufacturer: FTDI
[  155.421168] usb 1-4: SerialNumber: FTHHVZII
[  155.424123] ftdi_sio 1-4:1.0: FTDI USB Serial Device converter detected
[  155.424266] usb 1-4: Detected FT232RL
[  155.424756] usb 1-4: FTDI USB Serial Device converter now attached to ttyUSB0
[  155.744504] usb 1-4: USB disconnect, device number 5
[  155.745190] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
[  155.745238] ftdi_sio 1-4:1.0: device disconnected
[  156.115801] usb 1-4: new full-speed USB device number 6 using xhci_hcd
[  161.669254] usb 1-4: new full-speed USB device number 7 using xhci_hcd
[  161.815087] usb 1-4: New USB device found, idVendor=0403, idProduct=6001
[  161.815101] usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  161.815109] usb 1-4: Product: TTL232R-3V3
[  161.815117] usb 1-4: Manufacturer: FTDI
[  161.815180] usb 1-4: SerialNumber: FTHHVZII
[  161.818495] ftdi_sio 1-4:1.0: FTDI USB Serial Device converter detected
[  161.818704] usb 1-4: Detected FT232RL
[  161.819051] usb 1-4: FTDI USB Serial Device converter now attached to ttyUSB0
[  162.349265] usb 1-4: USB disconnect, device number 7
[  162.349911] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
[  162.349965] ftdi_sio 1-4:1.0: device disconnected
[  162.649596] usb 1-4: new full-speed USB device number 8 using xhci_hcd
[  162.794968] usb 1-4: New USB device found, idVendor=0403, idProduct=6001
[  162.794974] usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  162.794977] usb 1-4: Product: TTL232R-3V3
[  162.794979] usb 1-4: Manufacturer: FTDI
[  162.794981] usb 1-4: SerialNumber: FTHHVZII
[  162.797296] ftdi_sio 1-4:1.0: FTDI USB Serial Device converter detected
[  162.797364] usb 1-4: Detected FT232RL
[  162.799649] usb 1-4: FTDI USB Serial Device converter now attached to ttyUSB0
[  162.880709] usb 1-4: USB disconnect, device number 8
[  162.881134] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
[  162.881177] ftdi_sio 1-4:1.0: device disconnected
[  163.181657] usb 1-4: new full-speed USB device number 9 using xhci_hcd
[  163.301745] usb 1-4: Device not responding to setup address.
[  163.509825] usb 1-4: Device not responding to setup address.
[  163.717782] usb 1-4: device not accepting address 9, error -71
[  164.041879] usb 1-4: new full-speed USB device number 11 using xhci_hcd
[  164.182397] usb 1-4: device descriptor read/all, error -71
[  164.305926] usb 1-4: new full-speed USB device number 12 using xhci_hcd
[  170.015019] usb 1-4: new full-speed USB device number 13 using xhci_hcd
[  170.155504] usb 1-4: device descriptor read/all, error -71
[  170.275074] usb 1-4: new full-speed USB device number 14 using xhci_hcd
[  170.420527] usb 1-4: New USB device found, idVendor=0403, idProduct=6001
[  170.420543] usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  170.420553] usb 1-4: Product: TTL232R-3V3
[  170.420563] usb 1-4: Manufacturer: FTDI
[  170.420571] usb 1-4: SerialNumber: FTHHVZII
[  170.424218] ftdi_sio 1-4:1.0: FTDI USB Serial Device converter detected
[  170.424433] usb 1-4: Detected FT232RL
[  170.426076] usb 1-4: FTDI USB Serial Device converter now attached to ttyUSB0
[  171.242044] usb 1-4: USB disconnect, device number 14
[  171.242846] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
[  171.242936] ftdi_sio 1-4:1.0: device disconnected
[  171.543308] usb 1-4: new full-speed USB device number 15 using xhci_hcd
[  171.688700] usb 1-4: New USB device found, idVendor=0403, idProduct=6001
[  171.688716] usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  171.688725] usb 1-4: Product: TTL232R-3V3
[  171.688735] usb 1-4: Manufacturer: FTDI
[  171.688743] usb 1-4: SerialNumber: FTHHVZII
[  171.691825] ftdi_sio 1-4:1.0: FTDI USB Serial Device converter detected
[  171.692056] usb 1-4: Detected FT232RL
[  171.692543] usb 1-4: FTDI USB Serial Device converter now attached to ttyUSB0
[  171.700055] usb 1-4: USB disconnect, device number 15
[  171.700562] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
[  171.700595] ftdi_sio 1-4:1.0: device disconnected
[  171.999373] usb 1-4: new full-speed USB device number 16 using xhci_hcd
[  172.119554] usb 1-4: Device not responding to setup address.
[  172.327464] usb 1-4: Device not responding to setup address.
[  172.535447] usb 1-4: device not accepting address 16, error -71
[  172.859503] usb 1-4: new full-speed USB device number 18 using xhci_hcd
[  172.979610] usb 1-4: Device not responding to setup address.
[  173.187597] usb 1-4: Device not responding to setup address.
[  173.395589] usb 1-4: device not accepting address 18, error -71
[  173.719639] usb 1-4: new full-speed USB device number 20 using xhci_hcd
[  173.839752] usb 1-4: Device not responding to setup address.
[  174.047774] usb 1-4: Device not responding to setup address.
[  174.255716] usb 1-4: device not accepting address 20, error -71
[  174.579772] usb 1-4: new full-speed USB device number 22 using xhci_hcd
[  174.699885] usb 1-4: Device not responding to setup address.
[  174.907865] usb 1-4: Device not responding to setup address.
[  175.115845] usb 1-4: device not accepting address 22, error -71
[  175.439896] usb 1-4: new full-speed USB device number 24 using xhci_hcd
[  175.560001] usb 1-4: Device not responding to setup address.
[  175.767999] usb 1-4: Device not responding to setup address.
[  175.975986] usb 1-4: device not accepting address 24, error -71
[  176.300019] usb 1-4: new full-speed USB device number 26 using xhci_hcd
[  176.420115] usb 1-4: Device not responding to setup address.
[  176.628124] usb 1-4: Device not responding to setup address.
[  176.836083] usb 1-4: device not accepting address 26, error -71
[  177.340154] usb 1-4: new full-speed USB device number 28 using xhci_hcd

This basically continues until I stop my software. I have been having similar issues with other USB devices like a usb wifi stick , so I don't think it is the ftdi cable (which we use very regularly anyway, without such problems)

I would greatly appriciated any insights you might have on this!

@kevindehecker
Copy link
Contributor Author

With spinning I basically mean:

rs2::config cfg;
cfg.disable_all_streams();
rs2::pipeline cam;
selection = cam.start(cfg);

//in another thread:
while(1)
    frame = cam.wait_for_frames();

@kevindehecker
Copy link
Contributor Author

A complete dmesg log before starting my software, the dmesg log after start, and the realsense log with export LRS_LOG_LEVEL="DEBUG"
RS_ftdi_loss.zip

@MartyG-RealSense
Copy link
Collaborator

Programming is not my best area of expertise. When you say 'while(i) in your script, I believe that is equal to saying 'while(i != 0) ... i.e the instruction frame = cam.wait_for_frames(); should keep running until i = 0, at which the while loop would terminate because the its while(i) condition was no longer true.

So I would guess that unless there is a way for the while loop to return to 0 (like how 'i = 0 to 60 terminates the loop after 60 cycles) then the frame = cam.wait_for_frames(); instruction would continue to run indefinitely?

'While' loops are tricky things in RealSense coding. If there is a mistake in them (e.g an instruction that should be inside the loop is placed outside of it) then processing resources can get eaten up over time, leading to instability and then program termination.

@kevindehecker
Copy link
Contributor Author

After dozens of tests all eventually resulting in loss of ftdi usb I made an important step.

Things I tried that don't work:
-New out of the box power source (a seperate adapter power brick)
-Ventilator, cool everything down

No, as it turns out, I had to change the USB C cable to the realsense! I have now gone back and forth beween the two usb cables that cause / solve this issue, and it seems quite reproducible.
image
Left works fine, right not so much.

So, I'm observing that using certain usb-c cables to the RealSense result in a crash on other totally unrelated usb (2) devices... erratically after a few seconds/minutes. I'll spare you the memes to express my amazement. Any comment on what I have to look for in cables that won't have this problem?

@kevindehecker
Copy link
Contributor Author

kevindehecker commented Aug 26, 2018

When you say 'while(i)

It says while (1), (in other words: while(true) ), anyway what I meant in any case that I'm just reading the images in an endless loop and not doing anything with them.

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Aug 26, 2018

Yes, it is known that some USB-C cables will work better than others, because there can be quality issues in USB-C cables. This is why using the USB cable supplied with the camera tends to work best, as it has been carefully rated by Intel for use with the 400 Series camera.

Newnex cables are proven for use with the 400 Series, as shown in the YouTube video below, where Newnex demonstrate the camera being used successfully with their equipment up to 100 m.

https://www.youtube.com/watch?v=GLQgR1jT04M&t=43s

@kevindehecker
Copy link
Contributor Author

OK nice. THe thing is that I need short cables, preferably as lightweight as possible. It seems those Newnex cables won't go shorter than 1m, while I need 20cm.... 1 meter is definetely too long.

@MartyG-RealSense
Copy link
Collaborator

A search term you could google for is 'usb-c industrial grade 20cm'. For example, one source that this search term leads to is this 20 cm cable:

https://www.amazon.co.uk/Syncwire-UNBREAKcable-Android-Motorola-Smartphones/dp/B073WSQMHB/ref=sr_1_2?tag=pcagenius-21&s=wireless&ascsubtag=06-3623166-11-0000000&th=1

@kevindehecker
Copy link
Contributor Author

@MartyG-RealSense that's not even an usb 3 cable... !
The cables I got now btw are not cheap knockoff ones from banggood or whatever. They are from Farnell and other respectable sources, but OK. But I understand from this there is no info on what to look for in a good realsense compatible cable and I'll just have to try.

I do request that the Realsense team should maybe investigate this problem a bit deeper. I think it is very weird that the Realsense can cause another USB device to disconnect just by using an apparently coincidentally different cable. I imagine many Realsenses will be connected with short cables when the prototypes go into production right? If anything can be done e.g. in the firmware to make the Realsense more robust it would definitely help me to keep choosing Realsense in future projects

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Aug 26, 2018

My apologies for the example chosen.

The 400 Series data sheet says about the USB cable that "The max cable length should not exceed 15 inch with target loss of 7.5dB@2.5GHz"

@kevindehecker
Copy link
Contributor Author

Well, I doubt that's going to be a problem on 20 cm cables :)

@kevindehecker
Copy link
Contributor Author

I made another discovery: we've been using a 4g USB modem stick to enable in-flight internet access, which I initially ruled out due to the combination of other problems (like the original USB 2 slow connect issue) .
I can now 100% reproduce the disconnect issues by holding the 4g stick closely to the Realsense USB cable. I can even reproduce it on my laptop, with the 4g stick airgapped (powered from a USB power pack). In fact, all kinds of funky USB stuff is happening when I hold this stick near the RS cable. (e.g. I can turn on my laptop's webcam, simply by hugging the 4g and RS :) )

This also holds for the original USB cable that came delivered with the RS. But, I don't think this a Realsense problem specifically, might be standard USB 3 related, or simply by the Huawei stick sending too much interference.

In case anyone wonders: can reproduce this with both a Huawei E8372h and an E3372.

@raabuchanan
Copy link

I am experiencing the exact same issue as described above in which slow insertion results in the RealSense camera being detected as USB2.1. I've used multiple cables with firmware 5.11.01 and 5.09.14

@MartyG-RealSense
Copy link
Collaborator

If you are writing your own application then a way to help avoid unplug-replug to reset the camera would be to put a hardware_reset() instruction at the start of the script so that the script resets the camera instead of you having to physically plug the cable.

https://forums.intel.com/s/question/0D70P0000068r7PSAQ

Alternatively, if you are using the RealSense Viewer program then you can reset the camera in the menu opened with the 'More' option at the top of the options side-panel.

image

@ghost
Copy link

ghost commented Mar 8, 2019

I also have the same issue. But it does not happen when I use D435i. Is it fixed in this new device?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants