Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Devices

Notices

Reply
 
Thread Tools Search this Thread
Old 10-07-2012, 07:16 PM   #1
mohataj
Junior Member
mohataj began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Oct 2012
Device: nook simple touch
Headless Calibre-Server enable "Wireless device connection"

I'm running calibre-server on a headless ubuntu server without X.
Is it possible to enable "Wireless device connection" to use it with Calibre Companion?
mohataj is offline   Reply With Quote
Old 10-08-2012, 03:06 AM   #2
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 8,887
Karma: 12755553
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
Quote:
Originally Posted by mohataj View Post
I'm running calibre-server on a headless ubuntu server without X. Is it possible to enable "Wireless device connection" to use it with Calibre Companion?
I'm going to guess the answer is no since it connects as a device and you need to still click the Send to device icon to use this feature.

Calibre Companion does have an option to connect to the content server, if this is what your running you should be able to connect to it via CC and download books to your Android device this way. It would have the added plus of being able to manage the books on your device also.
DoctorOhh is offline   Reply With Quote
 
Advertisement
Old 10-08-2012, 04:28 AM   #3
chaley
"chaley", not "charley"
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: 5,802
Karma: 1216080
Join Date: Jan 2010
Location: France
Device: Many android devices
To second DoctorOhh: there is very little point in providing the wireless connection in a headless client. Doing interesting things with a connected device requires talking to calibre's gui, because calibre is in charge of connected devices. It is true that certain automatic tasks such as reading list and news sync could happen without user interaction, but this is a rare case.

If you really want to enable the wireless driver on a headless client, then something like the following might work. I haven't tried it myself.
1. On a client with a "head", start calibre. Set all the parameters you like, including auto-start the wireless connection and (probably) the content server.
2. Copy the configuration directory to your headless server.
3. On the command line, start "calibre" (not calibre-server) using the command line option or env var that specifies the copied configuration.

This will work only if calibre believes that it is talking to a GUI. You are probably using xvfb to simulate a display. I have no idea if it also simulates a keyboard. In other words, I don't know if the calibre GUI will actually start on an xvfb configuration.

On the other hand, CC's content server integration should work fine with a headless server as long as the server is calibre 0.9.0 or better.
chaley is offline   Reply With Quote
Old 10-08-2012, 06:02 AM   #4
Adoby
Handy Elephant
Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.
 
Adoby's Avatar
 
Posts: 1,124
Karma: 5721184
Join Date: Dec 2009
Location: Southern Sweden, far out in the quiet woods
Device: Ubuntu Linux, Cybook Opus, Motorola Xoom with Mantano Premium
Another way could be to install X and Gnome or whatever, and control Calibre using the GUI from a VNC client on your Android device.

While CC is a great piece of software, I don't use it anymore since it requires me to operate both Calibre and CC at the same time. Instead I use a shared folder "in the middle" that I have Calibre sending books to, as a device, and have my tablet syncing with that folder over wifi.

Last edited by Adoby; 10-08-2012 at 06:13 AM.
Adoby is offline   Reply With Quote
Old 10-09-2012, 01:25 AM   #5
ellett
Connoisseur
ellett began at the beginning.
 
Posts: 50
Karma: 10
Join Date: Feb 2011
Device: Android
With the recent addition of a robust content server interface there is no need to connect your device using CC and then go back to Calibre to push books, unless you've added hundreds of books to your calibre library.

Fire up CC on your device, connect to content server, and then select the books you want to download to your device.

There is also added functionality if you connect from CC as a wireless device.

If you haven't used CC for the last couple of weeks you should really fire it up and check out all the new stuff. Just make sure you upgrade both calibre and CC to their current incarnations.

Maybe one day Charles will take a break from adding even more magical features and turbo-boosting performance and will update the FAQ to reflect all the recent goodness:-)
ellett is offline   Reply With Quote
Old 10-10-2012, 02:05 PM   #6
Bari10
Junior Member
Bari10 began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Oct 2012
Location: UK
Device: Sony PRS-T1
I agree with the OP and have the same request. It is NOT crazy (well, not very crazy) to wish to use wireless connection with a headless server, mainly because of the existence and rapid improvement of CC (Calibre Companion) on android devices. I want to do this, using a headless very low power Dreamplug machine (running debian GNU/Linux) which I'm content to leave running 24/7.

