cyanfish / naps2

Scan documents to PDF and more, as simply as possible.
https://www.naps2.com
Other
2.86k stars 327 forks source link

Development issues regarding the use of scanning in escl driver #272

Closed zhangxihuai closed 9 months ago

zhangxihuai commented 10 months ago

Hello. I am currently working on .net6 to build the program, I can use "ScanController. GetDeviceList()" to obtain wia devices in Windows and sane devices in Linux. But I cannot retrieve the device from the "ScanController. GetDeviceList (Driver. Escl)" method, whether it is Windows or Linux. Using in NAPS2 7.2.2, I can obtain devices through the "ESCL Driver",but my own program cannot do it What should I do? Thanks

cyanfish commented 10 months ago

Try setting ScanningContext.Logger (e.g. NLog, or just implement a basic ILogger with Console.WriteLine or something). ESCL should have some useful debug-level logging.

I'm not sure what the problem would be, maybe something to do with firewall access from your process?

zhangxihuai commented 10 months ago

Thank you for your reply. I have obtained some log information (some information has been replaced with '*'). I‘m not sure if it is what you are looking for. Can these help you locate the problem?

ScanningContext: Trace: TXTRecord HP\032LJ\032Pro\032MFP\03231013***\032(NET)._uscan._tcp.local IN TXT txtvers=1 txtvers=1 Vers=2.0 rs=eSCL "ty=HP LJ Pro MFP 31013*** (NET)" pdl=application/pdf,image/jpeg,image/png uuid=9f70699d-0e99-f199-c026-b275ff9a**** cs=color,grayscale,binary is=platen duplex=F
ScanningContext: Trace: SRVRecord HP\032LJ\032Pro\032MFP\03231013***\032(NET)._uscan._tcp.local IN SRV 0 0 17945 HP\032LJ\032Pro\032MFP\03231013***\032(NET).uscan.local
ScanningContext: Trace: ARecord HP\032LJ\032Pro\032MFP\03231013***\032(NET).uscan.local 120 IN A 192.168.1.157
ScanningContext: Trace: ARecord HP\032LJ\032Pro\032MFP\03231013***\032(NET).uscan.local 120 IN A 192.168.139.1
ScanningContext: Trace: ARecord HP\032LJ\032Pro\032MFP\03231013***\032(NET).uscan.local 120 IN A 192.168.137.1
ScanningContext: Trace: AAAARecord HP\032LJ\032Pro\032MFP\03231013***\032(NET).uscan.local 120 IN AAAA fe80::6eac:5169:2c6:902f
ScanningContext: Trace: AAAARecord HP\032LJ\032Pro\032MFP\03231013***\032(NET).uscan.local 120 IN AAAA fe80::d82f:2d8b:a8ea:8b71
ScanningContext: Trace: AAAARecord HP\032LJ\032Pro\032MFP\03231013***\032(NET).uscan.local 120 IN AAAA fe80::7edb:ea8:17ca:6204
ScanningContext: Trace: TXTRecord HP\032LaserJet\032Pro\032MFP\0323101-3***\032[A57F97]._uscans._tcp.local CLASS32769 TXT txtvers=1 adminurl=http://HP38CA84A5****.local. note= UUID=97547462-d241-48e4-adb1-3258649a**** vers=2.63 representation=images/printer.png rs=eSCL "ty=HP LaserJet Pro MFP 3101-3***" pdl=application/octet-stream,application/pdf,image/jpeg cs=binary,color,grayscale is=platen,adf duplex=F mopria-certified-scan=1.3 usb_MFG=HP
ScanningContext: Trace: TXTRecord HP\032LaserJet\032Pro\032MFP\0323101-3***\032[A57F97]._uscan._tcp.local CLASS32769 TXT txtvers=1 adminurl=http://HP38CA84A5****.local. note= UUID=97547462-d241-48e4-adb1-3258649a**** vers=2.63 representation=images/printer.png rs=eSCL "ty=HP LaserJet Pro MFP 3101-3***" pdl=application/octet-stream,application/pdf,image/jpeg cs=binary,color,grayscale is=platen,adf duplex=F mopria-certified-scan=1.3 usb_MFG=HP
ScanningContext: Trace: ARecord HP38CA84A5****.local 120 CLASS32769 A 192.168.1.222
ScanningContext: Trace: AAAARecord HP38CA84A5****.local 120 CLASS32769 AAAA fe80::3aca:84ff:fea5:7f97
ScanningContext: Trace: SRVRecord HP\032LaserJet\032Pro\032MFP\0323101-3***\032[A57F97]._uscans._tcp.local 120 CLASS32769 SRV 0 0 443 HP38CA84A5****.local
ScanningContext: Trace: SRVRecord HP\032LaserJet\032Pro\032MFP\0323101-3***\032[A57F97]._uscan._tcp.local 120 CLASS32769 SRV 0 0 8080 HP38CA84A5****.local
ScanningContext: Trace: NSECRecord HP\032LaserJet\032Pro\032MFP\0323101-3***\032[A57F97]._uscans._tcp.local CLASS32769 NSEC HP\032LaserJet\032Pro\032MFP\0323101-3***\032[A57F97]._uscans._tcp.local TXT SRV
ScanningContext: Trace: NSECRecord HP\032LaserJet\032Pro\032MFP\0323101-3***\032[A57F97]._uscan._tcp.local CLASS32769 NSEC HP\032LaserJet\032Pro\032MFP\0323101-3***\032[A57F97]._uscan._tcp.local TXT SRV
ScanningContext: Trace: NSECRecord HP38CA84A5****.local 120 CLASS32769 NSEC HP38CA84A5****.local A AAAA
引发的异常:“System.InvalidOperationException”(位于 AvaloniaApplicationNet6.dll 中)
No scanner available: List<ScanDevice>.Count = 0
cyanfish commented 10 months ago

Thanks, it looks like there's an error that's not logged properly, can you try the latest SDK version (0.2.3) and collect the same logs again?

cyanfish commented 9 months ago

Closing for now, feel free to comment again if you need more help.