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 Storage Slow? #239

Open
DonC52 opened this issue Sep 6, 2019 · 672 comments
Open

USB Storage Slow? #239

DonC52 opened this issue Sep 6, 2019 · 672 comments

Comments

@DonC52
Copy link

DonC52 commented Sep 6, 2019

I have been wondering why the following occurs on my Windows 10 laptop and the Pi USB.
I am using a 128G SanDisk Extreme Plus UHS so I would think it rather fast.

I put in an old "slow" USB stick into my Laptop port and copy a Sentry Mode directory, I get about 20MB/Sec transfer rate.

I put the Pi USB in with power applied from external source and copy the same directory, I get like 1.5MB/s to 2.5MB/s transfer rate.

Looking at top, there is a LOT of wait time going on. Is there anything that can be done to speed things up?

top

@marcone
Copy link
Owner

marcone commented Sep 6, 2019

The time you circled in that screenshot is I/O wait time, i.e. time spent waiting for data to be read from the sd card, and time spent transferring data over USB, both of which probably happen via DMA, thus the CPU will be mostly idle during those times.

As to why you get such low transfer rates, no idea. How are you measuring that?
I'm getting around 20 MB/sec on both read and write with 'dd' when attached to a Mac or linux machine.

@marcone
Copy link
Owner

marcone commented Sep 6, 2019

Does dmesg on the Pi show "dwc2 20980000.usb: new device is high-speed" or something else?

@DonC52
Copy link
Author

DonC52 commented Sep 6, 2019

I got the following from dmesg | grep "dwc2 20980000.usb" while connected to the car. It looks like the last timestamps show it as high-speed.
'''
root@teslausb: dmesg | grep "dwc2 20980000.usb"
[ 3.136821] dwc2 20980000.usb: 20980000.usb supply vusb_d not found, using dummy regulator
[ 3.137004] dwc2 20980000.usb: Linked as a consumer to regulator.0
[ 3.137033] dwc2 20980000.usb: 20980000.usb supply vusb_a not found, using dummy regulator
[ 3.353750] dwc2 20980000.usb: dwc2_check_params: Invalid parameter lpm=1
[ 3.353775] dwc2 20980000.usb: dwc2_check_params: Invalid parameter lpm_clock_gating=1
[ 3.353789] dwc2 20980000.usb: dwc2_check_params: Invalid parameter besl=1
[ 3.353800] dwc2 20980000.usb: dwc2_check_params: Invalid parameter hird_threshold_en=1
[ 3.353866] dwc2 20980000.usb: EPs: 8, dedicated fifos, 4080 entries in SPRAM
[ 3.355146] dwc2 20980000.usb: DWC OTG Controller
[ 3.355220] dwc2 20980000.usb: new USB bus registered, assigned bus number 1
[ 3.355301] dwc2 20980000.usb: irq 33, io mem 0x20980000
[ 93.619677] dwc2 20980000.usb: bound driver g_mass_storage
[ 93.641717] dwc2 20980000.usb: new device is high-speed
[ 94.006578] dwc2 20980000.usb: new device is high-speed
[ 94.248037] dwc2 20980000.usb: new address 13
[ 756.636039] dwc2 20980000.usb: bound driver g_mass_storage
[ 756.762610] dwc2 20980000.usb: new device is high-speed
[ 756.836337] dwc2 20980000.usb: new device is high-speed
[ 756.897926] dwc2 20980000.usb: new address 14
root@teslausb:~#
'''