The point is that Calibre already includes excellent command line commands and options for this sort of use. For example, if I use the command calibre-server on my little linux box, the calibre server is started, and I can use one of my (e-)readers to browse the OPDS catalogue and read or download books from the linux machine. And I can lave the content server running all the time if I wish.

What the OP and I want to know is, whether there is a command line command to start the wireless device connection server in a similar way, and if so, what it is.

As an aside, I could in the past run the calibre GUI from the linux machine by connecting in with ssh -X (allowing X forwarding) from eg a laptop. For some reason (probably my fault), this doesn't seem to be working in my current configuration; and besides, it's much less use than a command line method, because one would have to keep the laptop running to keep continual availability of the wireless device connection.

I hope my explanations reveal how much I value Calibre, and my hopes for Calibre Companion. Many thanks to all involved in these great projects.

Barry
Bari10 is offline   Reply With Quote
Old 10-10-2012, 02:42 PM   #7
chaley
"chaley", not "charley"
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: 5,802
Karma: 1216080
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by Bari10 View Post
I agree with the OP and have the same request. It is NOT crazy (well, not very crazy) to wish to use wireless connection with a headless server, mainly because of the existence and rapid improvement of CC (Calibre Companion) on android devices. I want to do this, using a headless very low power Dreamplug machine (running debian GNU/Linux) which I'm content to leave running 24/7.
I really don't understand the point.

Calibre's device subsystem is part of calibre's gui. When a device connects, the gui changes to give access to books on the device, to send books to the device, etc. The device is totally passive.

Making the assumption that calibre's architecture does not change, what would you do after connection? The server is headless, so you can't talk to the gui to do "things". The device is passive, so it can't do anything. What is the point of the connection?
Quote:
The point is that Calibre already includes excellent command line commands and options for this sort of use. For example, if I use the command calibre-server on my little linux box, the calibre server is started, and I can use one of my (e-)readers to browse the OPDS catalogue and read or download books from the linux machine. And I can lave the content server running all the time if I wish.
CC can talk to a headless content server. I recognize that we don't permit specifying two machine addresses, one for wireless connection and one for the content server, but this shouldn't matter if the headless server is on the local network.
Quote:
What the OP and I want to know is, whether there is a command line command to start the wireless device connection server in a similar way, and if so, what it is.
No, because as mentioned above, the device subsystem is part of the gui. The wireless device cannot start if the gui is not running. Of course, as adoby says the gui could be running a VNC framebuffer, but if this is the case then the gui can be used to start the wireless device.

I am not trying to be difficult. I just don't understand the rationale and use case for starting the wireless device on a true headless server. If devices were to be made active (able to start calibre device operations), then I could see it, but that level of architectural change isn't on anybody's todo list.
chaley is offline   Reply With Quote
Old 10-10-2012, 06:15 PM   #8
Bari10
Junior Member
Bari10 began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Oct 2012
Location: UK
Device: Sony PRS-T1
Ok, thanks for the conversation. Maybe I've misunderstood the likely direction of travel of Calibre Companion (and maybe Calibre itself).

On https://play.google.com/store/apps/d...calibreandroid I read:
"The first application: Calibre Companion supports connecting to calibre over WiFi and be detected by calibre as a device.
...
- Calibre Companion can update the metadata for the books on every connect, ensuring the information is up to date."

