Making a useful scanstation #136
nibblerrick
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I thought I could share my way how I made my scanstation with barcodebuddy as it is something which works but is definitively something which could be made better as I am not a programmer...
barcodebuddy runs on a virtual server so I couldn't connect directly a barcodescanner but thankfully there is a grabinput.sh in the examples so I thought I could make use of that.
Scanning without knowing what's happening isn't userfriendly so a screen should be there.
But having a screen sitting there forever just for scanning items sometime? When having some kind of smarthomeserver the rest of the time the screen could be used for that, I thought.
So my plan was: Using a raspberry pi with the official touchscreen attached so I have a nice compact unit to attach the scanner, have a screen for bbuddy and a touchscreen for checking and controlling homethings.
After discovering that loops in bash are some kind of tricky because some values couldn't be passed to the script which called them I just made use of cron...
So here is what I did:
Raspberry made ready for headless starting, starting X, start chromium without borders for the homecontrollingsoftware, chromium for bbuddy and an xterm for the modified grabinputscript (just
xterm -e /home/pi/grabinput.sh /dev/input/event0 &
in the autostart for X)the modified grabinput.sh script:
What this does is just taking the bbuddy-chromium to foreground and touching a file in /tmp.
The part of checking if the file is older than an hour (3600 seconds) just refreshes the bbuddypage because I sometimes had trouble that it lost the connection to the server. Maybe that isn't necessary anymore, I haven't tried.
Then I have a cronjob running every minute doing this:
Which switches the focus back to my homeautomationwebpage after a moment.
With this setup I have a useful screen for homecontrolling and for bbuddy without having to switch manually things around.
Besides that I used a motionsensor and an ssh-command to turn of the screen when nobody is there.
I think this implementation is far away from elegant but it works. I don't know if this is something which could be polished and put in the examples, too, or somewhere else.
Feel free to close the issue at it isn't really one and if I should put this somewhere else or can do something useful let me know.
Beta Was this translation helpful? Give feedback.
All reactions