Python package to manage a Sony DPT-RP1
Project description
dpt-rp1-py
Python script to manage Sony DPT-RP1 without Digital Paper App. This repository includes a Python library and a command line utility to manage documents on the DPT-RP1. Tested on Windows, Linux, and macOS.
Install
To install the library run python3 setup.py install
or pip3 install .
from the root directory. To install as a developer use python3 setup.py develop
(see the setuptools docs) and work on the source as usual.
Installing the package also installs the command line utility called dptrp1
.
Using the command line utility
dptrp1 command [arguments]
To see if you can successfully connect to the reader, try the command dptrp1 list-documents
. If you have Sony's Digital Paper App installed, this should work without any further configuration. If this fails, register your reader with the app using dptrp1 register
.
Supported commands
You can get a list of the implemented commands by running dptrp1
with no additional arguments. Supported commands include command-help, copy-document, delete, delete-folder, download, list-documents, list-folders, move-document, new-folder, register, screenshot, sync, update-firmware, upload, wifi, wifi-add, wifi-del, wifi-disable, wifi-enable, wifi-list, and wifi-scan.
For some command, you can get additional help by calling dptrp1 command-help <command>
, e.g. dptrp1 command-help sync
.
Note that the root path for DPT-RP1 is Document/
. Example command to download a document file.pdf
from the root folder ("System Storage") of DPT-RP1: dptrp1 download Document/file.pdf ./file.pdf
. Example command to upload a document file.pdf
to a folder named Articles
on DPT-RP1: dptrp1 upload ./file.pdf Document/Articles/file.pdf
Registering the DPT-RP1
The DPT-RP1 uses SSL encryption to communicate with the computer. This requires registering the DPT-RP1 with the computer, which results in two pieces of information -- the client ID and the key file -- that you'll need to run the script. You can get this information in three ways.
Registering without the Digital Paper App
This method requires your DPT-RP1 and your computer to be on the same network segment via WiFi, Bluetooth or a USB connection. The USB connection works on Windows and macOS but may not work on a Linux machine.
dptrp1 register
The tool can generally figure out the correct IP address of the device automatically, but you may also specify it with the --addr <address>
option. If you're on WiFi, go to Wi-Fi Settings on the device and tap the connected network to see the device's address. If you're on Bluetooth, it's likely 172.25.47.1. You can also try the hostname digitalpaper.local. Use the register command like seen below, substituting the IP address of the device.
dptrp1 --addr 10.0.0.1 register
If you get an error, wait a few seconds and try again. Sometimes it takes two or three tries to work.
FUSE mount
This Repository contains a dptmount
script to mount the Digital Paper as a userspace mount. This tool has additional requirements.
- On macOS, install osxfuse (e.g. with
brew cask install osxfuse
). - On Linux, you may need to install libfuse.
How to use
Create a yaml file with configuration details at ~/.config/dpt-rp1.conf. You must specify either an address (with addr) or a Device ID (with serial). Everything else is optional. All entries must be strings, the serial number must be wrapped in quotation marks.
dptrp1:
addr: 192.168.0.200
serial: "50040222"
client-id: ~/.config/dpt/deviceid.dat
key: ~/.config/dpt/privatekey.dat
Mount the Digital Paper to a directory with dptmount /my/mountpoint/
.
Finding the private key and client ID on Windows
If you have already registered on Windows, the Digital Paper app stores the files in Users/{username}/AppData/Roaming/Sony Corporation/Digital Paper App/. You'll need the files deviceid.dat and privatekey.dat.
Finding the private key and client ID on macOS
If you have already registered on macOS, the Digital Paper app stores the files in $HOME/Library/Application Support/Sony Corporation/Digital Paper App/. You'll need the files deviceid.dat and privatekey.dat.
What works
- Reading files
- Moving files (both rename and move to different folder)
- Uploading new files
- Deleting files and folders
What does not work
- Currently there is no caching, therefore operations can be slow as they require uploading or downloading from the device. However, this avoids having to resolve conflicts if a document has been changed both on the Digital Paper and the caching directory.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.