Hi All,
I am kind of perplexed why I can't find example code for reading/writing data (.csv) to a usb flash drive. There are plenty examples on how to do this with a SD card, but nothing for a simple usb flash drive. I have also found examples on how to make the ESP32 appear as a mass storage device, but not how to access one itself?
read/write to usb flash drive using ESP32-S3 DevkitC
-
hookahhead
- Posts: 2
- Joined: Thu Aug 17, 2023 7:03 pm
-
lbernstone
- Posts: 1131
- Joined: Mon Jul 22, 2019 3:20 pm
Re: read/write to usb flash drive using ESP32-S3 DevkitC
The USB interface is pretty slow (Full Speed), and USB flash is more expensive than a microSD, so I wouldn't recommend it generally.
https://github.com/espressif/esp-idf/tr ... b/host/msc
https://github.com/espressif/esp-idf/tr ... b/host/msc
-
hookahhead
- Posts: 2
- Joined: Thu Aug 17, 2023 7:03 pm
Re: read/write to usb flash drive using ESP32-S3 DevkitC
Unfortunately that isn't Arduino IDE compatible code, which is what I was looking for.
All I would like to do is read/write sensor data to a log file. Adding a SD means buying and mounting the breakout board, tying up more GPIO, and having to find a SD card reader if I ever want to check/change the data.
I do have the device setup to upload this data to an Amazon DB, but hoping to be able to plug in a small usb stick to read/write this data for redundancy. Also we are much more likely to loose Wifi than electric, and logging data during those periods would be preferred.
All I would like to do is read/write sensor data to a log file. Adding a SD means buying and mounting the breakout board, tying up more GPIO, and having to find a SD card reader if I ever want to check/change the data.
I do have the device setup to upload this data to an Amazon DB, but hoping to be able to plug in a small usb stick to read/write this data for redundancy. Also we are much more likely to loose Wifi than electric, and logging data during those periods would be preferred.
Re: read/write to usb flash drive using ESP32-S3 DevkitC
Did you find a way to do this?
I'm trying to find a device or design that I can plug into the USB port on an ESP32 and write everything sent out that USB port to a flash drive or an SD card. Not only may Serial.print(), but also any ESP error log data that is sent out via the USB. I use that instead of connecting to and logging to a PC.
I'm trying to find a device or design that I can plug into the USB port on an ESP32 and write everything sent out that USB port to a flash drive or an SD card. Not only may Serial.print(), but also any ESP error log data that is sent out via the USB. I use that instead of connecting to and logging to a PC.
Re: read/write to usb flash drive using ESP32-S3 DevkitC
Hi,
Although not to ESP32, I connected the CH376 chip to ATmega328, I programmed it and I can write and read from and to the pendrive.
Stefan
Although not to ESP32, I connected the CH376 chip to ATmega328, I programmed it and I can write and read from and to the pendrive.
Stefan
Who is online
Users browsing this forum: Baidu [Spider] and 2 guests