Convert Your Scanner to an IP Scanner with Raspberry Pi | Remote Document Scanning

Since version 16.1, Dynamic Web TWAIN (DWT) has added a remote scan feature. If there is a device running a background scanning service (Dynamsoft Service), other devices can access it via an Intranet to use scanners connected to that device, which makes it convenient to use mobile phones and tablets to scan documents.

Dynamsoft Service is the core piece of DWT when running in Service mode. It handles the communication between the hardware (scanner, webcam, etc.) and the browser, manages the image buffer, and coordinates data between different modules.1

Illustration of Remote Scan2:

The recently released Dynamic Web TWAIN v17 has added support for ARM Linux devices. The Dynamsoft Service can now run on devices like Jetson Nano and Raspberry Pi.

Here we will go through how to set up remote document scanning on Raspberry Pi step by step.

This article is Part 3 in a 3-Part Series.

What You Should Know About Dynamic Web TWAIN

Install Dynamsoft Service on Raspberry Pi

  1. Visit the online demo of DWT: https://demo.dynamsoft.com/web-twain/.
  2. You will be prompted to download and install the Dynamsoft Service.

    download_service_dialog

  3. Install the downloaded deb file with the following line:

     $ sudo dpkg -i DynamsoftServiceSetup-arm64.deb
    

Now you can scan documents from connected local scanners on Raspberry Pi.

Verify Local Service on Raspberry Pi

We can visit http://127.0.0.1:18622/ to see if the Dynamsoft Service is running or not. By default, the service is only accessible in the local network.

Set up Remote Scan on Raspberry Pi

To enable remote scan, we need to config Dynamsoft Service so that it is accessible in a shared network like an Intranet.

  1. Open its config file with nano:

     $ nano /opt/dynamsoft/DynamsoftService/DSConfiguration.ini
    
  2. Add this line to the file (you have to change the IP based on your own condition):

     Server=192.168.8.77
    

    The entire config file looks like this:

     [DS]
     CurrentSource=RlVKSVRTVSBmaS03MTYw
     DSVersion=1, 6, 2, 0112
     LogLevel=6
     Port=2
     Port_mn_0=dcp
     Port_mn_1=dwt
     Port_mp_0=18625
     Port_mp_1=18622
     ServiceName=Dynamsoft Service (64-bit)
     Server=192.168.8.77
     SSLPort=2
     SSLPort_mn_0=dcp
     SSLPort_mn_1=dwt
     SSLPort_mp_0=18626
     SSLPort_mp_1=18623
    
  3. Restart the Dynamsoft Service to make the modification effective:

     $ sudo systemctl restart dynamsoft.service
    

    Visit http://<Intranet ip>:18622/ to see if it is accessible.

Web Demo for Scanning Documents from Raspberry Pi Sidecar

There is a step by step guide on implementing remote document scanning in HTML5.

A pre-built demo is available for testing: Download. Here, we use the demo to test whether we can connect to a Raspberry Pi to perform remote scan.

Unzip the demo and under its folder, run an HTTP server using tools like Python:

python -m http.server

Then, we can take our phone out and visit http://<the web page host's ip>:8000/remotescan.html. We can now use our phone to acquire images from the scanners connected to the Raspberry Pi.

remote scan mobile

PS: If you haven’t enabled remote scan, you may encounter such an error:

service_not_available

Video

A video is made based on this article:

References

Search Blog Posts