A recent commit integrates my pull request to incorporate scanbuttond into freetz, a custom firmware for Fritz Box 7390. scanbuttond's job description is, to trigger a script whenever a button is pressed on a scanner. This is all I need in order to turn my 7390 and an old (three button) USB scanner into an always on snail mail to email converter (think paperless office). Once a freetz image with scanbuttond & sane for your scanner model has been backed, “sane-find-scanner” is uncommented in the upper box on the freetz webfrontend. The script below is pasted into the lower “Script for button” box (adapt the email addresses EMAIL_* accordingly). If you find that you cannot paste it directly, insert the script into /mod/etc/conf/scanbuttond.cfg via ssh/telnet.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
|
The following finite state machine/automata shows how the buttons are programmed:
If you occasionally find yourself forgetting to press the end button (#3) after the last page has been scanned, using cron to periodically check for stale tmp/ folders does the job for you. Assuming crond is part of your freetz image, just add a the following line on the crond webfrontend.
*/45 * * * * if [ `find /var/media/ftp/tmp/scans/ \
-iname *.pnm -type f -mmin +15 2>/dev/null | wc -l` -gt 0 ]; \
then /var/mod/etc/scanbuttond/buttonpressed.sh 3; fi