Page 1 of 1

RPi2 usb serial console has corrupted text

Posted: Fri Apr 17, 2015 7:31 am
by MarkHaysHarris777
Greetings, I have a Belkin four port powered usb hub plugged into my RPi2 ; plugged into the Belkin hub F4U038 are two (2) Intel Edison SoC units. I am accessing the Intel Edison(s) using minicom from the RPi2 on either ttyUSB0 and ttyUSB1. This mostly works. The problem is that often these two serial connections (115200 baud) will have garbled corrupted text. For instance, holding down the 'l' key might get this: lllllllllllllltlllllllllllIUULlllllllllll3lllllllllllllllllllll2illllllllllllll

Sometimes the two serial connections work fine (rarely) and usually there is more of an issue if both SoC(s) are plugged in to the hub at the same time.

The same setup (powered hubs and SoC units) running to my notebook works flawlessly. Also, plugged into the mac works fine too. So, there is something wrong with the usb on the RPi2. I realize that the usb on the PI is 'different' / any ideas what I might try to smooth this out a bit.

I can login to the SoC(s) via wifi and that works great... and the main reason I am using the powered hub is to get mains power to the SoC units without taxing the RPi2 power supply. But sometimes it becomes necessary to get to the SoC with the serial console from the RPi2 and that's where I'm stuck.



Re: RPi2 usb serial console has corrupted text

Posted: Fri Apr 17, 2015 8:10 am
by scotty101
That seems to indicate that the baud rate is incorrectly set.

Re: RPi2 usb serial console has corrupted text

Posted: Sat Apr 18, 2015 5:32 am
by MarkHaysHarris777
hi Scotty, ...well, I wish that it were that simple. The baud rate is in fact set correctly (on both ends) and as I said previously, it mostly works. There is something *very* wrong with the way usb is setup on the RPi2; its just not up-to-par with usb expectations from a normal PC perspective. Also, as I noted previously, if I plug the Edison into the RPi2 usb port directly, it works flawlessly (same setup, same baud rate 115200). The problem there is that the Edison pulls too much current for the RPi2 to sustain the load for long without over heating or shutting down; not good. The Edisons need to draw power from the mains via a powered usb hub.
Also, I have been testing the Belkin four port hub all day from my mac mini (also my T61 notebook) and the setup as described works flawlessly with both of those machines as host (again, same setup same baud rate).
I will report back with testing tomorrow; I have discovered 'screen' today/ so bye-bye minicom! I will test the whole setup tomorrow with 'screen' and see if there is any difference; I'll let you know.
Thanks for your response.

Re: RPi2 usb serial console has corrupted text

Posted: Sat Apr 18, 2015 8:56 am
by MarkHaysHarris777
This is my lsusb -t listing:

/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
|__ Port 1: Dev 2, If 0, Class=hub, Driver=hub/5p, 480M
|__ Port 1: Dev 3, If 0, Class=vend., Driver=smsc95xx, 480M
|__ Port 2: Dev 62, If 0, Class=vend., Driver=rt2800usb, 480M
|__ Port 4: Dev 57, If 0, Class=hub, Driver=hub/4p, 480M
|__ Port 1: Dev 58, If 0, Class=vend., Driver=ftdi_sio, 12M
|__ Port 3: Dev 59, If 0, Class=vend., Driver=ftdi_sio, 12M
|__ Port 5: Dev 61, If 0, Class=HID, Driver=usbhid, 12M
|__ Port 5: Dev 61, If 1, Class=HID, Driver=usbhid, 12M
|__ Port 5: Dev 61, If 2, Class=HID, Driver=usbhid, 12M

Well, I'm dumping minicom. 'screen' is much improved for both devices Port1 dev 58 and Port 3 dev 59 (both Edison SoC(s) hung off the Belkin four port hub. I am still getting keyboard errors (wrong keys) but very few of them... in fact, its usable at this point; but it still bugs me because there are occasional missed or wrong keys.

Its only the keys. Data coming back from the Edison (for instance a file of 'l's ) displays fine; no missed data. Its only characters typed in at the keyboard. I have tried both my usb wireless keyboard | mouse combo, as well a 'real' usb wired keyboard... same issue. Tomorrow I'll try ssh into the PI and 'screen' from there to eliminate the usb board piece of this problem.

The baud rate looks good... and data coming back from the edison is not garbled... only my keystrokes; and only very few of them; but ONLY on the PI.


Re: RPi2 usb serial console has corrupted text

Posted: Sat Apr 18, 2015 10:18 am
by MarkHaysHarris777
Greetings, ok... I noticed that my RPi2 had not been booted in over two weeks, so whatever... I rebooted and retried; problem is virtually nonexistent now. In a string of 'l' characters one out of 300 will miss, and I'm not getting any 'incorrect' characters. So, something flaky got corrupted over time, which was corrected by a reboot.

oh well, log it and move on... life with the iddybitty computers.


Re: RPi2 usb serial console has corrupted text

Posted: Sat Apr 18, 2015 8:44 pm
by MarkHaysHarris777
I am learning that the usb controller of the RPi2 is not as robust as the usb setup on my PC nor MAC.

For one thing, the bus is really not hot-pluggable. I use a Logitech keyboard|mouse combo and I often hot-plug the little usb 'receiver' between machines. Well, the RPi usb controller (and drivers) gets confused if the receiver is hot-plugged. I might get away with hot-plugging an adapter 'once' but then leave it alone!

Regular rebooting of the RPi also seems warranted, especially if it is heavily used in a networked environment.

it seems to me that the RPi Foundation might focus on the next generation of RPi units in the area of usb, considering that the usb controller is the RPi's primary world interface; it really needs to be more robust.

Re: RPi2 usb serial console has corrupted text

Posted: Tue Apr 21, 2015 2:59 pm
by MarkHaysHarris777
I have confirmed that the OTG usb port of the RPi(2B) and the RPi(B+) have the same interoperability issue with a usb 2.0 four port hub and two(2) downstream usb serial terminals (in my case Intel Edison SoC). If both terminals are open at the same time (one each to an Edison SoC) in 'screen' occasionally characters get missed or misinterpreted from the keyboard (garbled) particularly repeating characters in either terminal (its almost like the usb port is getting confused between the two; however, if one of the terminal sessions is closed (exited) and that 'screen' is destroyed so that only one of the terminal(s) remains open to just one SoC, then the keyboard misbehavior ceases and all is good (and this regardless of which terminal is closed or left open.
I reproduced this failure on each piece of hardware with a fresh install of Wheezy Raspian. The difficulty worsens as the machine continues to run particularly if the wipi module is plugged in. Minicom in this setup is completely useless. The situation improves with 'screen' and also improves if the ethernet port is used rather than wipi. The ssh sessions to either SoC function normally in any case. The serial terminal session to either SoC is useful completely as far as it goes if the SoC(s) are accessed one-at-a-time with only one terminal screen session open (one to either SoC) at a time.
The limitations of the built-in OTG usb hub are a royal fit; the achilles heel IMHO of the Raspberry PI. It would be better to have less physical ports on the RPi2 and have a robust port (or hub) that would fully support a usb 2.0 or 3.0 powered external hub... since that is almost always needed one way or the other anyway. The limitations of the OTG usb built-in make the unit difficult to leverage in the best case.