Everything About DPT-RP1 When Using LINUX
source link: https://victrid.dev/2020/eadwux/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Intro
You can get official DPT-RP1 support while using Windows or MacOS. Sony has a well-designed software Digital Paper App, which supports everything in the user manual.
Unfortunately, Sony do not support Linux. And the program above cannot be started by wine, as DPT-RP1 is using some weird mechanics: (setting the device as an USB-network adapter and controling the IO by posting and getting files from a virtual web server hosted in DPT-RP1.) and adding virtual printer and device drivers, which is unable to be handled by Linux and wine.
Here we introduces a python command tool dpt-rp1-py to operate DPT-RP1 on Linux.
A New Method
If your device can connect to the same local network to your computer, you can just connect it and do as the original tool guide.
With mDNS query installed on your computer correctly, you can create an alias like dptrp1="dptrp1 --addr digitalpaper.local"
to speed up.
Install and Config
You can access the tool here. It supports pip3 so it can be installed easily by pip3 install dpt-rp1-py
.
However, in order to get the device work, you may need some technics which do not show in their homepage. Here is the extra step (it's also written in their docs).
-
install the pyserial. (You can set it up by
pip3 install pyserial
.) -
Plug in your device and create a python script file(we assume the filename is 'connect.py') and add these lines to the file.(You can download the file here directly.)
#!/usr/bin/python
#This is used for automatically setup DPT-RP1
#to usb-network, before python package dptrp1
#starts.
#2020 Feb 18 by VICTRID
#you should have dptrp1 and pyserial installed.
import serial
tty=serial.Serial('/dev/ttyACM0',115200)
tty.write(b"\x01\x00\x00\x01\x00\x00\x00\x01\x00\x04")
-
run the script with python. (You can type
python ./connect.py
or something like this. You can also edit the code if you know what you're doing.) -
De-activate DHCP on the new Ethernet device.
If you're using DHCP to obtain addresses, you should disable it for the DPT-RP1, since the DPT-RP1 does not run a DHCP server.
For example, if you're using Network Manager, change the IPv4 settings on the DPT-RP1 Ethernet device to 'Link-Local Only' instead of 'Automatic'. This will assign your end of the Ethernet link an IPv4 link-local address in the 169.254.0.0/16 range.
When using Network Manager, also make sure that in the 'Ethernet' tab, 'device' is set to the interface name, not the MAC address. This will help Network Manager to restore the settings when connecting next time.
- Determining the address for DPT-RP1. You may use your DNS lookup to find the address of
digitalpaper.local
. e.g. you can run this:
$ avahi-resolve -n digitalpaper.local
digitalpaper.local fe80::xxxx:xxxx:xxxx:xxxx
(if the system returns deamon not activated,
use your service controller to start it, e.g.
# systemctl start avahi-daemon
# service avahi-daemon start
)
- You need to get your device interface name. You may get it by
ifconfig
. It should beusb0
orenp0s20u1
or something. - Then your full address should be something like
[fe80::xxxx:xxxx:xxxx:xxxx%usb0]
, by adding the interface name after the address, separating by %.
dptrp1 do not support searching your device under linux directly, so you should run dptrp1 with an additional parameter --addr="[fe80::xxxx:xxxx:xxxx:xxxx%usb0]"
all the time (replace with your own address). You can add an alias like dptrp1USB="dptrp1 --addr=\"[fe80::xxxx:xxxx:xxxx:xxxx%usb0]\""
to the shell to simplify, as the ip address won't change normally.
Use the Tool
Every time you plugged your device onto your computer, you need to run the file connect.py
again to get your device responcing.
You may get usage by directly typing dptrp1 -h
. you should've got
usage: dptrp1 [-h] [--client-id CLIENT_ID] [--key KEY] [--addr ADDR] [--serial SERIAL]
{command-help,copy-document,delete,delete-folder,document-info,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,wifi-scan}
[command_args [command_args ...]]
Remote control for Sony DPT-RP1
positional arguments:
{command-help,copy-document,delete,delete-folder,document-info,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,wifi-scan}
Command to run
command_args Arguments for the command
optional arguments:
-h, --help show this help message and exit
--client-id CLIENT_ID
File containing the device's client id
--key KEY File containing the device's private key
--addr ADDR Hostname or IP address of the device. Disables auto discovery.
--serial SERIAL Device serial number for auto discovery. Auto discovery only works for some minutes after the
Digital Paper's Wi-Fi setting is switched on.
For some command, you can get additional help by calling dptrp1 command-help <command>
.
If you're connecting to the DPT-RP1 for the first time, you may need to register the device. The dptrp1 cannot search for your device under linux automatically, so you must do it by dptrp1 --addr="[fe80::xxxx:xxxx:xxxx:xxxx%usb0]" register
to register it. If your alias was set, you can just type dptrp1USB register
.
If you get an error, wait a few seconds and try again. Sometimes it takes two or three tries to work.
Remember that automatic searching is not suitable for linux USB connection, so it's a must to add the --addr="[fe80::xxxx:xxxx:xxxx:xxxx%usb0]"
parameter.
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
.
Postscripts
You may refer to the origin site for more advanced details, such as dptmount(experimental) to mount your device as a disk, or other interesting functions.
Recommend
-
47
I have a strange question for you. Has your system ever complained that you had no space left while you clearly still having more then enough? It happened to me, I had many GB left, but my Linux system complained that no...
-
15
Why you should migrate everything from Linux to BSD Posted on 2020-01-18. Last updated on 2020-01-20. As an operating system GNU/Linux has become a real mess because of the fragmented nature of the projec...
-
16
Vision Transformers for Dense Prediction This repository contains code and models for our paper: Vision Transformers for Dense Prediction René Ranftl, Alexey Bo...
-
4
Everything is on Scala using Play, Scala.js and ScalaCSS Reading Time: 2 minutesIn my previous post, I tried to create a
-
18
Vision Transformers for Dense Prediction This repository contains code and models for our paper: Vision Transformers for Dense Prediction René Ranftl, Alexey Bo...
-
7
What Are Environment Variables in Linux? Everything You Need to Know By David Delony Published 15 hours ago Set custom preference...
-
4
RP1: A Brief Introduction
-
2
LAXCUS分布式操作系统6.0 RP1版本发布 原创 LAXCUS分布式操作系统 2022-...
-
6
V2EX › Linux 求推荐, Linux 上好用的 类似 wox + everything 的组合
-
2
Raspberry Pi 5 and RP1 X-ray scans December 7, 2023...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK