Bosse_B
Posts: 981
Joined: Thu Jan 30, 2014 9:53 am

Print server on Pi has long connect delay

Wed Feb 11, 2015 8:48 am

I have configured my Pi model B running Raspbian to act as a printer server on the home network. The printer is a USB connected HP Color Laserjet CP1215 and to make the Pi work as a print server I installed CUPS. The Pi printer is shared via samba on the network with basically no restrictions for usage. The computers using the printer run Windows 7.

All of this works fine except for one very annoying thing:
Whenever I or my wife needs to print there is a 25-30 second delay during which the Windows 7 application more or less becomes unresponsive. As soon as this connection has been established everything is back to normal again and we can repeat printing without this delay unless we wait some time (uncertain of the length of this) after which the delay appears again.

My feel is that somehow the printing subsystem on the Pi is not really running all the time and needs to be loaded when a client requests service. The load may require some extra actions, I don't know, which takes the long time.

So my question is really what I can look for in Raspbian, samba or CUPS to pinpoint what is going on that causes the delays?
Is there some way to make the Pi not to unload the service after some idle time? (If that is what happens)

Regarding samba I just tested to enter \\raspbian-pi in Windows explorer and after about 6-8 s the existing shares and the printer appear in the Explorer pane. Slow but nowhere near 25-30 seconds.

Yesterday I even did an apt-get upgrade in order to see if a newer Raspbian would help, but it did not...

Any ideas???
Bo Berglund
Sweden

Bosse_B
Posts: 981
Joined: Thu Jan 30, 2014 9:53 am

Re: Print server on Pi has long connect delay

Wed Feb 11, 2015 10:26 pm

Noone knows how to fix this delay?
Bo Berglund
Sweden

tim147
Posts: 1
Joined: Fri Feb 20, 2015 12:04 pm

Re: Print server on Pi has long connect delay

Fri Feb 20, 2015 12:09 pm

I am not using CUPS on my pi, but I have developed a couple of C programs which provide 'print server' functionality
in much the same way as a standalone network/usb server; ie Windows prints to port 9100 on the pi which then outputs
via USB to the printer. The programs require little CPU resource and also allow for more than one printer to be
connected/served over the same network interface. I can happily email you source and/or executables.
My email address: tomtank147@hotmail.com

Bosse_B
Posts: 981
Joined: Thu Jan 30, 2014 9:53 am

Re: Print server on Pi has long connect delay

Fri Feb 20, 2015 3:50 pm

I once used a USB server at work (now retired) in order to connect USB devices to a PC via the network.
I had plans of doing the same here, but the overhead was just too much. I had to install a special driver for the USB server on each PC and then it still needed co-operation between users, because the USB devices could not connect to more than one host at a time.
With the Pi it is a different situation in that the printer can be shared via Samba to any number of PC:s.

After writing the question above I have installed apache2, php and such on the Pi as well as the motion program (to support a webcam). I don't know why but after that was in place the latency when connecting to the printer from a Win7 PC dropped dramatically!
Instead of 25-30 s I now see 2-3 s, fully acceptable.
Very strange that this happened but it did. :)
Bo Berglund
Sweden

User avatar
expandables
Posts: 654
Joined: Fri Jun 27, 2014 7:34 pm
Location: Neverland with Michael Jackson

Re: Print server on Pi has long connect delay

Fri Feb 20, 2015 5:14 pm

Pi is too slow best method is to get a router install openwrt with cups or http://www.gargoyle-router.com/ And use the router as a print server. :mrgreen:
By thinking like an engineer you can create a raspberry pi.
Michael Jackson enthusiast.
I got the PI model B, B+ and PI 2 model B.
When will I get the A? I don't know.

Bosse_B
Posts: 981
Joined: Thu Jan 30, 2014 9:53 am

Re: Print server on Pi has long connect delay

Fri Feb 20, 2015 6:14 pm

About a year ago I tried to install DDWRT on a router (bought a D-Link DIR-615) only to discover that D-Link had changed the product in such a way that it bricked when I tried the install. I was aiming at setting up a VPN server at the time.
Then I turned to the Raspberry Pi instead and got the VPN stuff running etc.
So that is why I wanted to get the Pi to also serve the printer on the network...
Bo Berglund
Sweden

