-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V 1.0.1 Crash at start of scan with HP Laserjet #39
Comments
The eSCL specification is sadly not written very well. Therefore, implementations might diverge from one scanner to another and of course, I can't test it with every device. This was the source of the last error and probably is also the source of this bug. Can you redo the scan with the app, let it crash and then open http://[scanner address]/eSCL/ScannerStatus in a web browser and send the XML to me? I will meanwhile take care of making sure that the app doesn't crash in such cases and instead just aborts scanning and shows an error. In the best case, it should also provide the ScannerStatus which led to the error for easy copying (#38). |
Here is the result of ScannerStatus:
|
That's kind of interesting. With
The used XML parser is very strict on namespaces and it's difficult to change that. It's a pretty stupid fix but the simplest way to fix this will be to search for the scan:ScannerStatus tag and just replace it with the above no matter what other declarations are given or not given. |
I've now found out that surprisingly the web browser just removes the namespaces declarations from the XML output. Your scanner however does luckily send them correctly. The actual problem was the TransferRetryCount element that was unknown to eSCLKt. Can you please test if the nightly build works with your scanner now? |
No 100% success for now, but we are getting closer: Pressing the "Scannen" button now starts the scanner, but shows: |
Hm, that's pretty difficult to diagnose. Your scanner says it's temporarily unavailable for some reason. With my scanner this sometimes happened when ScanBridge would abort retrieving pages because of an error/crash. The scanner would then see the job as unfinished. After a while the scanner gave up on the job and was available again. Try completely rebooting the scanner device. If it still happens, can you send the ScannerStatus before and after trying to scan? Maybe there is some insightful information there. |
Rebooting the Scanner did not bring any progress. So here come the outputs of ScannerStatus before and after the 503 error:
With getting logcat output on android and deepdive with wireshark I have no experience. |
Just tried the brand new official 1.1.0 release, but no better :-( |
That's a very good idea, also for making future bug reports easier. I've implemented this now but I'll have to review everything again before I can merge it into the main branch (#41). Meanwhile, you can download a prerelease APK here: https://fireamp.eu/static/ScanBridge-debug.apk (GitHub doesn't allow uploading APKs here, so I had to put it on a private server) To use the debugging log feature navigate into the settings and activate the debug log setting. Then do what you normally would do to cause the problem. Afterwards, go into the settings again and export the log file. You can then send it to me and I will have a look. |
I've taken a look at the debug log. Unfortunately, it is not very conclusive. Your scanner doesn't send any reason why the NextDocument is temporarily unavailable. But I've made some interesting/weird discoveries:
|
Is the above last scanner status you sent me a long time after the scanner has completed scanning and have you actually manually canceled the job at the device (e.g. by using some button or touch input), as the JobStateReason says? |
Nice to see progress even in other issues. So I try to answer to your latest questions:
Here is a screenshot of the web interface:
On my android smartphone I tested with the official app from Mopria: So I don't think my printer is wrong or buggy. BTW: Do you know the Mopria eSCL Specification? https://mopria.org/spec-download |
As the practical experience with #47 shows it does however actually make a difference in some cases whether you connect using 80 or 8080
That makes it the most likely hypothesis that your scanner requires a sort of polling. I read that some scanners do it like this in https://gist.github.com/markosjal/79d03cc4f1fd287016906e7ff6f07136
Sorry that you had to put so much time in this. But this result is definitely better than if something would be wrong with your scanner. It would have been perfect if you had ran Wireshark while running your scans. Its basically a software that can record and visualize all network message. Then you can filter for the requests sent to your scanner and see what exactly eSCL-sane has done. It is not that difficult to use but as you are not a Linux user I don't expect you to spent time on that, especially because I'm pretty sure we've found the problem now. At least I hope so.
Yeah, that is actually the document that eSCLKt, the supporting library for eSCL used by ScanBridge, is partially based on, in addition to the knowledge taken from testing with actual scanners. Not everything what is in the document is implemented by eSCLKt though, but some things also just aren't really used by scanners in the wild or are not necessary for a scanner app (e.g. push scans as described in the document). At the same time (as has shown multiple times with the issues here), several scanners also have extended the protocol in some way or another. The Mopria spec is definitely not complete. Even your scanner had properties in the scanner capabilities that are not specified in the Mopria spec. eSCLKt could ignore that in many cases, but then we would never know which additional properties and features scanners in the wild actually have and can't support them. So instead of ignoring, it errors out to get it reported here and these things get then added to a list of known additional features/expansions. Sometimes elements which I assume to be obligatory according to the spec also are missing (e.g. with #47 the scanner UUID is missing). From section "11.1
ScanBridge does not do it exactly like this (even though this description is not very exact either). Actually, it does pretty exactly what is written as an example in Section "11.5 I will try to implement this usage flow and then talk back to you to see if it works |
I've now created 2 test APKs. These are not meant as actual fixes but will hopefully provide information on how a fix could look like. The first one observes and logs the job status for 40 seconds. This will be interesting as we can then see if there are any important changes there. So try out that one. Leave it enough time as it will take at least 40 seconds. While doing that record a debug log and then send it to me. The second one tries to access the new page endpoint until it actually returns something (until it is not 503 anymore). Record a debug log with this one. Give it at least a minute as well. If it then didn't retrieve the page you can close the app and send the debug log to me. |
That's very good! With both APKs your scanner sent an image. Can you now please test if the issue is fixed with this build? Check both ADF (with multiple pages) and Platen input source. If it does not work, please record another debug log |
SUCCESS !!! 👍✨ Now it works, both flatbed and ADF ... |
When I try to start scanning on a HP Color Laserjet MFP M283fdw the app crashes (closes itself and the homescreen of android is shown).
After restarting the app a message is shown: "Absturzprotokoll gefunden"
Details I will add in the other sections ...
Steps to reproduce the behavior:
Expected behavior
The scanned document should be displayed in the app.
Screenshots
Will add them later if necessary
Smartphone (please complete the following information):
Device: Motorola Edge 50 pro
Android version: 14
ScanBridge version: 1.0.1 (1000001, 42f9281 ) nightly
Additional context
The text was updated successfully, but these errors were encountered: