Tenrec-Builders / pi-scan

Pi Scan is a simple, robust capture appliance for book scanners. It runs on a Raspberry Pi 2.
BSD 2-Clause "Simplified" License
264 stars 37 forks source link

Recurrent errors #12

Open meelash opened 6 years ago

meelash commented 6 years ago

My workflow is interrupted with what, I think, is a non ideal frequency of errors during scanning. Here is the log file from a recent scan of approximately 600 pages: https://gist.github.com/meelash/d449ec023bec0bfe9ce5f81861185d52 Errors occur after 45 scans, 80 scans, 10, 27, 16, 25, 74, and 19 scans for an average of one error about every 37 scans. (I'm only getting 433 pages/hour in this run, although it included time taking pictures of the error messages and trying different procedures for clearing errors)

Again, my first question is, are these results typical? Is this something with my setup, or is it a general problem with pi-scan or chdk that I can help to diagnose and fix?

As far as I can see the modes of failure appear to be multiple. There are some times when I get a "Got empty data back when capturing" and I can just hit "ok," rescan, and continue although it seems to have a high likelihood of reoccurring shortly thereafter and requiring more serious measures. Turning the camera in question off and on again seems to always allow me to continue, but sometimes restarting pi-scan, without touching the cameras seems to work. The other evidence I have of multiple modes of failure is the different symptoms on the camera displays. Here are some samples (I can match these up with times in the logs if necessary):

An early error resulted in this memory card error (but I'm not sure if that was there on the initial error, or as a result of restarts and retries to attempt to get past the error without restarting the camera) img_3245

Sometimes the error would result in the screen of the camera displaying L3 or L2: img_3247 img_3254 I think in these cases, it would seem like chdk was gone, and pressing the menu button would bring up the normal menu instead of the chdk alt menu: img_3255 A restart of pi-scan would return the camera to chdk mode.

There was an error that resulted in the camera becoming completely unresponsive, with the screen black: img_3248 Obviously, that required restarting the camera to fix.

Then, there was an error where the camera would make the noise of shutter firing and the display of the camera would show this menu: img_3250

So, assuming these are individual issues and not all a result of some shortcoming in my system setup, any ideas which one might be addressable first/easiest? And are these problems related to pi-scan, or chdk?

If related to chdk, then I guess the question is whether they are typical for the performance of other applications of chdkptp or not.

duerig commented 6 years ago

While there will always be some camera failures, this is more frequent than normal. Just to double check, are you using a USB hub or similar device? I have seen intermittent problems like this on setups that use a USB hub.

I will look through the log and see if I can offer more things to try.

On Sun, Jan 14, 2018, at 12:18 PM, meelash wrote:

My workflow is interrupted with what, I think, is a non ideal frequency of errors during scanning. Here is the log file from a recent scan of approximately 600 pages: https://gist.github.com/meelash/d449ec023bec0bfe9ce5f81861185d52> Errors occur after 45 scans, 80 scans, 10, 27, 16, 25, 74, and 19 scans for an average of one error about every 37 scans. (I'm only getting 433 pages/hour in this run, although it included time taking pictures of the error messages and trying different procedures for clearing errors)> Again, my first question is, are these results typical? Is this something with my setup, or is it a general problem with pi-scan or chdk that I can help to diagnose and fix?> As far as I can see the modes of failure appear to be multiple. There are some times when I get a "Got empty data back when capturing" and I can just hit "ok," rescan, and continue although it seems to have a high likelihood of reoccurring shortly thereafter and requiring more serious measures. Turning the camera in question off and on again seems to always allow me to continue, but sometimes restarting pi- scan, without touching the cameras seems to work. The other evidence I have of multiple modes of failure is the different symptoms on the camera displays. Here are some samples (I can match these up with times in the logs if necessary):> An early error resulted in this memory card error (but I'm not sure if that was there on the initial error, or as a result of restarts and retries to attempt to get past the error without restarting the camera) img_3245> Sometimes the error would result in the screen of the camera displaying L3 or L2:> img_3247 img_3254 I think in these cases, it would seem like chdk was gone, and pressing the menu button would bring up the normal menu instead of the chdk alt menu:> img_3255 A restart of pi-scan would return the camera to chdk mode.

There was an error that resulted in the camera becoming completely unresponsive, with the screen black:> img_3248 Obviously, that required restarting the camera to fix.

Then, there was an error where the camera would make the noise of shutter firing and the display of the camera would show this menu: img_3245> So, assuming these are individual issues and not all a result of some shortcoming in my system setup, any ideas which one might be addressable first/easiest? And are these problems related to pi-scan, or chdk?> If related to chdk, then I guess the question is whether they are typical for the performance of other applications of chdkptp or not.> — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub[1], or mute the thread[2].>

Links:

  1. https://github.com/Tenrec-Builders/pi-scan/issues/12
  2. https://github.com/notifications/unsubscribe-auth/AA1sTIl167IhKLcJRhDxUkSrHW5mfozgks5tKlMcgaJpZM4Rds5O
meelash commented 6 years ago

I am not using a USB hub, but do you have any idea what about USB hubs causes problems? Is it unsteady power supply?

If that's what it is, I might look into that because I am in Pakistan and I'm guessing the AC might be noisy although I'm not sure how much of that would survive after conversion to DC. Any other ideas would be appreciated; I'll look further into this and report back.

rramphal commented 6 years ago

@duerig, I am also experiencing these same problems as @meelash is reporting and I am using only the equipment that came with my Archivist Quill order. I'll add that every time one of my cameras takes a photo, it beeps three times which it did not do before.

meelash commented 6 years ago

That beeping is very interesting, because I also noticed that at some point... Thought I was going crazy ;) No idea if it was related to an update or what. But since I've been hacking on pi-scan, chdkptp, etc. myself, somehow when I fixed a bunch of other errors that beeping went away, also.

I am still working on these errors. If you notice in my log, all the errors had something like: ["'NoneType' object is not callable"] so that's actually a mistake in the error handling. I've gotten to the point now where I am getting actual errors related to the problem and also stack traces from the chdkptp code, so hopefully now I can get to the bottom of the problems.

meelash commented 6 years ago

@duerig I've had a chance to try using TwoCamControl using a Windows VM installed on my laptop using VirtualBox. Everything else about my setup is the same and the results are vastly different. It is very, very fast, such that the limiting factor is far and away my physical limitations of speed turning, and so far I've scanned a few thousand pages without any errors, as opposed to never getting through more than a few hundred with pi-scan.

Seems like there are two possibilities, one being that the lesser capabilities of the pi are somehow contributing to errors in I/O or that the software is not as robust (although, twocamcontrol is actually a somewhat crude approach, just a macro sending keystrokes basically).

If I had to guess, I would say it probably has to do with using rs instead of rsint. Chances are reinitializing the camera every shot leads to a lot more opportunity for failure and it seems rsint is faster and more robust for shooting again and again.

duerig commented 6 years ago

I'm not 100% sure what the difference is between rs and rsint. I'll have to look into that.

Going forward, I will likely be moving to a slightly different system that invokes chdkptp in a separate process rather than trying to run lua code directly via libraries. Some of the code paths for capturing and downloading images diverge from the lua implementations in chdkptp and so there are probably bugfixes and such that I can make use of by invoking the chdkptp command line and using those better-supported and better-tested routines. This would likely be similar to the gphoto support that is already there.

meelash commented 6 years ago

👍 seems the way to go to me, also.