User avatar
expandables
Posts: 654
Joined: Fri Jun 27, 2014 7:34 pm
Location: Neverland with Michael Jackson

Re: Print server on Pi has long connect delay

Fri Feb 20, 2015 6:21 pm

Raspberry pi B is really slow for a print server it takes long. Another solution is to buy a pi2 it is much faster and all you have to do is update the image for it to work on the pi2.
By thinking like an engineer you can create a raspberry pi.
Michael Jackson enthusiast.
I got the PI model B, B+ and PI 2 model B.
When will I get the A? I don't know.

Bosse_B
Posts: 981
Joined: Thu Jan 30, 2014 9:53 am

Re: Print server on Pi has long connect delay

Fri Feb 20, 2015 6:27 pm

I just got myself a Pi2 today....
But I was hesitant to set it up as a replacement for my Pi1 B, which is already configured for so much.
When you say I can update the image of the Pi1B so it will work on Pi2B, how is that done?
And will the Pi2B have all of the configurations I had painfully set up on the Pi1B over the last year?
It is an OpenVPN server for example, will that still work after the update and switch to Pi2B?
Will it be the same computer on the network?

I thought that due to the CPU change the Raspbian image had to be changed and therefore a reinstall was needed....
Bo Berglund
Sweden

User avatar
expandables
Posts: 654
Joined: Fri Jun 27, 2014 7:34 pm
Location: Neverland with Michael Jackson

Re: Print server on Pi has long connect delay

Fri Feb 20, 2015 6:35 pm

Bosse_B wrote:I just got myself a Pi2 today....
But I was hesitant to set it up as a replacement for my Pi1 B, which is already configured for so much.
When you say I can update the image of the Pi1B so it will work on Pi2B, how is that done?
And will the Pi2B have all of the configurations I had painfully set up on the Pi1B over the last year?
It is an OpenVPN server for example, will that still work after the update and switch to Pi2B?
Will it be the same computer on the network?

I thought that due to the CPU change the Raspbian image had to be changed and therefore a reinstall was needed....
Hi it will be the same configuration as the PI1B to update your image do both on the P1B

Code: Select all

sudo apt-get update
and

Code: Select all

sudo apt-get dist-upgrade -y
then put the sd card in the PI2 and everything should work the same. :mrgreen:
By thinking like an engineer you can create a raspberry pi.
Michael Jackson enthusiast.
I got the PI model B, B+ and PI 2 model B.
When will I get the A? I don't know.

Bosse_B
Posts: 981
Joined: Thu Jan 30, 2014 9:53 am

Re: Print server on Pi has long connect delay

Fri Feb 20, 2015 7:03 pm

Sounds a bit like magic!
Does the process require anything like a directly connected keyboard and display?
This Pi is headless, I only use PuTTY to connect to it and do the admin work...
Since my Pi1B uses a standard SDCard and the Pi2B a microSD card, I guess I have to first make a backup disk image, then do the commands you describe and again do an image backup so I can transfer that to a new MicroSD card to finally use on the new Pi2B?
Bo Berglund
Sweden

User avatar
expandables
Posts: 654
Joined: Fri Jun 27, 2014 7:34 pm
Location: Neverland with Michael Jackson

Re: Print server on Pi has long connect delay

Fri Feb 20, 2015 7:35 pm

Bosse_B wrote:Sounds a bit like magic!
Does the process require anything like a directly connected keyboard and display?
This Pi is headless, I only use PuTTY to connect to it and do the admin work...
Since my Pi1B uses a standard SDCard and the Pi2B a microSD card, I guess I have to first make a backup disk image, then do the commands you describe and again do an image backup so I can transfer that to a new MicroSD card to finally use on the new Pi2B?
First ssh into the pi1 with putty and do those commands then shutdown your Pi1B then do the backup and put the SD card in the Pi2.
By thinking like an engineer you can create a raspberry pi.
Michael Jackson enthusiast.
I got the PI model B, B+ and PI 2 model B.
When will I get the A? I don't know.

Return to “Raspberry Pi OS”