打印
[USB驱动]

USB穿透 USB cable 和 以太网

[复制链接]
3266|14
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
laowang55555|  楼主 | 2020-8-31 17:43 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
接到需求:
客户使用 windows主机,此windows主机通过USB线连接我们的嵌入式Linux A盒子(也就是开发板,我们的盒子都是ARM架构,海思linux,kernel 3.10)。只能用USB线连接,不能网线连接。这是前提;
我们有2台嵌入式盒子,A和B, A接客户windows主机, B上插U盘。 A和B通过网线连接。也就是说,我们的盒子组成局域网,但客户使用 windows主机不能与我们直接组网,要通过USB连接。
要达成的效果是:客户在windows上能够上传下载U盘中的文件。最好就跟直接插在windows上的一样。
逻辑图是这样的: windows主机,用户操作----USB 线-------嵌入式Linux A ----局域网-----嵌入式Linux B--接U盘。

采用的方案:
1. windows-----linux A  设置linux A为USB slave; 此时需要在linux A 创建镜像文件.img 然后mount到目录/mnt 访问ok   
2.  linux A--------linux B, 在 linux B上架设samba server, 然后在linux A 上通过nfs访问。 在linux A上将远程usb设备mount到目录 /opt 访问ok;  

目前问题是,mount成功的两个不同目录 /mnt   /opt,怎样统一在一起? 也就是说,windows上通过访问
/mnt
的确可以跟 linux A交换文件,上传下载没有问题; 而在 linux A上,通过访问/opt 也能操作U盘中的内容;然而,他们各自在各自mount的目录,两个目录不能共享。
请各位大佬指点。只要能实现需求,不一定要采用这种方案。




使用特权

评论回复
评论
zhengfish 2020-11-25 11:00 回复TA
这需求有点新鲜.... 
大头哥 2020-11-23 21:49 回复TA
加一个rsync服务同步/mnt 和 /opt之间的内容呢? 

相关帖子

沙发
laowang55555|  楼主 | 2020-8-31 17:44 | 只看该作者
请教如何同时穿透USB cable和ethernet 来达到透明访问U盘的目的呢?

使用特权

评论回复
板凳
laowang55555|  楼主 | 2020-8-31 17:48 | 只看该作者
单穿透以太网,这有usb over ip 方案;而且samba也够用;
但是加上USB线之后,问题就变得复杂了。 是否要从我的  linux A 入手,将从一边收到的U盘信息和 另一边收到的host侧指令进行透传? 如果要透传,要怎么做呢?

使用特权

评论回复
地板
laowang55555|  楼主 | 2020-8-31 17:48 | 只看该作者
逻辑图是这样的:

windows主机,用户操作----USB 线-------嵌入式Linux A ----局域网-----嵌入式Linux B--接U盘

使用特权

评论回复
5
七颗咖啡豆| | 2020-9-1 09:56 | 只看该作者
”但客户使用 windows主机不能与我们直接组网,要通过USB连接“
物理链接时USB,A的USB可以虚拟成PC的网卡,PC和A组网,然后PC访问网络共享盘?

使用特权

评论回复
评论
laowang55555 2020-9-1 11:13 回复TA
这个思路挺好。 还能直接通过USB协议进行穿透吗? 
6
laowang55555|  楼主 | 2020-9-10 16:54 | 只看该作者
有大佬了解吗

使用特权

评论回复
7
laowang55555|  楼主 | 2020-9-10 16:55 | 只看该作者


hello sir,

I can see your comments on github about the usbIP, and usb share project.  that was very helpful for me!

But I have some questions and problems, It will be appreciated if you can provide some advice.

in my project, I need to provide a solution , that will let the end user to access the USB disk as the following logical diagram:



windows 10 system (user side)=====USB cable======Linux A board(Kernel 3.10.xx)=====LAN network=====Linux B board=====USB disk



that means:

1. End user use the microsoft windows 10 system, but the USB disk was pluged in the Linux B board, user need to access the USB disk and copy files from it and past some files on local into it;

2. the windows 10 was connected with the Linux A board via USB cable, not network(if it's network , I can provide samba solution to resolve it easily, unfortunatelly, it's not network);

3. Linux A board and Linux B board are in the same local network, they are connected via network and can share files by TCP/IP , samba  USBIP...  In fact, these linux board were put in one office or one building mostly.



Could you please tell me how can I finished this requirement with quick and easy solution? more detail more good.

Have a good day and thank you very much!



My failed solution:

1. Linux A access Linux B with samba, that ok;  windows access Linux A , at that moment, Linux A must be set to MSG slave in the kernel, that ok; But I can't transfer files between they two;

2. windows access Linux A by seril port protocal, and connect Linux A with client program(secureCRT), read the files on Linux A (mounted to the USB directory), and transfer by zmodem protocol, but, the speed is very very slow.

这是我给专家写的邮件。。

使用特权

评论回复
8
laowang55555|  楼主 | 2020-9-12 09:45 | 只看该作者
any body know

使用特权

评论回复
9
ar_dong| | 2020-9-29 13:09 | 只看该作者
usb over ip 世界级难题,不是没人解决的了,只是能解决的公司有限。

使用特权

评论回复
评论
zhengfish 2020-11-25 11:01 回复TA
这种应用在什么场合? 
10
ysdx| | 2020-12-3 09:09 | 只看该作者
这个不就是和红盘单向摆渡类似吗?红盘摆渡和你的区别是你是网路,人家是单向光传输。

使用特权

评论回复
11
borland6538| | 2021-1-8 22:07 | 只看该作者
問題解決了嗎??
(1) 嵌入式Linux A ----局域网-----嵌入式Linux B--接U盘  
-> 這端你可以自己克服是嗎??   因為 嵌入式Linux A & 嵌入式Linux B 都是你自己可以處理是嗎?

(2)windows主机,用户操作----USB 线-------嵌入式Linux A
->  這端你無法解決是嗎?
如果是這樣的問題!
我可以提供方式給你解決

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

1

主题

9

帖子

0

粉丝