📜 ⬆️ ⬇️

Trolley Scanner

From the first to the thirteenth with songs, jokes, dances ...
What else to do something from the first to the thirteenth?
Accident

Corporate parties died down, and the New Year inexorably approached. We did not make an exception and arranged a corporate party with traditional libation in Maximilians . After it, the techies of the company decided that the celebration did not have enough IT, and the second one was held - IT - corporate with the use of X-Box 360, Kinect and meter TV. During his time many funny and, most importantly, realizable ideas came to mind. Perhaps only those who have ever used Kinect can truly appreciate them.

One of the thoughts was to build some unusual and useful unit with the possibility of daily use.
')
Remembering the recent adventures with scanning of something and running around the cabinets, we decided to make our scanner more mobile.

Under this case, an audit of the "pieces of iron" was made.

Found:
Intel DN2800MT
2 x SO-DIMM DDR3 4Gb Patriot
OCZ mSATA SSD 60Gb
ASUS 19V laptop power supply (now replaced with a less powerful FPS)
D-Link DWA-125
HP ScanJet G2410 Scanner
Office chair on wheels with back support broken off by supporters.

Of the necessary tools available were used Zalman VE200, Debian 6.0.5 amd64 netinst option in the form of iso, usb-keyboard, ethernet patch cords, Olympus FE-115.

The tenth seems to have nothing to do ...
Fine! Tenth treat liver
Accident

Putting it all together and we get something like this:

image

The design is absolutely silent after installing Debian on an SSD and disabling the VE200.

Debian set in the minimum version + ssh (it will be needed for the second / spare / direct access to the scanner).

Now let's prepare Debian for working with ssd in read-only mode. Since the “cart” is a mobile unit, it will be completely uninteresting to restore the fs.

For os to work, you will need an entry in / tmp, / var / tmp, / run, and all sorts of / var / * (such as lock and log). Let's transfer them to memory.

cd / var rm -rf tmp run lock log ln -s / dev / shm ln -s / dev / shm lock ln -s / dev / shm run ln -s / dev / shm log
cd / etc / network rm -rf run ln -s / dev / shm run
cd / var / lib rm -rf urandom ln -s / dev / shm urandom


Disable unnecessary to us, but enabled by default services:

update-rc.d cron remove
update-rc.d exim4 remove
update-rc.d nfs-common remove
update-rc.d port map remove


In order to be able to use the directories transferred to the memory, you need to create directory structures there every time you boot. We do this through the initd script /etc/init.d/tmpfs, incl. and for not really necessary directories.

#! / bin / bash

### BEGIN INIT INFO
# Provides: tmpfs
# Required-Start:
# Required-Stop:
# X-Stop-After: sendsigs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
### END INIT INFO

mount tmpfs -t tmpfs / tmp
cd / tmp
mkdir exim4 sshd log
chmod 750 exim4
chown Debian-exim: Debian-exim exim4
touch utmp
chmod 660 utmp
chgrp utmp utmp

cd log
mkdir apt exim4 fsck installer news
chmod 2750 exim4
chown Debian-exim: adm exim4
touch dmesg wtmp lastlog
chmod 660 wtmp lastlog
chgrp utmp wtmp lastlog

exit 0


And connect it to the download:

chmod 755 /etc/init.d/tmpfs
update-rc.d tmpfs defaults


Now you need to add / tmp to / etc / fstab.

echo "tmpfs / tmp tmpfs defaults 0 0" >> / etc / fstab


Since there will be no logs in case of anything, you can configure remote logging just in case:

echo "*. *; auth, authpriv.none @ 10.0.0.21" >> /etc/rsyslog.conf /etc/init.d/rsyslog restart


Here 10.0.0.21 is the IP address of the server that receives our logs.

Rebooting ... Editing mount parameters / to noatime, ro.

sed -ir 's / \ / \ s + ext4 \ s + defaults / \ / ext4 noatime, ro /' / etc / fstab


And we got a device that is not afraid of a sudden power outage and loads in 20 seconds. But we do not need it faster.

Now let's do the actual scanner. Install the required package, enable autorun and add the network for which it will work:

aptitude install -y sane
sed -i 's / RUN = no / RUN = yes /' / etc / default / saned
echo "10.0.0.0/24" >> /etc/sane.d/saned.conf


The HP 2400 is not supported in sane, and in Debian there is nothing for it. But there is such a repository for Ubuntu. Connect it to our cart:

echo "deb ppa.launchpad.net/lion-simba/hp2400/ubuntu karmic main" >> /etc/apt/sources.list
aptitude update


Install the found hp2400 packages:

aptitude install -y libsane-hp2400x64 xsane


The scanner is ready. Check:

# scanimage -L
device `net: 10.0.0.3: genesys: libusb: 004: 002 'is a Hewlett Packard ScanJet 2400c flatbed scanner


Here 10.0.0.3 is the IP of the trolley over the wired network.

Now we will make the cart a little more mobile. To do this, connect to the network via wifi, especially since we have a DWA-125.

aptitude install -y wireless-tools firmware-ralink wpasupplicant

In / etc / network / interfaces we enter the following to assign a static IP address:

auto wlan0
iface wlan0 inet static
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
address 10.0.0.241
netmask 255.255.255.0
gateway 10.0.0.1
dns-nameservers 10.0.0.1 10.0.0.2


The gateway and DNS, of course, you can not specify, but what if you need to update or deliver something?

At the same time, do not forget to remove allow-hotplug eth0 or auto eth0 from the same config:

sed -ir 's / allow-hotplug eth0 //' / etc / network / interfaces
sed -ir 's / auto eth0 //' / etc / network / interfaces


Since the wifi network is WPA, we also need the config for wpasupplicant that we already referred to: /etc/wpa_supplicant/wpa_supplicant.conf:

ctrl_interface = / var / run / wpa_supplicant
ctrl_interface_group = root
network = {
ssid = "our point"
key_mgmt = WPA-PSK
psk = "our key"
}


Eleventh solve the problem
How not to go to friends to the country.
But still going. The result is known:
Including the twelfth smoked up.
Accident

Now let's make our cart physically mobile. First, take a chair, unscrew the knobs and fastening screws from it, open and evaluate the interior space:

imageimageimage

More than enough space to accommodate the mATX board, power supply, a pair of cords, and a wifi usb card. But contacts with the board should not touch the metal parts of the chair. To do this, rummaging in the closets, we find something that can be used for fastening to a chair and as racks for the board.

image

And it turned out well:

imageimageimage

The assembled chair looks quite natural:

image

But if to glance from below, high technologies become noticeable.

imageimageimage

Then we will put the scanner on top, but first you need to resolve the issue of nutrition. The extra UPS was not at hand, so we decided to use a regular electric extension cord for 3 seats. The length of the cord is more than 10 meters, which again gives tangible mobility. The extension cord is attached to the chair with plastic ties.

imageimageimage

Here is the complete version of the “scanning trolley”.

image

As a final hooliganism, a shredder was hoisted on the same construction. Scanned the document and immediately destroyed without departing from the cash register.

image


How do you want to work!
To the machine, to the counter, anywhere!
Accident

Happy holidays! Hope you smiled reading this.

image

Source: https://habr.com/ru/post/166557/


All Articles