HappyZ / dpt-tools

dpt systems study and enhancement
MIT License
564 stars 130 forks source link

I use linux. Do I have to let my CP1 connect to a WIFI ? #150

Closed linux40 closed 4 years ago

linux40 commented 4 years ago

I saw CP1 could make itself as a access point, so I let my computer connect to the WIFI CP1 provide. I used avahi-resolve to get the ip address of digitalpaper.local and verified this address and the port 8080 in browser while dpt-tools (with -ip x.x.x.x) just gave me the following messages:

! Err: did not find  or
[error] Cannot authenticate. Make sure your id, key, and ip addresses are correct.

Then I read the unofficial linux guidance and got that the guidance recommend me to let CP1 connect another WIFI. But I have to switch on Windows to achieve this because the connection need Digital Paper App. Is there any relevance between the error and the way my computer connect to CP1?

HappyZ commented 4 years ago

The error probably isn't because of IP but it cannot find id and key files on you computer. The id and key files are generated by DPA and to use it on a different computer, you'll need to copy the two files. Check https://github.com/HappyZ/dpt-tools/blob/7dc48f45bc746ee43f1dd781fc33e47949dd77bc/python_api/libDPT.py#L606

linux40 commented 4 years ago

Unfortunately, there is no way to get an id and a key of CP1 on linux. dpt-rp1-py does not work for CP1. Then I denoted that there is a digital paper app on android, and this app showed the id as a string of number, and the key displayed on CP1 is also a sequence of number. I saved these numbers in different file, and let dpt-tools connect CP1 again. This time, dpt-tools shows:

[error] https://x.x.x.x:8443/auth/nonce/xxxxxxx ## the number of id
[error] request error 404:
[error] * error_code: 40401
[error] * message: The designated resource was not found.
[error] cannot get nonce
[error] Cannot authenticate. Make sure your id, key, and ip addresses are correct.

What is the problem?

linux40 commented 4 years ago

Oh, I'm wrong. dpt-rp1-py does work for CP1, see this issue for more informations.

Then I found an excellent tutorial to make my CP1 connect to my computer via USB.

Finally, dpt-tools detect my CP1. Thank you.