Jump to content

HP Printer Display Hack


tonedeaf
 Share

Recommended Posts

I found a C# version of this hack on the internet.

Didn't take me long to convert it to an AutoIt script :)

Change $strPrinterIP value to Network IP Address of the printer.

Some printers have an option to print their configuration, look for the IP Address under TCP/IP.

Also, check Printer properties in Printers & Faxes in Control Panel, you can find the IP Address in the Ports Tab.

; Modify the Network Printer IP address and the message to display on the LCD screen
; Make sure the message is short enough to fit on the printer display

$strPrinterIP = "10.30.210.40"
$strMessage = "INSERT COIN"

TCPStartUp()

$socPrinter = TCPConnect($strPrinterIP, 9100)
If $socPrinter = -1 Then Exit

$strCommand = Chr(27) & Chr(27) & "%-12345X@PJL RDYMSG DISPLAY = " & Chr(34) & $strMessage & Chr(34) & @LF & Chr(27) & "%-12345X" & @LF

TCPSend($socPrinter, $strCommand)

Results on my company printer :)

Posted Image

It'll also work on printers which accept PCL/PJL commands. My success rate is 100% on all the printers.

Some more examples:

BUZZ OFF

STEP AWAY

SET TO STUN

PAT EATS MICE

GO AWAY

NEED MORE SPACE

POUR ME A DRINK

IN DISTRESS

FEED ME

RADIATION LEAK

NICE SHIRT!

HANDS UP

PRESS MY BUTTONS

INSERT DISK

LOOKS LIKE RAIN

BUY ME LUNCH

TAKE A BREAK

INSERT QUARTER

NO PRINT FOR YOU

NICE HAIR

NEED A MINT?

:)

Edited by tonedeaf
Link to comment
Share on other sites

THATS THE FUKN BEST HACK IVE EVER SEEN :)

i created a script that turns all our printers into a slot machine ...

[bAR] [bAR] [bAR]

Best regards,

J

$a=StringSplit("547275737420796F757220546563686E6F6C75737421","")
For $b=1 To UBound($a)+(-1*-1*-1)step(2^4/8);&$b+=1*2/40*µ&Asc(4)
Assign("c",Eval("c")&Chr(Dec($a[$b]&$a[$b+1])));''Chr("a")&"HI"
Next ;time_U&r34d,ths,U-may=get$the&c.l.u.e;b3st-regards,JRSmile;
MsgBox(0x000000,"",Eval("c"));PiEs:d0nt+*b3.s4d.4ft3r.1st-try:-)
Link to comment
Share on other sites

One better. I made a GUI to make it easy and it remembers your last entry. I also made it so you can access the embedded webserver most HP printers have.

#include <GuiConstants.au3>
#include <IE.au3>

GuiCreate("Set message on HP Printer", 381, 197,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))
$ini = IniRead(@ScriptDir&"/printerCFG.ini", "1", "1", "")
$ini2 = IniRead(@ScriptDir&"/printerCFG.ini", "1", "2", "")
$Input_1 = GuiCtrlCreateInput($ini2, 40, 40, 310, 20)
$Input_2 = GuiCtrlCreateInput($ini, 40, 100, 310, 20)
$Button_3 = GuiCtrlCreateButton("Set", 40, 130, 40, 20)
$Button_4 = GuiCtrlCreateButton("Exit", 95, 130, 40, 20)
$Button_5 = GuiCtrlCreateButton("Access printer via embedded webserver", 150, 130, 200, 20)
$Label_5 = GuiCtrlCreateLabel("IP Address of printer", 40, 20, 110, 20)
$Label_6 = GuiCtrlCreateLabel("Message to be displayed", 40, 80, 120, 20)

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE or $msg = $Button_4
        ExitLoop
    Case $msg = $Button_3
        _setmessage()
    Case $msg = $Button_5
        $strPrinterIP = GUICtrlRead($Input_1)
        _IECreate("http://"&$strPrinterIP)
    Case Else
;;;
    EndSelect
WEnd
Exit

func _setmessage()
    $strPrinterIP = GUICtrlRead($Input_1)
    $strMessage = GUICtrlRead($Input_2)
    TCPStartUp()
    $socPrinter = TCPConnect($strPrinterIP, 9100)
    If $socPrinter = -1 Then 
        MsgBox(48, "Error!", "IP is incorrect or Printer is not online")
    else    
        $strCommand = Chr(27) & Chr(27) & "%-12345X@PJL RDYMSG DISPLAY = " & Chr(34) & $strMessage & Chr(34) & @LF & Chr(27) & "%-12345X" & @LF
        TCPSend($socPrinter, $strCommand)
        IniWrite(@ScriptDir&"/printerCFG.ini", "1", "1", $strMessage)
        IniWrite(@ScriptDir&"/printerCFG.ini", "1", "2", $strPrinterIP)
    endif
EndFunc
Edited by Volly
Link to comment
Share on other sites

This is awesome! Thanks tonedeaf and Volly!

Edit: Quick question, I don't have a printer but am planning on using this at school... Does it reset when you exit the script? Or can you just hit reset on the printer... or reset the text to the original?

Edited by Piano_Man
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

Dang...no joy on a HP DesignJet750c+ :)

"There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110
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
 Share

  • Recently Browsing   0 members

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