I am trying to print calibration labels to a Brother P-Touch P95NW.
The printer is configured with a static IP, I can ping it and print (by IP) from the P-Touch Editor.
To print from my webform I am trying to use code that works great for me with several different printers with varying languages.
Based on the printers developers manual, they supply a hex output as an example.
My desired code would send raw output to the printer.
Something like this.
Dim clientSocket As New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
clientSocket.Connect(New IPEndPoint(IPAddress.Parse(IP), 9100))
Dim Label As String = "1B 69 61 00 1B 40 1B 69-6C D0 02 1B 24 3C 00 1B" &
"6B 00 1B 58 36 41 74 20-69 6F 75 72 20 73 69 64" &
"65 0C"
clientSocket.Send(Encoding.ASCII.GetBytes(Label))
clientSocket.Close()
When executed there is no reaction from the printer at all.
Brother has some tech video’s and in their examples they send the data in a text file, so I tried that. The file referenced has the same content as the string above.
Dim filePath As String = "\myserverSystems_MISCbwtest.txt"
Dim fileReader As String = My.Computer.FileSystem.ReadAllText(filePath, Encoding.ASCII)
Dim clientSocket As New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
clientSocket.Connect(New IPEndPoint(IPAddress.Parse(IP), 9100))
clientSocket.SendFile(filePath)
clientSocket.Close()
Again I get the same result, nothing.
I also tried to use netcat to send the file, again with no results.
At this point I have to assume that I am missing something obvious with my output file or a configuration somewhere. I am printing on a .94″ wide label with the same type of orientation as shown in their example.
Any advice apreciated!