View Single Post
Old 08-23-2017, 05:01 AM   #19
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Wryhder View Post
Hello.
I've got the files.
There's something about a 'port 54982'.
The device debug log tells us what you already said, there isn't another device interfering with CC connecting.

The debug log tells us that CC is able to ask calibre if it is there. The sequence that CC uses is:
  • Broadcast on the network to see if there is an instance of calibre there.
  • Calibre answers (we hope)
  • CC connects to the IP address that calibre supplies
We see that calibre did see the broadcast and did (try to) answer. We know from the CC debug logs that CC receives that answer. The relevant lines in the log look like this:
Code:
SMART_DEV (  39.22: 37.046) run received broadcast ('localhost', ('192.168.0.101', 54982)) calibre wireless device client (on XXXXX);8080,9090
What we do not see is calibre accepting the connection from CC. That implies (strongly) that something on your laptop is blocking incoming connections on port 9090. It could be the wireless router, but that would require some strange firewall rules on the router. If you have set up any port forwarding rules on your router you might want to take a look at them to see if any of them apply to port 9090.

One way to test the above hypothesis - that something is blocking incoming connections - is to connect to calibre using a web browser. It would be 2-step test. The first step is to connect from the localhost -- the laptop itself -- to avoid the router and the incoming firewall. Open a web browser on the laptop and connect to 127.0.0.1:9090. When I do that on my laptop I get the following lines in the calibre debug log, which up to the last line are what should appear when CC connect.
Code:
SMART_DEV (  15.14: 13.011) run attempt to open device socket
SMART_DEV (  15.18:  0.034) open
SMART_DEV (  15.19:  0.001) _call_client GET_INITIALIZATION_INFO wfr True
SMART_DEV (  15.21:  0.006) _receive_from_client protocol error -- empty json string
SMART_DEV (  15.23:  0.000) _call_client other exception
If this doesn't work then the blockage is at the socket level. It could mean that something else has force-opened the port 9090, that the firewall blocks all connections regardless of whether they are local, or who-knows what.

Assuming that the first step works, the second step is to try the same thing from the web browser on your device. Open that browser and connect to 192.168.0.100:9090. You should see exactly the same messages in the debug log.

If connecting from your device using the web browser generates those lines then the only possibility left is that something in calibre is preventing the wireless device driver from "seeing" the connection request in the 5 seconds that CC is willing to wait. If this is the case I could give you a version of CC that waits for much longer, say 30 seconds, to see if the problem is simply one of time. We will cross this bridge when we come to it.

If the first step does not work then one possibility is to change CC's port to something way up in the not-normally-used range, for example 42876, then try the same steps. You change CC's port by stopping the wireless device driver (calibre / Connect/Share) then starting it again. You will see a dialog where you can set the port.

BTW: the Similar Stories plugin you have installed is broken. I is still using the old version of the graphic toolkit QT.

I wonder what all those XmbTextListToTextProperty result code -2 lines are, and what side effects, if any, the error might have.
chaley is offline   Reply With Quote