Open Leon90PL opened 3 years ago
Hi @Leon90PL, did you try out the changes in the mweal-ed fork? We merged them in dev today and it fixed many issues (e.g. graceful exit, hotplugging, memory leaks). Could you please confirm your issue persists with the dev version? Which OS are you running on your NanoPi?
Hi I tried with dev branch but I guess there is a problem with disconnection. Im using Armbian
Version 0.2
Running under kernel 5.3.0-rc7
CP: String DeviceProxy = DeviceProxy_LibUSB
CP: String HostProxy = HostProxy_GadgetFS
Loading plugins from /usr/local/lib/USBProxy/
vendorId = ffffffff
productId = ffffffff
DeviceProxy::nice = 50
cleaning up /tmp
removing 1
Made directory /tmp/gadget-BBuQUd for gadget
Printing Config data
Strings: 3
DeviceProxy: DeviceProxy_LibUSB
DeviceProxy::nice: 50
HostProxy: HostProxy_GadgetFS
Vectors: 1
Plugins:
PacketFilter_StreamLog
Pointer: 1
PacketFilter_StreamLog::file: 0xb6d1ad10
|Connected to device: 0613:2043@04 TransAct - Ithaca USB Printer
Starting libusbEventLoop thread (26313)
Error sending setup packet: Pipe error
Device: 12 01 00 02 00 00 00 40 13 06 43 20 01 01 01 02 03 01
Manufacturer: TransAct
Product: Ithaca USB Printer
Serial: EPIC 430
*Config(1): 09 02 37 00 02 01 00 c0 00
Interface(0):
*Alt(0): 09 04 00 00 02 ff 00 00 05
Name: USB COM
EP(84): 07 05 84 02 40 00 00
EP(02): 07 05 02 02 40 00 00
Interface(1):
*Alt(0): 09 04 01 00 02 07 01 02 04
Name: USB Prn
EP(84): 07 05 84 02 40 00 00
EP(02): 07 05 02 02 40 00 00
old bInterval: 00
calculated new bInterval: 00
old bInterval: 00
calculated new bInterval: 00
old bInterval: 00
calculated new bInterval: 00
old bInterval: 00
calculated new bInterval: 00
00 00 00 00 09 02 37 00 02 01 00 c0 00 09 04 00 00 02 ff 00 00 05 07 05 84 02 40 00 00 07 05 02
02 40 00 00 09 04 01 00 02 07 01 02 04 07 05 84 02 40 00 00 07 05 02 02 40 00 00 09 02 37 00 02
01 00 c0 00 09 04 00 00 02 ff 00 00 05 07 05 84 02 40 00 00 07 05 02 02 40 00 00 09 04 01 00 02
07 01 02 04 07 05 84 02 40 00 00 07 05 02 02 40 00 00 12 01 00 02 00 00 00 40 13 06 43 20 01 01
01 02 03 01
searching in [/tmp/gadget-BBuQUd]
Starting setup writer thread (26316) for EP00.
Starting setup reader thread (26315) for EP00.
gadgetfs: event 1
============== Host Connect
gadgetfs: event 2
============== Host Disconnect
gadgetfs: event 1
============== Host Connect
[80 06 00 03 00 00 ff 00]
[80 06 00 03 00 00 04 00]: 04 03 09 04
[80 06 02 03 09 04 ff 00]
[80 06 02 03 09 04 26 00]:
26 03 49 00 74 00 68 00 61 00 63 00 61 00 20 00 55 00 53 00 42 00 20 00 50 00 72 00 69 00 6e 00
74 00 65 00 72 00
[80 06 01 03 09 04 ff 00]
[80 06 01 03 09 04 12 00]: 12 03 54 00 72 00 61 00 6e 00 73 00 41 00 63 00 74 00
[80 06 03 03 09 04 ff 00]
[80 06 03 03 09 04 2c 00]:
2c 03 45 00 50 00 49 00 43 00 20 00 34 00 33 00 30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00
[00 09 01 00 00 00 00 00]
HostProxy_GadgetFS::setConfig
Try to open /tmp/gadget-BBuQUd/ep4in
Opened EP84
Try to open /tmp/gadget-BBuQUd/ep2out
gadgetfs: max. packet size is 64 bytes for EP2
Opened EP02
Try to open /tmp/gadget-BBuQUd/ep4in
689 Fail on open EP84 16 Device or resource busy
Starting reader thread (26322) for EP84.
Starting reader thread (26320) for EP02.
Sending ACK
[80 06 05 03 09 04 ff 00]
Starting writer thread (26321) for EP02.
[80 06 05 03 09 04 10 00]: 10 03 55 00 53 00 42 00 20 00 43 00 4f 00 4d 00
[80 06 04 03 09 04 ff 00]
Starting writer thread (26323) for EP84.
[80 06 04 03 09 04 10 00]: 10 03 55 00 53 00 42 00 20 00 50 00 72 00 6e 00
gadgetfs: event 2
============== Host Disconnect
Finished writer thread (26321) for EP02.
Finished writer thread (26323) for EP84.
EP02 aio_cancel rc = 1(AIO_NOTCANCELED), aio_error = 115 Operation now in progress
Finished reader thread (26320) for EP02.
Finished reader thread (26322) for EP84.
JOINABLE?: 1
JOIN READER: 4
gadgetfs: event 1
============== Host Connect
[80 06 03 03 09 04 ff 00]
[80 06 03 03 09 04 2c 00]:
2c 03 45 00 50 00 49 00 43 00 20 00 34 00 33 00 30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00
[00 09 01 00 00 00 00 00]
HostProxy_GadgetFS::setConfig
Try to open /tmp/gadget-BBuQUd/ep4in
Opened EP84
Try to open /tmp/gadget-BBuQUd/ep2out
It hangs on int open_endpoint(__u8 epAddress, const char * gadget_filename) -> open() within src/Plugins/Hosts/GadgetFS_helpers.cpp
I also needed to remove workaround from Manager::stopEps exit(-1)
I also noticed when host sends SET_CONFIGURATION, there is an error on reading from FD void HostProxy_GadgetFS::control_ack() read(p_device_file,0,0);
[00 09 01 00 00 00 00 00] LibUSB> 00 09 01 00 00 00 00 00 LibUSB< Sending ACK Read ACK error Invalid argument <- added log
another setup requests work fine OUT [01 0b 00 00 01 00 00 00] LibUSB> 01 0b 00 00 01 00 00 00 LibUSB< Sending ACK Read ACK result OK <- added log
Hey @Leon90PL, I am sorry that I cannot help you with this one atm. We support the rpi 4b only at Nesto and I lack the required low-level C skills to guess the root cause of your issue without having such a device. I hope to get some people involved into this project who know that stuff!
Hi, I'm using USBProxy with NanoPi Neo and Epic430 printer, it's working as expected with Linux and some Windows hosts but not working with specific Windows host.
Then host reports error. I also grabbed tcpdump from NanoPi https://imgur.com/a/ARsMJGZ Can anyone explain why host could reject device?