I test out new things by copying a test event to the Pi USB TeslaCam/SavedClips so it can transfer something without driving the car. I only has like 15 files in it and takes like 6 minutes to copy the file. I use the display that Windows shows when copying a file (details) and it is usually close to whats going on as far as speed. (Thus the 20MB/S to a regular "old" stick

Tomorrow evening I can take out the Pi from the car and plug it into my Laptop. Then take a look at what dmesg has to say.

Sound like a plan?

@DonC52
Copy link
Author

DonC52 commented Sep 7, 2019

Well another day - I first plugged the Pi into power from the wall and let it boot all the way up. I then connected it to he USB port on the computer. Doing a copy of the test file again is like 1.5MB/s rather than the 20 expected. Still a lot of wait going on.

Looking at the windows device manager, I noticed that the Pi is seen as a Linux File-Stor Gadget USB Device. I am wondering if there is an issue with that driver in Windows? When I READ from the Pi TeslaCam/SavedClips I get a flat 20MB/s. When WRITING to the Pi folder, I get between 1.5 - .5MB/s.

Anyone else plug the Pi into a Windows 10 machine and try to write to the TeslaCam folder?
Here is the dmesg output:
'''
pi@teslausb:~ $ dmesg | grep "dwc2 20980000.usb"
[ 3.281850] dwc2 20980000.usb: 20980000.usb supply vusb_d not found, using dummy regulator
[ 3.282043] dwc2 20980000.usb: Linked as a consumer to regulator.0
[ 3.282074] dwc2 20980000.usb: 20980000.usb supply vusb_a not found, using dummy regulator
[ 3.503745] dwc2 20980000.usb: dwc2_check_params: Invalid parameter lpm=1
[ 3.503770] dwc2 20980000.usb: dwc2_check_params: Invalid parameter lpm_clock_gating=1
[ 3.503783] dwc2 20980000.usb: dwc2_check_params: Invalid parameter besl=1
[ 3.503795] dwc2 20980000.usb: dwc2_check_params: Invalid parameter hird_threshold_en=1
[ 3.503863] dwc2 20980000.usb: EPs: 8, dedicated fifos, 4080 entries in SPRAM
[ 3.505247] dwc2 20980000.usb: DWC OTG Controller
[ 3.505316] dwc2 20980000.usb: new USB bus registered, assigned bus number 1
[ 3.505401] dwc2 20980000.usb: irq 33, io mem 0x20980000
[ 92.034137] dwc2 20980000.usb: bound driver g_mass_storage
[ 344.999742] dwc2 20980000.usb: new device is high-speed
[ 345.052498] dwc2 20980000.usb: new address 2
pi@teslausb:~ $
'''

@DonC52
Copy link
Author

DonC52 commented Sep 7, 2019

Okay - after I sent the last Commment, things changed. Now when WRITING to the Pi I get 120MB/s for a few seconds and then 19.5-20.8MB/s. I have no idea what changed to get the write times better. READING back gives me 20.0-27.7MB/s.

I don't know if I taught the Windows driver something or just what is going on. Much better though.

Still - has any Windows 10 people out there playing around and noticed the same thing?

@DonC52
Copy link
Author

DonC52 commented Sep 7, 2019

Think I have a handle on the speed issue but I need sleep. Will follow-up tomorrow after work.

@curiousgrge
Copy link

curiousgrge commented Sep 9, 2019

Okay - after I sent the last Commment, things changed. Now when WRITING to the Pi I get 120MB/s for a few seconds and then 19.5-20.8MB/s. I have no idea what changed to get the write times better. READING back gives me 20.0-27.7MB/s.

I don't know if I taught the Windows driver something or just what is going on. Much better though.

Still - has any Windows 10 people out there playing around and noticed the same thing?

I'm having the exact same problems as you. 1.5-2.5MB/sec. If you have a handle on what you've changed for direct copying, I'm interested in how this is resolved. Took me 2.5+hrs to copy my MUSIC partition back. Even to get 20MB/sec would be dramatic improvement in copy time. For the data connection, I'm connected via USB 3.0. Possibly my issue is my USB cable now that I think about it since it is a thin flat cable that came with my Smart Watch.

@marcone
Copy link
Owner

marcone commented Sep 10, 2019

You could try adding nofua=1,1 to /etc/modprobe.d/g_mass_storage.conf and see if that helps.
(see https://www.kernel.org/doc/Documentation/usb/mass-storage.txt for details)

@curiousgrge
Copy link

Just tried the adding nofua=1,1 to the tail end of the conf file and now it is 4-5MB/sec but well shy of 20MB/sec.

@DonC52
Copy link
Author

DonC52 commented Sep 10, 2019

I "Think" I found the solution. Windows 10 tends to want writes to complete before issuing more writes. (NO write caching!) To speed this up, I went into Device Manager, selected Disk Drives and you will see the Linux File-Stor Gadget USB Device. (two of them) Select the policies tab and select Better performance. The write-caching check box will be selected but DO NOT turn on the flushing check-box. (Very bad idea) Do this for BOTH of the devices.

Doing this simple change enabled me to copy 200 music files (about 797MB) in about 30 seconds or so. From the 4-5MB/s it went to about 150MB/s with a short time delay at the end for the system to flush the cache.

Hopefully it will help you as well.

@curiousgrge
Copy link

curiousgrge commented Sep 16, 2019

Redoing my TeslaUSB again due to it now not giving me notifications. Tested @DocC52 suggestion and it is at least 3x faster than what it was doing again. After the initial caching, it does slow down quite a bit. Takes about 30 minutes now to copy everything for me rather than 2.5hrs so I guess it improves it 5x.

I didn't test this with the nofua=1,1 so don't know if that makes a difference too.

image

Also keep in mind if you do this that user will need to eject the drive rather than just being able to pull out. Not sure why the image was unlucky and says 3MB/sec when it was mostly hovering around 15MB/sec or higher.

@ZeFrenchBibster
Copy link

Hi,

Not sure if this is related, but I have the same sort of micro SD (128GB Sandisk 'claims' 100 MB/sec) in my pi (Zero-W) behind a 'Zendure 5' powerbanck/HUB.

Once the car wakes up, it works, but after a while, she claims that the USB storage is too slow. I'll fetch it from the car tonight, and try the 'nofua=1,1' thing, as well as any messages for /var/log/messages.

@githubsean
Copy link

githubsean commented Sep 29, 2019

Sorry, no solutions, just adding a data point.

I'm also having troubles with this, and I wonder if it is some bottleneck somewhere in the raspberry pi.
I tested a card on both windows and linux computers - i.e. I plugged the raspberry pi acting as a USB drive into both computers and ran some write speed tests. They both came out to about 2MB/sec.
I then took the card out of the pi and tried writing directly to it - about 18MB/sec.
I haven't done any more investigation to see if it is:

  • on the pi, the raw write speed on the pi to the USB (i.e. slow USB interface)
  • on the pi, the write speed to the file system file used as the USB storage (some issue with the file system driver)
    I have tried the nofua=1,1 thing and I didn't see any significant difference in write speed.

I may try the new "Buster" version to see if things improve.

@mcowger
Copy link

mcowger commented Sep 30, 2019

I've enabled nofua on my 0W - will see how it goes today.

@mcowger
Copy link

mcowger commented Sep 30, 2019

I did some quick tests just now. This is a High Endurance SanDisk U3, Class10, V30 card I'd tested well over 25MB/sec writes (its rated for 40). nofua didn't seem to help much.

  • Using the Pi0W attached to my Mac as a USB drive, I started a streaming write with 4KB blocks to the drive.
  • Initially it was around 20MB/sec, but very quickly (after about 60s) dropped off to less than 1MB/sec, which makes sense that the car would be unhappy with.
  • Then I tried it directly on the Pi, mounting the card through to g_mass_storage driver as /mnt/cam. Speeds were inconsistent, but often dipping below 2MB/sec, and then back up to 6.

My views:

  1. Given the initial performance of 20MB/sec, I dont think its the RPi USB interface.
  2. Given the initial performance and then drop, this feels like overrunning a cache somewhere, and then dropping straight to disk-performance.
  3. Given the poor performance when loopback mounted with g_mass_storage, my gut suggests this is a performance problem in the kernel driver or just the RPi0W in general.

Next steps - I'm considering grabbing one of my faster ODroidC2's to see if its a CPU performance issue.

@mcowger
Copy link

mcowger commented Sep 30, 2019

Update - couldn't quite get my RPi3b+ to work.

@marcone
Copy link
Owner

marcone commented Sep 30, 2019

Update - couldn't quite get my RPi3b+ to work.

Only the Pi0 and Pi4 support USB gadget mode.

@mcowger
Copy link

mcowger commented Sep 30, 2019 via email

@gacevedo
Copy link

gacevedo commented Oct 1, 2019

I'll try the nofua=1,1 setting next. Here's the output from dmesg:

root@teslausb:~# dmesg | grep 'dwc2 20980000.usb'
[ 2.974130] dwc2 20980000.usb: 20980000.usb supply vusb_d not found, using dummy regulator
[ 2.974288] dwc2 20980000.usb: Linked as a consumer to regulator.0
[ 2.974317] dwc2 20980000.usb: 20980000.usb supply vusb_a not found, using dummy regulator
[ 3.194131] dwc2 20980000.usb: dwc2_check_params: Invalid parameter lpm=1
[ 3.194158] dwc2 20980000.usb: dwc2_check_params: Invalid parameter lpm_clock_gating=1
[ 3.194171] dwc2 20980000.usb: dwc2_check_params: Invalid parameter besl=1
[ 3.194183] dwc2 20980000.usb: dwc2_check_params: Invalid parameter hird_threshold_en=1
[ 3.194250] dwc2 20980000.usb: EPs: 8, dedicated fifos, 4080 entries in SPRAM
[ 3.195656] dwc2 20980000.usb: DWC OTG Controller
[ 3.195726] dwc2 20980000.usb: new USB bus registered, assigned bus number 1
[ 3.195811] dwc2 20980000.usb: irq 33, io mem 0x20980000
[ 1845.177686] dwc2 20980000.usb: bound driver g_mass_storage
[ 1845.434266] dwc2 20980000.usb: new device is high-speed
[ 1845.490515] dwc2 20980000.usb: new device is high-speed
[ 1845.545863] dwc2 20980000.usb: new device is high-speed
[ 1845.601519] dwc2 20980000.usb: new device is high-speed
[ 1845.656760] dwc2 20980000.usb: new device is high-speed
[ 1845.712490] dwc2 20980000.usb: new device is high-speed
[ 1845.768239] dwc2 20980000.usb: new device is high-speed
[ 1845.823636] dwc2 20980000.usb: new device is high-speed
[ 1845.878855] dwc2 20980000.usb: new device is high-speed
[ 1845.970411] dwc2 20980000.usb: new address 10

@itsrainingben
Copy link

itsrainingben commented Oct 1, 2019

Apologies no solutions on my side either, just throwing my hat into this issue. Was not something I ran into prior to V10 & updating the pi following instructions here.

I mounted the rPi (stem enclosure if that matters) to a macOS host and tested read/write with Aja System Test Lite and saw between 17-19MB/s write. The software would error out after writing about 1GB. New to dmesg, so I tailed it and this is what I was able to pull -

disk3s1: I/O error.
disk3s1: I/O error.
**** [IOBluetoothDevice][decrementNumberOfOutstandingPacketsBy] -- Handle 0x000c -- remove ACL Timer 0xffffff8069112d20 for ACL packet 0xffffff806d2bb40 0 -- numOutstandingHWPackets = 1, mNumNotDequeuedAckedPackets = 0, mDestroyDeviceCalled = FALSE -- hostController = 0x1080 ****

**** [IOBluetoothDevice][decrementNumberOfOutstandingPacketsBy] -- Handle 0x000c -- remove ACL Timer 0xffffff8069113e60 for ACL packet 0xffffff806d1c6c0 0 -- numOutstandingHWPackets = 1, mNumNotDequeuedAckedPackets = 0, mDestroyDeviceCalled = FALSE -- hostController = 0x1080 ****
disk3s1: I/O error.
disk3s1: I/O error.
disk3s1: I/O error.
**** [IOBluetoothDevice][decrementNumberOfOutstandingPacketsBy] -- Handle 0x000c -- remove ACL Timer 0xffffff8057255900 for ACL packet 0xffffff806d15520 0 -- numOutstandingHWPackets = 1, mNumNotDequeuedAckedPackets = 0, mDestroyDeviceCalled = FALSE -- hostController = 0x1080 ****

If there are any recommended commands for dmesg feel free to throw them here and I'm happy to run. Otherwise I'll be following closely and thank you @marcone for all your work on this project.

@mcowger
Copy link

mcowger commented Oct 2, 2019

@marcone @gacevedo - Got my RPi4 today and installed the latest buster based release on it.

Native card write performance: 58MB/sec
Thru RPI as USB (like the car would): 20.1MB/sec

This is vastly faster. Also, I watched the power consumption using an inline meter - even with default settings, the RPi4 maxed at a momentary 4.2W draw during install, and after settling down during normal running conditions draws about 2.9W....well within the power delivery available on at least the Model 3.

I've got it running in the car right now and will report back.

@DMBlakeley
Copy link

Curious what RAM size of RPi4 people are using?

@mcowger
Copy link

mcowger commented Oct 2, 2019

Mine is 1GB (which is 2x that of the RPi0W), the smallest. memory usage on the device shows 65MB.

@DMBlakeley
Copy link

Thanks! Didn’t want to go overboard.

@itsrainingben
Copy link

itsrainingben commented Oct 2, 2019 via email

@mcowger
Copy link

mcowger commented Oct 2, 2019 via email

@itsrainingben
Copy link

itsrainingben commented Oct 2, 2019 via email

@mcowger
Copy link

mcowger commented Oct 2, 2019 via email

@itsrainingben
Copy link

itsrainingben commented Oct 2, 2019

Just got home, able to add my dmesg for @marcone 's request -

root@teslapi:/home/pi# dmesg | grep "dwc2 20980000.usb"
[ 3.426141] dwc2 20980000.usb: 20980000.usb supply vusb_d not found, using dummy regulator
[ 3.426308] dwc2 20980000.usb: Linked as a consumer to regulator.0
[ 3.426337] dwc2 20980000.usb: 20980000.usb supply vusb_a not found, using dummy regulator
[ 3.643940] dwc2 20980000.usb: dwc2_check_params: Invalid parameter lpm=1
[ 3.643965] dwc2 20980000.usb: dwc2_check_params: Invalid parameter lpm_clock_gating=1
[ 3.643980] dwc2 20980000.usb: dwc2_check_params: Invalid parameter besl=1
[ 3.643993] dwc2 20980000.usb: dwc2_check_params: Invalid parameter hird_threshold_en=1
[ 3.644061] dwc2 20980000.usb: EPs: 8, dedicated fifos, 4080 entries in SPRAM
[ 3.645655] dwc2 20980000.usb: DWC OTG Controller
[ 3.645765] dwc2 20980000.usb: new USB bus registered, assigned bus number 1
[ 3.645850] dwc2 20980000.usb: irq 33, io mem 0x20980000
[ 74.977688] dwc2 20980000.usb: bound driver g_mass_storage
[ 75.001183] dwc2 20980000.usb: new device is high-speed
[ 75.365197] dwc2 20980000.usb: new device is high-speed
[ 75.617993] dwc2 20980000.usb: new device is high-speed
[ 75.682544] dwc2 20980000.usb: new address 10
[ 1057.171063] dwc2 20980000.usb: bound driver g_mass_storage
[ 1057.314384] dwc2 20980000.usb: new device is high-speed
[ 1057.376563] dwc2 20980000.usb: new device is high-speed
[ 1057.439266] dwc2 20980000.usb: new address 8

@marcone
Copy link
Owner

marcone commented Jan 9, 2023

The Raspberry Pi 4 has an onboard antenna. The Rock Pi 4C+ does not and requires an external antenna.
u.FL is the connector type. Any u.FL wifi antenna should do, but I suggest getting one tuned for both 2.4 and 5.8 GHz, e.g. something like this.
Mine came with one marked "PKE1831-D49 FPCB-X1" which seems to be the antenna that Radxa includes with one of their wireless modules. (Note that I'm not using that module, my 4C+ just came with one of those antennas in the package)

@miles267
Copy link

miles267 commented Jan 9, 2023

Thanks. Have ordered an external antenna. Hate the idea of yet another wire, let alone a fragile one, hanging off of the Rock Pi but am going to give it a try. Eager to see whether it will perform better, making the Rock Pi a viable upgrade to the Raspberry Pi 4. If anyone finds a good cable solution to power the Rock Pi 4C+ and pass data over USB3 from the car’s USB3 on glove box, please share.

@JakeShirley
Copy link

let alone a fragile one, hanging off of the Rock Pi but am going to give it a try.

Hot glue. Hot glue everywhere!

On a serious note, please keep us updated on how it works. I shelved this a few years ago because I need dashcam footage to be much more reliable than it was previously with my Pi Zero.

@miles267
Copy link

miles267 commented Jan 9, 2023

@JakeShirley i switched from the RPi Zero W to a Raspberry Pi 4 about a year ago for the significantly faster 5.8 ghz Wi-Fi camera video syncs and found it to be better in every way. Since it’s emulating USB2, I’m intrigued by this Rock Pi 4C+ and experimenting whether I can get both the same (or better) 5.8 ghz upload speeds with faster write speeds (and the car not complaining about the glovebox USB needing to be remove and plugged in again could get faster speeds). Since a USB3 thumb drive eliminates these errors altogether.

@marcone
Copy link
Owner

marcone commented Jan 10, 2023

If anyone finds a good cable solution to power the Rock Pi 4C+ and pass data over USB3 from the car’s USB3 on glove box, please share.

I have no personal experience with them (since I don't have glovebox USB), but there are several USB hubs made specifically to fit the Tesla glovebox USB port. These generally have 1 USB3 port (for dashcam) and multiple USB2 ports (for power or other devices), and seem like a good choice for connecting a Rock Pi 4C+.

@ken830
Copy link

ken830 commented Jan 10, 2023

If anyone finds a good cable solution to power the Rock Pi 4C+ and pass data over USB3 from the car’s USB3 on glove box, please share.

I have no personal experience with them (since I don't have glovebox USB), but there are several USB hubs made specifically to fit the Tesla glovebox USB port. These generally have 1 USB3 port (for dashcam) and multiple USB2 ports (for power or other devices), and seem like a good choice for connecting a Rock Pi 4C+.

My 4C+ should be here in a couple of days. I just ordered one of those USB Hubs made for the glovebox of the Model Y from Amazon. Not sure how/if it will work. First off, physically, I'm not sure how it will fit the Model X glove box USB port, since the dimensions are different -- might need a short USB extension if it doesn't fit flush. And secondly, Radxa specs for the 4C+ say USB-C 5V/3A. Wondering if it will just consume whatever it needs from the USB port's 5V rail and not need to negotiate from USB PD or something. It seems the glove box port is a USB-A 3.0 port, so not sure how it can deliver 3A since USB 3.x spec is max 900mA.

@marcone
Copy link
Owner

marcone commented Jan 10, 2023

It doesn't need 3A unless you load up all the Rock Pi's USB ports with USB peripherals. I'm seeing it peak briefly at 1.2A during boot, with an NVME drive connected. It idles around 0.75A.
The glovebox USB port will provide 2A (per this comment).

@JakeShirley
Copy link

Just coming back to this because I love the idea of this product!

What's the latest recommended hardware config to get a consistent experience with this?

@KrzysztofHajdamowicz
Copy link

If anyone finds a good cable solution to power the Rock Pi 4C+ and pass data over USB3 from the car’s USB3 on glove box, please share.
My 4C+ should be here in a couple of days. I just ordered one of those USB Hubs made for the glovebox of the Model Y from Amazon. Not sure how/if it will work.

How is Your experience with Rock Pi 4C+ as TeslaUSB drive?
How did you wired it up?

@ken830
Copy link

ken830 commented Aug 30, 2023

The USB hub for the Model Y https://www.amazon.com/gp/product/B0BJZKB58Z/?th=1 isn't made for the X, but I was able to get it to plug in after some coaxing. Unfortunately, it stopped working a couple of weeks ago -- After some investigation, it looks like the PTC fuse on the board is tripping repeatedly.

I replaced the hub with one of these splitters: https://www.amazon.com/dp/B096DW6CDJ. A USB3 port actually has two separate sets of pins: a high-speed USB3 portion and the original USB2 portion. This cable splits it off, and I use the USB2 portion purely for power. It's the easiest way I've found to "tap" 5V power from the port without building something custom.

The Rock Pi 4C+ has been working okay. No more alerts complaining about slow media, but for some weird reason, I still get skipping when playing back music from the drive. You would think an MP3 file is so small, the car can cache it in less than a second, so it is odd that it still skips.

Another issue is the car quite often doesn't recognize the drive at all. In that case, I need to scroll-wheel reset the car and it will come back. I believe resetting the Rock Pi or un-plugging/re-plugging it doesn't work. Not sure what that's about.

@miles267
Copy link

@ken830 thanks for referencing that USB3 splitter. Can you please also link to any other male cables you're using, coming off of that splitter, for power and data? Thanks.

@stacecom
Copy link

@ken830 What OS image did you use for yours? I've been struggling to get mine going. I get close, but then the teslausb setup script starts just boot looping. I forget the finer details since it's been a few months since I tried, and my Pi4 has stopped throwing the slow storage error for some time.

@ken830
Copy link

ken830 commented Aug 30, 2023

@ken830 thanks for referencing that USB3 splitter. Can you please also link to any other male cables you're using, coming off of that splitter, for power and data? Thanks.

Basically, any USB3.x A-to-A cable is needed. I used this one: https://www.amazon.com/gp/product/B077GS3SKR?th=1

For power, any USBA-to-C cable would do. I used this one because it's short and has a low-profile right-angle at the C end: https://www.amazon.com/dp/B092KF36T6?psc=1&ref=ppx_yo2ov_dt_b_product_details

So, my RockPi 4C+ doesn't have an M.2 NVMe connector. They seem to have revised the 4C+ several times and removed that capability and I have one of the newer ones without it. I just noticed there's now a RockPi 4 SE that has the M.2 slot. I want to pick one up to test it, but I'm not sure I can power it in the glove-box. The product spec page says all the RockPi 4 boards (except for the 4C Plus) require USB-PD/QC with one of these profiles: 9V/2A, 12V/2A:

4C+: https://wiki.radxa.com/Rock4/4cplus
4SE: https://wiki.radxa.com/Rock4/4se

https://wiki.radxa.com/Rock4/getting_started:

QC/PD capable ROCK 4, ROCK 4A, 4B, 4C, 4A Plus, 4B Plus, 4 SE

  • The QC/PD capable ROCK (Pi) 4 is powered by USB Type C port and supports a wide range of input voltage, from 6V to 12V. The power adapter can be USB Type-C PD 2.0 with 9V/2A, 12V/2A protocol compatible, or Quick Charge 2.0 9V/2A, 12V/2A compatible. A dummy 9V or 12V power adapter with USB C tail will also work. Warning: 9V/12V USB C dummy power adapter is dangerous to other 5V only devices, don't mix them.
  • If the power adapter is PD/QC compatible, the USB power cable must support USB data communication(USB 2.0 or 3.0) between the board and the power adapter, or the power adapter will not output desired voltage wanted by the board.
  • Note: We don't suggest using a 5V only USB C power adapter on QC/PD capable ROCK (Pi) 4. The board may boot but it will cause stability issue once the system load rises.

5V only ROCK (Pi) 4C Plus

  • For ROCK 4C Plus, it supports USB Type C 5V input only, a 5V/3A power adapter is recommend for normal usage. A 5V/5A power adapter is recommend for a full heavy usage such as connecting power hungry USB device(USB HDDs for example) on all USB ports.
  • Use QC/PD power adapter on ROCK (Pi) 4C Plus is also fine since there is no voltage negotiation and the power adapter will output 5V by default. No worries to damage the 4C Plus.

I'm hopeful because the note says that the board can boot with 5V. 9V, 2A is 18W. I will load-test the glovebox USB port to see if I can pull ~3.0-3.6A (well past the 900mA spec requirement) without too much voltage sag. It might be okay. As marcone already linked to a user that tested it to 2.0A, we might be okay. We're not running anything intensive on the board, so we should be well below maximum power draw. On my 4C+, I see spikes just over 2A.

@ken830 What OS image did you use for yours? I've been struggling to get mine going. I get close, but then the teslausb setup script starts just boot looping. I forget the finer details since it's been a few months since I tried, and my Pi4 has stopped throwing the slow storage error for some time.

I really can't remember. It's been many months for me too. I think I grabbed whatever was latest Armbian in January. I think I commented somewhere, but I can't figure out github's search to find my own comment history.

@mickgiles
Copy link

I am currently running https://github.com/radxa-build/rock-4c-plus/releases/download/20230312-1521/Armbian_23.05.0-trunk_Rockpi-4cplus_jammy_current_5.15.101_minimal.img.xz
and it seems to be pretty stable so far. My cable situation is sub-optimal so I have ordered what @ken830 posted above.

I also was also able to get the thermal reporting working with the below saved as a file named thermals.dts and the command armbian-add-overlay thermals.dts if that helps anyone

/dts-v1/;
/plugin/;

/ {
        compatible = "radxa,rockpi4c-plus", "radxa,rockpi4", "rockchip,rk3399";

        fragment@0 {
                target=<&tsadc>;
                __overlay__ {
                        status = "okay";
                        /* tshut mode 0:CRU 1:GPIO */
                        rockchip,hw-tshut-mode = <1>;
                        /* tshut polarity 0:LOW 1:HIGH */
                        rockchip,hw-tshut-polarity = <1>;
                };
        };

};

@ken830
Copy link

ken830 commented Aug 31, 2023

I also was also able to get the thermal reporting working with the below saved as a file named thermals.dts and the command armbian-add-overlay thermals.dts if that helps anyone

@mickgiles : I wasn't aware of thermal reporting. How do you use this? Any reference material you can point me to so that I can read up on this? Thanks.

@mickgiles
Copy link

under the tools menu of teslausb it shows the core temperature of the CPU which doesn't work out of the box with the rock pi images. This solution fixes that so that page reports the cpu temp correctly.
I found the solution here https://forum.radxa.com/t/rockpi-4-cpu-temperature/9530/7

@miles267
Copy link

miles267 commented Aug 31, 2023

Does it matter which USB3 port you connect to for data on the Rock Pi 4C+? For example the top one or the bottom one, closer to the board?

EDIT: seems the USB3 cable must be connected to the TOP USB3 port (away from the board) or it doesn't get detected by Teslausb.

@miles267
Copy link

under the tools menu of teslausb it shows the core temperature of the CPU which doesn't work out of the box with the rock pi images. This solution fixes that so that page reports the cpu temp correctly. I found the solution here https://forum.radxa.com/t/rockpi-4-cpu-temperature/9530/7

I did try this but didn't seem to work. I create the thermals.dts file and run the command to compile which it then copies to /boot/user-overlays. Upon rebooting, it boots fine but there isn't any new temp info in the Teslausb > tools webui.

@miles267
Copy link

@marcone how do you get Teslausb to sync with the music share? Mine is mounting fine ;Rock Pi 4C+ and also created the music share.Bin, is syncing new video clips without issue but nothing from my music share is copying over to the Pi. I’ve ensured my Teslausb is current with updates. Thanks.

@ken830
Copy link

ken830 commented Aug 31, 2023

Last night, I went to do some load-testing on the 2022 Model X's glove box port and found that the plastic Raspberry Pi4 case was deformed! This is supposedly ABS, which means it had reached the glass transition temperature of >100C! I've been using this all year even through some really hot summer days parked outside with sentry mode running in Southern California during a road trip and it never melted. I just looked at this last week and it seemed fine. Maybe my wife recently put too much stuff in the tiny glove box and it completely blocked all ventilation.

PXL_20230831_101050064

under the tools menu of teslausb it shows the core temperature of the CPU which doesn't work out of the box with the rock pi images. This solution fixes that so that page reports the cpu temp correctly. I found the solution here https://forum.radxa.com/t/rockpi-4-cpu-temperature/9530/7

Results from my load test shows severe IR voltage drop with anything above 2A, but I'm not sure how much of this is the Y-cable I'm measuring through. I cannot easily measure directly at the port., but I have a few ideas to try to see if I can get closer to the port and characterize the Y-Cable separately to get a better idea.
PXL_20230831_095643808
PXL_20230831_095655874 MP
PXL_20230831_095747327
PXL_20230831_095954374

This is what my "Tools" page looks like:
Screenshot_20230831-024348

Does it matter which USB3 port you connect to for data on the Rock Pi 4C+? For example the top one or the bottom one, closer to the board?

EDIT: seems the USB3 cable must be connected to the TOP USB3 port (away from the board) or it doesn't get detected by Teslausb.

Yes, only the top port is the OTG port. From Radxa's documentation:

USB 3.0 OTG X1, upper one, software configurable to be host or OTG,

@marcone how do you get Teslausb to sync with the music share? Mine is mounting fine ;Rock Pi 4C+ and also created the music share.Bin, is syncing new video clips without issue but nothing from my music share is copying over to the Pi. I’ve ensured my Teslausb is current with updates. Thanks.

Mine just syncs each time it powers up or after it re-connects to the home WiFi network (e.g. arriving home from a drive). What do you see in the logs?

@marcone
Copy link
Owner

marcone commented Aug 31, 2023

This is supposedly ABS, which means it had reached the glass transition temperature of >100C!

Hard to believe that the plastic case got hot enough to boil water. Maybe it's not actually ABS?
Also the area that looks most deformed doesn't seem to be near anything that gets very hot (at least on my Rock Pi 4c+ V1.2). Was there something else near the case that could have gotten hot?

@marcone
Copy link
Owner

marcone commented Aug 31, 2023

@marcone how do you get Teslausb to sync with the music share? Mine is mounting fine ;Rock Pi 4C+ and also created the music share.Bin, is syncing new video clips without issue but nothing from my music share is copying over to the Pi. I’ve ensured my Teslausb is current with updates. Thanks.

Check the log. That should show whether it even tried syncing music, and whether that succeeded or not.

@ken830
Copy link

ken830 commented Aug 31, 2023

This is supposedly ABS, which means it had reached the glass transition temperature of >100C!

Hard to believe that the plastic case got hot enough to boil water. Maybe it's not actually ABS? Also the area that looks most deformed doesn't seem to be near anything that gets very hot (at least on my Rock Pi 4c+ V1.2). Was there something else near the case that could have gotten hot?

Nothing else in the glove box except the Tesla owner's manual, insurance & registration papers, and some packs of disposable masks my wife stuffed in there. The center of the "melty" area is directly underneath the RK3399 SoC. I'm guessing it was sitting on top of the masks/papers, which trapped the heat in. The board still operates normally, so it definitely did not reach the melting point of the solder.

But I think you're right that the plastic may have a lower than typical glass transition temperature. The RK3399 has a max Tj of 125C, so if that was typical ABS at 100C, I would be close to 125C in the die. Not likely, since It probably would've been in thermal shutdown well before that.

This was the case, and the Amazon page lists material as "Acrylonitrile Butadiene Styrene (ABS)"
https://www.amazon.com/gp/product/B07D3S4KBK?th=1

@miles267
Copy link

miles267 commented Sep 3, 2023

Am up and running now with the Rock Pi 4C Plus though I’ve noticed that Wi-Fi upload speeds are awful (1.5 Mbps consistently) in garage from same, exact location the Raspberry Pi 4 is 70 Mbps+. Same Wi-Fi channel (VHT40, channel 149) and everything. Am using the antenna on the Rock Pi 4. Are there any additional software config updates that need to be made to improve this speed?

@KrzysztofHajdamowicz
Copy link

Am up and running now with the Rock Pi 4C Plus though I’ve noticed that Wi-Fi upload speeds are awful (1.5 Mbps consistently) in garage from same, exact location the Raspberry Pi 4 is 70 Mbps+. Same Wi-Fi channel (VHT40, channel 149) and everything. Am using the antenna on the Rock Pi 4. Are there any additional software config updates that need to be made to improve this speed?

Maybe Wi-Fi chip is having problems, low TX power or low antenna sensivity?
Do you have spare M2 slot for external Wi-Fi card?

By the way, has anybody have an idea about RockPi 5 compatibility?
I am looking for informations for about an hour and I am not sure if it will work.
So far, looks like Rock Pi 5 model B has USB-C power in and DP in alt-mode and two USB-A 3.0 (5gbps) ports: https://github.com/ThomasKaiser/Knowledge/blob/master/articles/Quick_Preview_of_ROCK_5B.md

@marcone
Copy link
Owner

marcone commented Sep 8, 2023

By the way, has anybody have an idea about RockPi 5 compatibility?

As far as I can tell the Rock Pi 5 doesn't have built-in wifi, so you would need to use an add-on board for that. It's also somewhat unclear if it can be reliably powered from a regular USB port.

@KrzysztofHajdamowicz
Copy link

I just got Rock Pi 4C Plus V1.41.
Installed Armbian 23.8.1 minimal IMAGE
Replaced Wi-Fi Antenna with better one (LINK), I'm getting same link speeds like RPi 4B in glovebox (42mbps).

Unfortunately, none of USB3 port works, only USB2 ports detect connected Semsung T7 USB SSD and USB-NVME enclosure.
I will try image from this comment and report progress.

By the way, thanks for thermal DTC, it works!

@jakubsuchybio
Copy link

Raspberry pi 5 comming with nvme support weeee
https://www.raspberrypi.com/products/raspberry-pi-5/
image

@aendel
Copy link

aendel commented Jan 24, 2024

Anyone has tried the Raspberry Pi5? I'm going to buy the hardware soon, I thought about buying it but then I read this thread , now I'm looking for advice about it :D

@Arthur-Philip-Dent
Copy link

First sight comparing the 5 on Bookworm with a Pi CM4 on 4B-adapter from last weekend:

  • similar WiFi transfer rates (will test more detailed)
  • 5 with KIOXIA Excerica G2 on NVMe Base by Pimoroni: 49130 Score @Pibenchmarks vs. 1397 with a CM4 / 20x faster read
  • Power Pi5 in idle: 0.45A / 2.3W (vs. CM4 on Pi4 IO-Board 0.7A / 3.65W, similar to a Pi4B )
  • Pi5 has RTC an buffer-battery connetor on board
  • Pi5 has PWM controlled
  • original kit fan "sings like an insect"
  • no suitable case yet with (Pimoroni) NVMe Base (will try out "HatDrive!" by Pineberry Pi; looks promising to fit in standard case
  • a bit costly (+ NVMe base =15,80€ + 38€ SSD)

Check for your towel!

The Hitchhiker

Pi5 with NVMe Base and Kioxia SSD pibenchmark Kioxia Exceria Gen2x3 on Pic5B using Pimoroni NVMe Base Samsung Pro Plus SD-card on CM4 4GB on CM4-to-Pi4B-Adapter

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

No branches or pull requests