24/06/2021If you have a "Tea" brand e-reader (Vivlio), Inkpad or Touch HD model, here is a way to synchronize it with a personal server.
It is advantageous to synchronize an e-reader automatically with a directory, so as not to perform the operations of transferring files and deleting the books read on the e-reader, but from a computer, for reasons of ease of handling.
However, some e-readers only provide synchronization services with systems owned by companies (Dropbox, PocketBook cloud, etc.), and not with a personal server.
The program I propose here allows you to synchronize your e-reader using the WebDAV protocol from a Synology NAS (but is of course reproducible from any server using this protocol, with NextCloud, Owncloud...). I was inspired by Loriowar's webdav_sync.sh script. It did not work on my eReader but I took the idea and improved how it works. It already made it possible to:
- Copy files from a server, reducing the flow to the differential of files to send
- Switch WI-Fi on / off if it is detected as inactive
It now allows you to:
- Synchronize the modification dates of downloaded files
- Purge (optionally) local files that are no longer present on the server and empty directories
- Avoid synchronizing the Trash directory
- Give more feedback to the user (log file, error messages ...)
Show a progress bar(unfortunately not implemented to date but if anyone sees how to do it, I'm a taker)- Offer to synchronize only certain extensions
Configuring WebDAV server on Synology
Installing WebDAV
- Open the Package Center
- Search on the term "webdav". The "WebDAV Server" package is showed :
![]()
- Click on Install
- Once the installation is complete, open the software :
- Check Enable HTTP and click onApply
The access mode presented here should only be used on a local network . It will be blocked from the Internet anyway, unless you redirect the ports of your box.
Creation of a dedicated folder
- Go to the control Panel
- Choose Shared folder
- Click on the Create button.
- On the screen that appears, enter a share name (for example "webdav")
- Click Next
- On the encryption page, click Next
- Then validate the creation by clicking on Apply
Creation of a dedicated user
It is recommended to create a user dedicated to the use of this service, in order to limit the exposure of shared data
- Open the control pannel
- Go to User
- Click on the Create button
- Fill in the name, description and password of the new user
- In the User groups tab, choose users
![]()
- In the Permissions tab, choose the created folder (here webdav) and check read only
- In the Applications tab, authorize WebDAV Server
![]()
- Validate all the parameters by clicking on the OK button
Once WebDAV access has been prepared, you can drop an EPUB or a PDF file there, which you can use to test the synchronization.
Test access to the Webdav server
With a software like Cyberduck, you can check that your access to the Webdav server is functional.
![]()
Then go to the next step, which is to install the program on the eReader.
Installing the program on the e-reader
Script settings
- Download the following program: synchro_webdav.app(12 Ko)
- Edit it with a text editor, like Notepad ++ (this is a shell script)
- At the beginning of the program, you will see several parameters, which you must modify to adapt it to your configuration:
# -- Serveur / server
PROTOCOLE=http
HOST=192.168.0.1 # IP of webdav server
LOGIN=login
PASSWORD=pass
PORT=5005
SERVER_ROOT=webdav # Folder name
SERVER_SUBFOLDER=Eric # Subfolder name on server (can be empty), usefull for accounts
EXTENSIONS=pdf,epub,cbr,cbz,txt,mobi,fb2,htm,html,doc,mp3,m4b,docx,jpg,jpeg,png,tiff,prc
# -- Local
SYNCHRO_SUBFOLDERS=true # Apply on subfolders
DELETE_UNMATCHING_LOCAL_FILES=true # Delete files no more present on server
LOCAL_FOLDER=/mnt/ext1/Livres/Synchro # Destination folder (will be created if not exists)
# -- Script
LANGUAGE=english # french or english
- HOST / PORT: local address of your NAS server
- LOGIN / PASSWORD: user account you created on the NAS
- SERVER_ROOT: name of the shared directory on the NAS
- SERVER_SUBFOLDER : subfolder on the NAS (can be empty if unused)
- SYNCHRO_SUBFOLDERS: indicates if the script also synchronizes the subdirectories of the server. If you have created a lot of subdirectories, the script will query each of them separately, which is detrimental to performance.
- DELETE_UNMATCHING_LOCAL_FILES: will delete local files not present on the server, in the synchronized directory of course
- LOCAL_FOLDER: local directory on the reader. It must start with / mnt / ext1 for internal memory and / mnt / ext2 for an SD card.
- LANGUAGE: language of the messages. Choose french or english
- E_READER_VERSION: use or not the dialog windows specific to the reader (debug usage)
- LOG_FILE: path and name of the log file
- Save everything when you're done.
Sending the script to the e-reader
- Connect your e-reader to the computer via USB
- Open an explorer, go to the reader of the e-reader then in the applications directory
- Drop the synchro_webdav.app script there
- Disconnect your eReader from the computer
Running the script
- Go to the Applications menu
- At the bottom of the screen, in the User menu, a new icon should automatically appear: @synchro_webdav
- Tap on this icon to launch the program
- At runtime, if all goes well, you should get a message "Connecting to server 192.168.0.1"
- Then the message "X files found. Synchronizing local files..."
- After a few seconds or minutes (depending on the number of files you have uploaded to your WebDAV server), a message indicating that synchronization is complete should appear.
- Only modified files are uploaded. Thus, if you modify the shared directory a little, the next synchronizations will be faster.
Last modifications
- 12/2022 - In the case where several people have an e-reader in the household, I added the parameter SERVER_SUBFOLDER, allowing to indicate a sub-directory of the server to be used as root. Thus each user can have his server sub-directory synchronized with his e-reader, and copy books easily from one e-reader to another.
Dernière modification le 12/12/2022 - Quillevere.net