Jump to content

Lpr and Rndis


bong.mau

Recommended Posts

Hi

Env: Windows 7 enterprise x64 (SP1 + convenience rollup kb3125574)

i'm able to succesfully print to lacal device usign lpr

this command works

lpr -S 127.0.0.1 -P HP filetoprint

when  i connect my laptop pc to internet using Android device USB tethering then lpr is unable to find printers 

i get the following message

Windows LPD ServerError: specified printer does not exist

i get the same message if i issue  "lpq -S 127.0.0.1 -P HP"

i spent a lot of time isolating this error ...it is due 100% to RNDIS interface activation ...as i deselect "usb tethering" in the smartphone, lpr starts working correctly .....

thanks in advance for the support  

Maurizio

Link to comment
Share on other sites


127.0.0.1 is "self".

Do you have an IP address when tethered (that you have not when not tethering)?

i.e. if you run IPCONFIG /ALL when tethered and not tethered do you see any difference?

jaclaz

 

Link to comment
Share on other sites

Hi Jaclaz

Thanks for the answer

Because the problem sounds STRANGE and hard to believe i create this batch file

@echo off
ipconfig  /all >rndis.txt
if %ERRORLEVEL%== 0 (
    lpq -S 127.0.0.1 -P HP >>rndis.txt
)        
if %ERRORLEVEL%== 0 (
    timeout /T 15
    ipconfig  /all >nocon.txt   
    lpq -S 127.0.0.1 -P HP >>nocon.txt  
 )

i launch the batch when Pc connect to internet via android usb tethering and i disconnect during timeout

i attach  rndis.txt and nocon.txt
as you can see when rndis is active lpq is unable to find the printer 

...mumble...mumble ....

 

rndis.txt nocon.txt

Link to comment
Share on other sites

Yep, good :) , what I suspect is not that the printer cannot be found, but rather that lpq wants the "real" IP address.

what happens (when you are connected) with a batch *like*:

@ECHO OFF
SETLOCAL
SET myLocalIP=
FOR /F "tokens=2 delims=:(" %%A IN ('TYPE rndis.txt ^|FIND "IPv4 Address."') DO ( 
SET myLocalIP=%%A
)
IF NOT DEFINED myLocalIP SET myLocalIP= 127.0.0.1
CLS
ECHO Local IP is%myLocalIP%
ECHO.
ECHO Press a key to run command:
ECHO lpq -S%myLocalIP% -P HP
ECHO.
ECHO or press CTRL+C to terminate the batch
ECHO.
PAUSE
lpq -S%myLocalIP% -P HP

Of course, you can (should) replace the 

TYPE rndis.txt

with

IPCONFIG /ALL

jaclaz

 

Edited by jaclaz
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...