1 |
Mick <michaelkintzios@×××××.com> [15-05-14 08:00]: |
2 |
> On Thursday 14 May 2015 04:45:38 Meino.Cramer@×××.de wrote: |
3 |
> > Hi, |
4 |
> > |
5 |
> > I have a problem with some kind of a lokal net connection (ethernet |
6 |
> > over USB): |
7 |
> |
8 |
> I think that the problem is not network related, but USB rules related. |
9 |
> Please see below. |
10 |
> |
11 |
> |
12 |
> > Current handling is as follows: |
13 |
> > I boot my Gentoo-Linux PC, which connects to my Fritz!Box, collect |
14 |
> > EMail etc...works fine so far. |
15 |
> > Then I connect an embedded system (Arietta G25 |
16 |
> > www.acmesystems.it/arietta) to the usb port and wait until this |
17 |
> > little thing has booted. |
18 |
> > On my Linux PC I do the following then (as root): |
19 |
> > |
20 |
> > ifconfig usb0 192.168.10.1 up |
21 |
> > echo 1 >! /proc/sys/net/ipv4/ip_forward |
22 |
> > iptables -A FORWARD -i eth1 -j ACCEPT |
23 |
> > modprobe ip_tables |
24 |
> > modprobe ip_conntrack |
25 |
> > iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE |
26 |
> > ssh -t root@ariettaa abduco -A root |
27 |
> > |
28 |
> > (I real life I have two Ariettas which I connect to the |
29 |
> > PC the same time with two different IP-addresses and two |
30 |
> > different USB-ports) |
31 |
> > |
32 |
> > This connects me finally to the Arietta, which do ethernet over USB. |
33 |
> > I put the commands into a script, so not too much hassle here. |
34 |
> > |
35 |
> > But! |
36 |
> > On the Arietta I also installed Gentoo. An update, especially |
37 |
> > when it includes gcc can take up to three days (I tried |
38 |
> > crosscompilation and some other construction and I am currently |
39 |
> > most happiest (sounds a litte too much like 'german english'...;) |
40 |
> > with this). |
41 |
> > So I first fetch all needed files and then restart the update |
42 |
> > and detach from the terminal. |
43 |
> > |
44 |
> > Now the problem: |
45 |
> > When I shutdown the PC, which needs not to run all the time, and |
46 |
> > restart it later again I am no longer able to connect to the Arietta |
47 |
> > with the steps described above. All needed modules are loaded while |
48 |
> > booting the PC and ifplugd is installed on the Arietta. |
49 |
> > |
50 |
> > Unfortunately I have not found any differences of the USB interface, |
51 |
> > which would make it possible to handle the Ariettas via udev. |
52 |
> |
53 |
> Have you used 'udevadm monitor' to check how your USB device is recognised? |
54 |
> Each time it will be a different host & target and this is your problem. |
55 |
> |
56 |
> |
57 |
> > How can I make a reconnect after rebooting my PC possible every time? |
58 |
> |
59 |
> I think that the solution is to create a udev rule which will identify your |
60 |
> arietta interface when plugged in the PC and run the necessary script from |
61 |
> there on. |
62 |
> |
63 |
> Have a look here for persistent device naming: |
64 |
> |
65 |
> https://wiki.gentoo.org/wiki/Udev |
66 |
> |
67 |
> -- |
68 |
> Regards, |
69 |
> Mick |
70 |
|
71 |
Hi Mick, |
72 |
|
73 |
This is what udevadm monitor prints, when I unplug both Ariettas |
74 |
simultanously: |
75 |
solfire:/home/mccramer>udevadm monitor |
76 |
monitor will print the received events for: |
77 |
UDEV - the event which udev sends out after rule processing |
78 |
KERNEL - the kernel uevent |
79 |
|
80 |
KERNEL[13781.884965] remove /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0/net/usb1/queues/rx-0 (queues) |
81 |
KERNEL[13781.885027] remove /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0/net/usb1/queues/tx-0 (queues) |
82 |
KERNEL[13781.885067] remove /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0/net/usb1 (net) |
83 |
UDEV [13781.886418] remove /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0/net/usb1/queues/rx-0 (queues) |
84 |
KERNEL[13781.889122] remove /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0 (usb) |
85 |
KERNEL[13781.889194] remove /devices/pci0000:00/0000:00:13.2/usb4/4-4 (usb) |
86 |
UDEV [13781.902185] remove /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0/net/usb1/queues/tx-0 (queues) |
87 |
UDEV [13781.908021] remove /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0/net/usb1 (net) |
88 |
UDEV [13781.908429] remove /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0 (usb) |
89 |
UDEV [13781.919474] remove /devices/pci0000:00/0000:00:13.2/usb4/4-4 (usb) |
90 |
KERNEL[13781.993142] remove /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0/net/usb0/queues/rx-0 (queues) |
91 |
KERNEL[13781.993182] remove /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0/net/usb0/queues/tx-0 (queues) |
92 |
KERNEL[13781.993211] remove /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0/net/usb0 (net) |
93 |
UDEV [13781.993928] remove /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0/net/usb0/queues/rx-0 (queues) |
94 |
UDEV [13781.994215] remove /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0/net/usb0/queues/tx-0 (queues) |
95 |
KERNEL[13781.998111] remove /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0 (usb) |
96 |
KERNEL[13781.998170] remove /devices/pci0000:00/0000:00:13.2/usb4/4-5 (usb) |
97 |
UDEV [13782.000177] remove /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0/net/usb0 (net) |
98 |
UDEV [13782.000767] remove /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0 (usb) |
99 |
UDEV [13782.013093] remove /devices/pci0000:00/0000:00:13.2/usb4/4-5 (usb) |
100 |
|
101 |
|
102 |
This is printed, when I connect the first Arietta to the PC: |
103 |
|
104 |
monitor will print the received events for: |
105 |
UDEV - the event which udev sends out after rule processing |
106 |
KERNEL - the kernel uevent |
107 |
|
108 |
KERNEL[14000.140611] add /devices/pci0000:00/0000:00:13.2/usb4/4-5 (usb) |
109 |
KERNEL[14000.141572] add /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0 (usb) |
110 |
KERNEL[14000.141967] add /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0/net/usb0 (net) |
111 |
KERNEL[14000.142000] add /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0/net/usb0/queues/rx-0 (queues) |
112 |
KERNEL[14000.142046] add /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0/net/usb0/queues/tx-0 (queues) |
113 |
UDEV [14000.162311] add /devices/pci0000:00/0000:00:13.2/usb4/4-5 (usb) |
114 |
UDEV [14000.163727] add /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0 (usb) |
115 |
UDEV [14000.170206] add /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0/net/usb0 (net) |
116 |
UDEV [14000.170572] add /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0/net/usb0/queues/rx-0 (queues) |
117 |
UDEV [14000.185482] add /devices/pci0000:00/0000:00:13.2/usb4/4-5/4-5:1.0/net/usb0/queues/tx-0 (queues |
118 |
|
119 |
|
120 |
This is printed, when I connect the second Arietta to the PC: |
121 |
|
122 |
monitor will print the received events for: |
123 |
UDEV - the event which udev sends out after rule processing |
124 |
KERNEL - the kernel uevent |
125 |
|
126 |
KERNEL[14108.192714] add /devices/pci0000:00/0000:00:13.2/usb4/4-4 (usb) |
127 |
KERNEL[14108.193781] add /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0 (usb) |
128 |
KERNEL[14108.194211] add /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0/net/usb1 (net) |
129 |
KERNEL[14108.194247] add /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0/net/usb1/queues/rx-0 (queues) |
130 |
KERNEL[14108.194269] add /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0/net/usb1/queues/tx-0 (queues) |
131 |
UDEV [14108.211967] add /devices/pci0000:00/0000:00:13.2/usb4/4-4 (usb) |
132 |
UDEV [14108.213327] add /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0 (usb) |
133 |
UDEV [14108.217344] add /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0/net/usb1 (net) |
134 |
UDEV [14108.217615] add /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0/net/usb1/queues/rx-0 (queues) |
135 |
UDEV [14108.237237] add /devices/pci0000:00/0000:00:13.2/usb4/4-4/4-4:1.0/net/usb1/queues/tx-0 (queues) |
136 |
|
137 |
|
138 |
The assigment to certain USB ports may vary from time to time. |
139 |
|
140 |
|
141 |
This is what lsusb prints for both devices |
142 |
|
143 |
|
144 |
Bus 004 Device 007: ID 0525:a4a2 Netchip Technology, Inc. Linux-USB Ethernet/RNDIS Gadget |
145 |
Device Descriptor: |
146 |
bLength 18 |
147 |
bDescriptorType 1 |
148 |
bcdUSB 2.00 |
149 |
bDeviceClass 2 Communications |
150 |
bDeviceSubClass 0 |
151 |
bDeviceProtocol 0 |
152 |
bMaxPacketSize0 64 |
153 |
idVendor 0x0525 Netchip Technology, Inc. |
154 |
idProduct 0xa4a2 Linux-USB Ethernet/RNDIS Gadget |
155 |
bcdDevice 4.00 |
156 |
iManufacturer 1 Linux 4.0.1-20150414.001 with atmel_usba_udc |
157 |
iProduct 2 RNDIS/Ethernet Gadget |
158 |
iSerial 0 |
159 |
bNumConfigurations 2 |
160 |
Configuration Descriptor: |
161 |
bLength 9 |
162 |
bDescriptorType 2 |
163 |
wTotalLength 75 |
164 |
bNumInterfaces 2 |
165 |
bConfigurationValue 2 |
166 |
iConfiguration 0 |
167 |
bmAttributes 0xc0 |
168 |
Self Powered |
169 |
MaxPower 2mA |
170 |
Interface Association: |
171 |
bLength 8 |
172 |
bDescriptorType 11 |
173 |
bFirstInterface 0 |
174 |
bInterfaceCount 2 |
175 |
bFunctionClass 2 Communications |
176 |
bFunctionSubClass 6 Ethernet Networking |
177 |
bFunctionProtocol 0 |
178 |
iFunction 6 RNDIS |
179 |
Interface Descriptor: |
180 |
bLength 9 |
181 |
bDescriptorType 4 |
182 |
bInterfaceNumber 0 |
183 |
bAlternateSetting 0 |
184 |
bNumEndpoints 1 |
185 |
bInterfaceClass 2 Communications |
186 |
bInterfaceSubClass 2 Abstract (modem) |
187 |
bInterfaceProtocol 255 Vendor Specific (MSFT RNDIS?) |
188 |
iInterface 4 RNDIS Communications Control |
189 |
CDC Header: |
190 |
bcdCDC 1.10 |
191 |
CDC Call Management: |
192 |
bmCapabilities 0x00 |
193 |
bDataInterface 1 |
194 |
CDC ACM: |
195 |
bmCapabilities 0x00 |
196 |
CDC Union: |
197 |
bMasterInterface 0 |
198 |
bSlaveInterface 1 |
199 |
Endpoint Descriptor: |
200 |
bLength 7 |
201 |
bDescriptorType 5 |
202 |
bEndpointAddress 0x83 EP 3 IN |
203 |
bmAttributes 3 |
204 |
Transfer Type Interrupt |
205 |
Synch Type None |
206 |
Usage Type Data |
207 |
wMaxPacketSize 0x0008 1x 8 bytes |
208 |
bInterval 32 |
209 |
Interface Descriptor: |
210 |
bLength 9 |
211 |
bDescriptorType 4 |
212 |
bInterfaceNumber 1 |
213 |
bAlternateSetting 0 |
214 |
bNumEndpoints 2 |
215 |
bInterfaceClass 10 CDC Data |
216 |
bInterfaceSubClass 0 |
217 |
bInterfaceProtocol 0 |
218 |
iInterface 5 RNDIS Ethernet Data |
219 |
Endpoint Descriptor: |
220 |
bLength 7 |
221 |
bDescriptorType 5 |
222 |
bEndpointAddress 0x81 EP 1 IN |
223 |
bmAttributes 2 |
224 |
Transfer Type Bulk |
225 |
Synch Type None |
226 |
Usage Type Data |
227 |
wMaxPacketSize 0x0040 1x 64 bytes |
228 |
bInterval 0 |
229 |
Endpoint Descriptor: |
230 |
bLength 7 |
231 |
bDescriptorType 5 |
232 |
bEndpointAddress 0x02 EP 2 OUT |
233 |
bmAttributes 2 |
234 |
Transfer Type Bulk |
235 |
Synch Type None |
236 |
Usage Type Data |
237 |
wMaxPacketSize 0x0040 1x 64 bytes |
238 |
bInterval 0 |
239 |
Configuration Descriptor: |
240 |
bLength 9 |
241 |
bDescriptorType 2 |
242 |
wTotalLength 32 |
243 |
bNumInterfaces 1 |
244 |
bConfigurationValue 1 |
245 |
iConfiguration 0 |
246 |
bmAttributes 0xc0 |
247 |
Self Powered |
248 |
MaxPower 2mA |
249 |
Interface Descriptor: |
250 |
bLength 9 |
251 |
bDescriptorType 4 |
252 |
bInterfaceNumber 0 |
253 |
bAlternateSetting 0 |
254 |
bNumEndpoints 2 |
255 |
bInterfaceClass 2 Communications |
256 |
bInterfaceSubClass 12 Ethernet Emulation |
257 |
bInterfaceProtocol 7 Ethernet Emulation (EEM) |
258 |
iInterface 8 CDC Ethernet Emulation Model (EEM) |
259 |
Endpoint Descriptor: |
260 |
bLength 7 |
261 |
bDescriptorType 5 |
262 |
bEndpointAddress 0x81 EP 1 IN |
263 |
bmAttributes 2 |
264 |
Transfer Type Bulk |
265 |
Synch Type None |
266 |
Usage Type Data |
267 |
wMaxPacketSize 0x0040 1x 64 bytes |
268 |
bInterval 0 |
269 |
Endpoint Descriptor: |
270 |
bLength 7 |
271 |
bDescriptorType 5 |
272 |
bEndpointAddress 0x02 EP 2 OUT |
273 |
bmAttributes 2 |
274 |
Transfer Type Bulk |
275 |
Synch Type None |
276 |
Usage Type Data |
277 |
wMaxPacketSize 0x0040 1x 64 bytes |
278 |
bInterval 0 |
279 |
Device Qualifier (for other device speed): |
280 |
bLength 10 |
281 |
bDescriptorType 6 |
282 |
bcdUSB 2.00 |
283 |
bDeviceClass 2 Communications |
284 |
bDeviceSubClass 0 |
285 |
bDeviceProtocol 0 |
286 |
bMaxPacketSize0 64 |
287 |
bNumConfigurations 2 |
288 |
Device Status: 0x0001 |
289 |
Self Powered |
290 |
|
291 |
Bus 004 Device 008: ID 0525:a4a2 Netchip Technology, Inc. Linux-USB Ethernet/RNDIS Gadget |
292 |
Device Descriptor: |
293 |
bLength 18 |
294 |
bDescriptorType 1 |
295 |
bcdUSB 2.00 |
296 |
bDeviceClass 2 Communications |
297 |
bDeviceSubClass 0 |
298 |
bDeviceProtocol 0 |
299 |
bMaxPacketSize0 64 |
300 |
idVendor 0x0525 Netchip Technology, Inc. |
301 |
idProduct 0xa4a2 Linux-USB Ethernet/RNDIS Gadget |
302 |
bcdDevice 4.00 |
303 |
iManufacturer 1 Linux 4.0.1-20150414.001 with atmel_usba_udc |
304 |
iProduct 2 RNDIS/Ethernet Gadget |
305 |
iSerial 0 |
306 |
bNumConfigurations 2 |
307 |
Configuration Descriptor: |
308 |
bLength 9 |
309 |
bDescriptorType 2 |
310 |
wTotalLength 75 |
311 |
bNumInterfaces 2 |
312 |
bConfigurationValue 2 |
313 |
iConfiguration 0 |
314 |
bmAttributes 0xc0 |
315 |
Self Powered |
316 |
MaxPower 2mA |
317 |
Interface Association: |
318 |
bLength 8 |
319 |
bDescriptorType 11 |
320 |
bFirstInterface 0 |
321 |
bInterfaceCount 2 |
322 |
bFunctionClass 2 Communications |
323 |
bFunctionSubClass 6 Ethernet Networking |
324 |
bFunctionProtocol 0 |
325 |
iFunction 6 RNDIS |
326 |
Interface Descriptor: |
327 |
bLength 9 |
328 |
bDescriptorType 4 |
329 |
bInterfaceNumber 0 |
330 |
bAlternateSetting 0 |
331 |
bNumEndpoints 1 |
332 |
bInterfaceClass 2 Communications |
333 |
bInterfaceSubClass 2 Abstract (modem) |
334 |
bInterfaceProtocol 255 Vendor Specific (MSFT RNDIS?) |
335 |
iInterface 4 RNDIS Communications Control |
336 |
CDC Header: |
337 |
bcdCDC 1.10 |
338 |
CDC Call Management: |
339 |
bmCapabilities 0x00 |
340 |
bDataInterface 1 |
341 |
CDC ACM: |
342 |
bmCapabilities 0x00 |
343 |
CDC Union: |
344 |
bMasterInterface 0 |
345 |
bSlaveInterface 1 |
346 |
Endpoint Descriptor: |
347 |
bLength 7 |
348 |
bDescriptorType 5 |
349 |
bEndpointAddress 0x83 EP 3 IN |
350 |
bmAttributes 3 |
351 |
Transfer Type Interrupt |
352 |
Synch Type None |
353 |
Usage Type Data |
354 |
wMaxPacketSize 0x0008 1x 8 bytes |
355 |
bInterval 32 |
356 |
Interface Descriptor: |
357 |
bLength 9 |
358 |
bDescriptorType 4 |
359 |
bInterfaceNumber 1 |
360 |
bAlternateSetting 0 |
361 |
bNumEndpoints 2 |
362 |
bInterfaceClass 10 CDC Data |
363 |
bInterfaceSubClass 0 |
364 |
bInterfaceProtocol 0 |
365 |
iInterface 5 RNDIS Ethernet Data |
366 |
Endpoint Descriptor: |
367 |
bLength 7 |
368 |
bDescriptorType 5 |
369 |
bEndpointAddress 0x81 EP 1 IN |
370 |
bmAttributes 2 |
371 |
Transfer Type Bulk |
372 |
Synch Type None |
373 |
Usage Type Data |
374 |
wMaxPacketSize 0x0040 1x 64 bytes |
375 |
bInterval 0 |
376 |
Endpoint Descriptor: |
377 |
bLength 7 |
378 |
bDescriptorType 5 |
379 |
bEndpointAddress 0x02 EP 2 OUT |
380 |
bmAttributes 2 |
381 |
Transfer Type Bulk |
382 |
Synch Type None |
383 |
Usage Type Data |
384 |
wMaxPacketSize 0x0040 1x 64 bytes |
385 |
bInterval 0 |
386 |
Configuration Descriptor: |
387 |
bLength 9 |
388 |
bDescriptorType 2 |
389 |
wTotalLength 32 |
390 |
bNumInterfaces 1 |
391 |
bConfigurationValue 1 |
392 |
iConfiguration 0 |
393 |
bmAttributes 0xc0 |
394 |
Self Powered |
395 |
MaxPower 2mA |
396 |
Interface Descriptor: |
397 |
bLength 9 |
398 |
bDescriptorType 4 |
399 |
bInterfaceNumber 0 |
400 |
bAlternateSetting 0 |
401 |
bNumEndpoints 2 |
402 |
bInterfaceClass 2 Communications |
403 |
bInterfaceSubClass 12 Ethernet Emulation |
404 |
bInterfaceProtocol 7 Ethernet Emulation (EEM) |
405 |
iInterface 8 CDC Ethernet Emulation Model (EEM) |
406 |
Endpoint Descriptor: |
407 |
bLength 7 |
408 |
bDescriptorType 5 |
409 |
bEndpointAddress 0x81 EP 1 IN |
410 |
bmAttributes 2 |
411 |
Transfer Type Bulk |
412 |
Synch Type None |
413 |
Usage Type Data |
414 |
wMaxPacketSize 0x0040 1x 64 bytes |
415 |
bInterval 0 |
416 |
Endpoint Descriptor: |
417 |
bLength 7 |
418 |
bDescriptorType 5 |
419 |
bEndpointAddress 0x02 EP 2 OUT |
420 |
bmAttributes 2 |
421 |
Transfer Type Bulk |
422 |
Synch Type None |
423 |
Usage Type Data |
424 |
wMaxPacketSize 0x0040 1x 64 bytes |
425 |
bInterval 0 |
426 |
Device Qualifier (for other device speed): |
427 |
bLength 10 |
428 |
bDescriptorType 6 |
429 |
bcdUSB 2.00 |
430 |
bDeviceClass 2 Communications |
431 |
bDeviceSubClass 0 |
432 |
bDeviceProtocol 0 |
433 |
bMaxPacketSize0 64 |
434 |
bNumConfigurations 2 |
435 |
Device Status: 0x0001 |
436 |
Self Powered |
437 |
|
438 |
|
439 |
As I wrote in my initial mail: |
440 |
I see no difference in both, which may offer a possibilty to act upon |
441 |
when plugging in the one or the other (or both) devices/Ariettas. |
442 |
|
443 |
Before I mailed to the group I read the documentation you linked, but |
444 |
may be I missed something which reveals the solution to this |
445 |
problem... |
446 |
But what did I miss? |
447 |
|
448 |
Best regards, |
449 |
Meino |