This does not sound to me as if "the device is totally passive" as you say. I assumed it was indicative of the likely kinds capabilities that Calibre Companion might develop. Also, the command line capabilities of Calibre (http://manual.calibre-ebook.com/cli/...ented-commands) show that Calibre can add books to its library, convert books between formats and do other things, all without the GUI running - so why couldn't a device activate such processes, as I gather it can already (via Calibre Companion) alter metadata on the server?

This is all pretty standard client-server thinking: there is no "rule" that says that all activities carried out on a server have to be initiated by a GUI running on the server. And as the Calibre content server already shows, devices can initiate useful interactions such as downloading a version of a book.

Android and similar devices are much more general purpose than a dedicated e-reader. It would be a shame to limit the ambitions of what they might be used for.

Last point (this time around): starting up the Calibre content server can be done (via command line) without running the GUI. So can adding a book to the library. Why shouldn't it be possible to start the wireless device connection (to the library) without having the GUI running, and initiate transfers, conversions and so on? I gather from you that "the device subsystem is part of the GUI", which I hadn't appreciated - but I don't see that has to be so.

Of course "you can call me a dreamer..."

Barry
Bari10 is offline   Reply With Quote
Old 10-10-2012, 07:21 PM   #9
ellett
Connoisseur
ellett began at the beginning.
 
Posts: 50
Karma: 10
Join Date: Feb 2011
Device: Android
Why can't you connect to your linux server using X Window, start calibre and configure it, including starting the content server and wireless, and then disconnect the X Window session?

Also note that when you activate both the content server and the wireless connection, you can specify that they start whenever calibre starts, so the GUI action only needs to be taken once.

And finally there's getting into the config files. I know that in gui.py there's an "autolaunch server" that can be set to "True" to automatically start the content server and content server configuration information is set in tweaks.py and server.py. Maybe a developer can point to where the wireless connection configuration and activation switch are stored.
ellett is offline   Reply With Quote
Old 10-11-2012, 03:40 AM   #10
chaley
"chaley", not "charley"
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: 5,802
Karma: 1216080
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by Bari10 View Post
Ok, thanks for the conversation. Maybe I've misunderstood the likely direction of travel of Calibre Companion (and maybe Calibre itself).

On https://play.google.com/store/apps/d...calibreandroid I read:
"The first application: Calibre Companion supports connecting to calibre over WiFi and be detected by calibre as a device.
...
- Calibre Companion can update the metadata for the books on every connect, ensuring the information is up to date."

This does not sound to me as if "the device is totally passive" as you say.
In this case calibre is sending metadata to the device, "ensuring the information [on the device] is up to date". The device plays almost no role in this other than to conform to the protocol and operation sequence that calibre requires. I can assure you of this, as I wrote the code on both sides of the connection (calibre and CC) for this process.
Quote:
I assumed it was indicative of the likely kinds capabilities that Calibre Companion might develop. Also, the command line capabilities of Calibre (http://manual.calibre-ebook.com/cli/...ented-commands) show that Calibre can add books to its library, convert books between formats and do other things, all without the GUI running - so why couldn't a device activate such processes, as I gather it can already (via Calibre Companion) alter metadata on the server?
Of course it "can". It is just simple matter of programming. Unfortunately, calibre's current device architecture precludes this.
Quote:
This is all pretty standard client-server thinking: there is no "rule" that says that all activities carried out on a server have to be initiated by a GUI running on the server.
You are correct, and if calibre had a client/server architecture than we could do what you suggest. Developing a C/S model for caliber is a long-running background project that will produce results eventually, but we are not there today.
Quote:
And as the Calibre content server already shows, devices can initiate useful interactions such as downloading a version of a book.
You won't get any argument about that. It would be very nice to have a full calibre client available my devices, along with everything that implies (simultaneous read/write, single database, single library, etc). However, and at the risk of beating a dead horse, the current calibre architecture doesn't support it.
Quote:
Last point (this time around): starting up the Calibre content server can be done (via command line) without running the GUI. So can adding a book to the library. Why shouldn't it be possible to start the wireless device connection (to the library) without having the GUI running, and initiate transfers, conversions and so on? I gather from you that "the device subsystem is part of the GUI", which I hadn't appreciated - but I don't see that has to be so.
No, it doesn't have to be so, but it is so. The amount of work to change to a CS model is enormous. Couple that with the fact that there aren't very many of us working on calibre and all of us have higher priorities, and the work doesn't move along quickly.

Kovid has built the framework for the server side (a server-based DB). I am sure he would be delighted if you or any one else decided to finish it, or even move it along. Once that is reliable, then the work would begin to separate the gui and the command line tools into a "client", with a well-defined and enforced interface to the server. I know a fair amount about calibre's code, and the biggest problem here is data integrity and transaction validation, determining how to detect that the data held by the client does not match what is currently held by the server and recovering from it. Once that is done, then other clients can be considered, such as smart devices, ajax/html5, etc.
chaley is offline   Reply With Quote
Old 10-11-2012, 05:31 AM   #11
Bari10
Junior Member
Bari10 began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Oct 2012
Location: UK
Device: Sony PRS-T1
Thanks, chaley, for the clarifications.

Nothing I've written should be taken as criticism. I hope I've been clear that I have great admiration for people's achievements with Calibre and Calibre Companion, especially in the areas of functionality and user experience. I was mostly concerned to address points like "no, of course you can't do that" or "why (on earth) would you want to do that?".

My interpretation of the OP's question, as "What is the command line calibre command to start up the wireless device connection?" has been answered and explained, as "There isn't one, at least not yet", along with some useful suggestions and comments.

Thanks again. (Response to ellet to follow.)

Barry
Bari10 is offline   Reply With Quote
Old 10-11-2012, 06:39 AM   #12
Bari10
Junior Member
Bari10 began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Oct 2012
Location: UK
Device: Sony PRS-T1
Thanks, ellet, for the suggestions.

Geek warning: the following will probably be of interest only to those of certain kinds of disposition.

I don't run an X server on my arm box (currently a Dreamplug) - too wasteful of resources. Instead, it has the minimum necessary to allow connection from a machine (with a display and kbd) running an X server, using ssh -X, with X forwarding - so e.g. the calibre gui will appear on the connecting machine's display. Contrary to what I said in one post above, this does current work well (but there's sometimes a weird effect apparently when trying to set up a second X fwding after closing down a first, within a single ssh session - getting the response "cannot connect to the display localhost:10.0" - I don't at present understand this, but renewing the ssh connection solves it).

In this context, I can't really "disconnect the X window session" as you suggest, since the calibre process is a child of the ssh terminal session - and e.g. shutting down the connecting machine kills that, of course.

However, as they say, we have tools for this kind of situation. Enter GNU screen. Within an ssh connection to the dreamplug, I start a screen session; fire up calibre (gui) within it; detach (^a^d) from the screen session - and the gui keeps running; start up the wireless device connection from the gui, and e.g. connect to it from an android device. Now I terminate the ssh connection. Most programs will continue running within the detached screen session. Unfortunately, the calibre gui terminates itself when the ssh connection disconnects - presumably, and not unreasonably, because it finds itself unable to write to the X server.

So, at the moment, I'm out of ideas about how to pursue your suggestions, unless I install a dummy X server on the dreamplug - but then I've no idea, without a command line command or option, how to kick it to initiate the wireless device connection - except perhaps via your "autostart" suggestion, which might work. But I'm a bit reluctant (maybe unreasonably) to load the dreamplug with continuous running of a really unnecessary set of X server processes. You should see how slowly the calibre GUI runs on it with X fwding! (Usable, but only just - the price of very low power consumption.) In contrast, the content server runs perfectly acceptably.

Thanks again for your suggestions - but chaley's point that, at present, the device connection system is a subsystem of the GUI, really pretty much kills a rational client-server type approach to this (it seems to me).

Barry
Bari10 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Nexus 7, Chrome, canoot "see" Calibre content server goglen Devices 6 08-28-2012 06:25 AM
What is the difference: content server v wireless device connection BeccaPrice Calibre 8 08-23-2012 05:35 PM
"Settings," then "311" - Int'l Kindle searches for wireless providers in the area Dr. Drib Amazon Kindle 2 08-28-2011 11:27 AM
Whimsical IPAD-Calibre/"content server"! lsalterid Devices 5 05-06-2011 11:47 AM


All times are GMT -4. The time now is 07:25 PM.


MobileRead.com is a privately owned, operated and funded community.