{"id":956,"date":"2020-12-28T20:34:41","date_gmt":"2020-12-29T01:34:41","guid":{"rendered":"https:\/\/dc540.org\/xxx\/?p=956"},"modified":"2022-09-03T07:16:46","modified_gmt":"2022-09-03T11:16:46","slug":"network-scanner-on-a-budget","status":"publish","type":"post","link":"https:\/\/dc540.org\/xxx\/2020\/12\/network-scanner-on-a-budget\/","title":{"rendered":"Network Scanner on a budget"},"content":{"rendered":"\n<p>I was about to pull the trigger on a network-enabled Fujitsu ScanSnap scanner, because I&#8217;ve been scanning on my Ricoh all-in-one that doesn&#8217;t do duplex, and I have a number of two-sided documents to scan. I was annoyed at the price tag on what seems to me to be not much more innovation than the older machines, which lack only networking.<\/p>\n\n\n\n<p>Then I found this post by Chris Schuld: <\/p>\n\n\n\n<p><a href=\"http:\/\/Network Scanner with Fujitsu ScanSnap and a Raspberry Pi\">https:\/\/chrisschuld.com\/2020\/01\/network-scanner-with-scansnap-and-raspberry-pi\/<\/a><\/p>\n\n\n\n<p>Makes perfect sense. Set up a Pi to do the networking, then just get a SANE-enabled scanner and off to the races. <\/p>\n\n\n\n<p>So I checked the SANE supported scanner list, and found that the ScanSnap S1500 or S1500M (pro-tip: they&#8217;re the same) was a good choice &#8212; a snappy duplex scanner with ADF, USB-connected, for a good price point, about $100. Picked one up in great condition on ebay, and it was absolutely up to the task. For testing, I used the Raspberry Pi 4 (4GB model) that had been commissioned for OctoPi for the 3D printer, and figured if it worked well I&#8217;d order another.<\/p>\n\n\n\n<p>Well, following Chris&#8217; blog post, I got all the scan functionality working, but even with other resources I haven&#8217;t yet figured out how to get the ADF button to trigger the scan. I&#8217;ve got the udev rules in place, everything should be running, but I still had to trigger the scan manually from the pi. Then I noticed that when I triggered the scan and nothing was in the scanner, it was a simple failure, no document detected or something like that. So I had a simple thought. I&#8217;ll just set up a cron job to run every minute and make an attempt to scan. If nothing&#8217;s in the feeder, no harm no foul, move right along. If so, scan that shit and send it to the Mayan EDMS share. Happy happy joy joy.<\/p>\n\n\n\n<p>So now I just drop a doc into the feeder, and within a minute it&#8217;s on its way to the EDMS. Exactly what I was looking for. New RPi 4 is on the way.<br><br>UPDATE: It was migrated to an RPi 4, and I changed the single cron job to do the scans to a collection of cron jobs that run every five seconds.<br><br>Since triggering a scan does nothing if there&#8217;s nothing in the feeder, I added a simple lockfile test to the scan job: If the lockfile exists, bail. If not, create the lockfile, attempt to scan, then drop the lockfile. That way if a new scan is triggered during an existing scan run, it will abort.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>* * * * * ( \/usr\/local\/bin\/scan.sh )\n* * * * * ( sleep 5; \/usr\/local\/bin\/scan.sh )\n* * * * * ( sleep 10; \/usr\/local\/bin\/scan.sh )\n* * * * * ( sleep 15; \/usr\/local\/bin\/scan.sh )\n* * * * * ( sleep 20; \/usr\/local\/bin\/scan.sh )\n* * * * * ( sleep 25; \/usr\/local\/bin\/scan.sh )\n* * * * * ( sleep 30; \/usr\/local\/bin\/scan.sh )\n* * * * * ( sleep 35; \/usr\/local\/bin\/scan.sh )\n* * * * * ( sleep 40; \/usr\/local\/bin\/scan.sh )\n* * * * * ( sleep 45; \/usr\/local\/bin\/scan.sh )\n* * * * * ( sleep 50; \/usr\/local\/bin\/scan.sh )\n* * * * * ( sleep 55; \/usr\/local\/bin\/scan.sh )<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I was about to pull the trigger on a network-enabled Fujitsu ScanSnap scanner, because I&#8217;ve been scanning on my Ricoh all-in-one that doesn&#8217;t do duplex, and I have a number &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/dc540.org\/xxx\/2020\/12\/network-scanner-on-a-budget\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Network Scanner on a budget&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":957,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1,32],"tags":[],"class_list":["post-956","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","category-professional-development"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/dc540.org\/xxx\/wp-content\/uploads\/2020\/12\/f88aa6fe_Fujitsu_ScanSnap_S1500M_2.jpg","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/posts\/956","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/comments?post=956"}],"version-history":[{"count":2,"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/posts\/956\/revisions"}],"predecessor-version":[{"id":1580,"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/posts\/956\/revisions\/1580"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/media\/957"}],"wp:attachment":[{"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/media?parent=956"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/categories?post=956"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/tags?post=956"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}