Arduino Yun as multiplexer

Hi! I have connected 8 usb flash drives via multiplexer to the Arduino Yun host usb socket. The switching of the mux is done by atmega while data browsing is done by OpenWRT. This part is working fine. Now I was wondering if it would be possible to transfer this data from the usb flash drives to the pc via usb cable. I know I can do it via wi-fi or ethernet cable, but in this particular case this is not an option. I know that the usb cable that you can program Yun is connected to the atmega but would it be possible using bridge to push data from those flash drives through Yun to the pc using usb cable? I hope I clarified this enough.

Thank you in advance for the input and have a great day!

@domagalski,
I've read your post, but I have to wonder why not push the data directly from the Linux through the USB cable to the computer. Would that work?

Jesse

Dear Jesse,

I am not sure if I understood your comment correctly but the thing is that for this project I have data on 8 different usb flash drives and altogether this might end up being many many GB to transfer. I have figured out how to send it through wifi but it takes a lot of time, occasionally this is ok, but I would also like to have an option to do it quicker ( I assume) through usb cable. So far I have not found and option for Arduino Yun on how to send data form a device connected to usb host through a cable directly to the PC. I hope this clarifies my problem a bit.

Thanks for interest !

domagalski:
but I would also like to have an option to do it quicker ( I assume) through usb cable.

My gut feeling is that this is a faulty assumption. I don't see this as being a speedy proposition.

You first need to get the data to the sketch, through the serial port that runs between the two processors, then you need to shuffle that data in the sketch, using the slow 16 MHz processor. Then you have to send the data over the USB cable, which is another slow serial link. On top of all of that, you need to write the protocols to transfer that data reliably over those serial links, including writing a program on the PC to receive that data.

Looking at the first step in that link, the serial port between the two processors runs at 250,000 bits per second, if I recall correctly. If you could use 100% of that bandwidth (not really possible) that would be 0.25 Mbps throughout. The additional stages I mention will only slow things down further.

Given that typical real-world WiFi throughput speeds range from 2 to 50 Mbps, the maximum possible speed of 0.25 Mbps seems rather paltry and hardly worth the significant implementation effort.

If you're close enough for a USB cable, you're close enough for a wired Ethernet connection. That will likely give you the best speed, and with no additional programming effort.

Dear ShapeShifter,

this is a hell of good input ! Thank you very much and also, unfortunately it is partially confirming my initial thoughts. I have thought about ethernet in the begging but there were 2 points against it:

  1. bulkier/bigger plug space needed
  2. not everybody has an ethernet port in their laptops these days so additional adapter might be needed

But it seems that atm this is my only option for a wired solution.

I had also one more consideration that I had problem to find answer to:

So far I have been sending data through the wifi in such a way that Yun is connected to local network and computer (MacBook) is connected to the same. Than I am using (from the mac terminal) command:

sudo scp root@az.local:/mnt/sda1/DCIM/100HDDVR/REC_0002.MP4  /Users/domagalski/Desktop

You mention "Given that typical real-world WiFi throughput speeds range from 2 to 50 Mbps" and it got me confused weather the data is traveling through internet or directly from one wireless card to another. And if former, would it be possibly to connect them directly and increase speed like that?

No, your data should not be going out over the Internet and back, it should be staying on your local network.

I don't know enough about the low-level transport of a WiFi network, so I can't say if the data is going directly from one WiFi node to another, or if it is going from one WifI node to the router, and then from the router to the other WiFi node. But either way, it should not be going out to the Internet and back. (You can confirm this by unplugging or turning off your actual Internet connection, leaving the local network intact, and attempting a copy operation.)

ShapeShifter:
No, your data should not be going out over the Internet and back, it should be staying on your local network.

I don't know enough about the low-level transport of a WiFi network, so I can't say if the data is going directly from one WiFi node to another, or if it is going from one WifI node to the router, and then from the router to the other WiFi node. But either way, it should not be going out to the Internet and back. (You can confirm this by unplugging or turning off your actual Internet connection, leaving the local network intact, and attempting a copy operation.)

@domagalski,
I will confirm what ShapeShifter said - the data should not go over the Internet. If it did, that would be a faulty or poorly configured gateway. Given the interface most end-users have, it is nearly impossible to improperly configure a gateway or router.

The route on most wireless systems is from client to router to the other client. The data in almost all situations goes through the routers. Direct wifi connections is available, but you need special software or special configurations for this.

On your previous idea of sending the data through the USB cable, as ShapeShifter explained it is not a great idea. However sending the data via other USB port (the one connected to the linux) system has some advantages - BUT speed is not one of them.

Best of Luck
Jesse

Thank you guys for input, have to digest it now. But it seems that most feasible would be for me to try connect Yun and PC directly through their wireless cards omitting the router.

domagalski:
Thank you guys for input, have to digest it now. But it seems that most feasible would be for me to try connect Yun and PC directly through their wireless cards omitting the router.

The easiest way to do that is to set up the Yun as an access point (like it is when first taken out of the box) and connect the PC to it. But I'll be surprised if it gives you a significant speed increase.

Keep in mind that the Yun is not a high speed multi-gigahertz computer - if you are trying to move a lot of data around, it will take time. That's just the way it is. Even if you attach a bank of USB drives to it, do not think that you will end up with a high performance NAS system.

I haven't yet check it out but I will and share if the speed increase will be significant.

Yes, you are right, that make sense :smiley: Thank you a lot for all the help and clarifications!