Skip to content
Chris Taylor edited this page Oct 17, 2024 · 26 revisions

Wifi Printer Driver

wifiprn.drv is an installable driver that enables printing directly to your network printer from your ZX Spectrum Next.

The latest release can be found at the following URL

Releases: https://github.com/taylorza/zxn-wifiprn/releases

Installing the Driver

  1. Make sure your ZX Spectrum Next has been joined to your wifi network.
  2. Copy the driver file onto your ZX Spectrum Next SD Card.
  3. Install the driver using the following command

.install wifiprn.drv

  1. Tell the driver what your printer's IP address is. For this, we will open channel #3, which is the default printer channel, and configure the IP address used by the driver using the following command

open #3,"d>P>[printer IP address]"

Where [printer IP address] is replaced with the IP of your printer. In my case my printer is at IP address 192.168.5.39 so I would enter the following

open #3, "d>P>192.168.5.39"

  1. Start printing! Since we opened the default channel 3, the standard BASIC LPRINT and LLIST commands should work as expected.

Try this

LPRINT "Hello from your ZX Spectrum Next"

If you used a channel other than 3 you can explicitly specify the channel to print to. For example, if you opened using channel 5 the following should work.

PRINT #5, "Hello from your ZX Spectrum Next"

Note, since we are explicitly specifying the channel we can just use the standard PRINT statement.

Driver Commands

CMD ID Command Arguments Example
1 Set Max Line Length Max Line Length DRIVER 80, 1, 32
80 Driver ID for the printer driver
1 Command ID to set the max line length
32 The desired line length
2 Disable CR translation to CRLF State Disable the CR translation
DRIVER 80, 2, 1
Enable CR translation (default)
DRIVER 80, 2, 0

Limitations

  1. Currently limited to printing text only
  2. Uses the standard printer font so it will not print UDGs and other extended characters. I am considering adding in a convention for UDGs and the graphics characters to emit something that indicates the type of character. One of the books I have replaces all UDGs/Graphics characters with gA, gB, g8 etc. indicating which graphic character is represented.
  3. Some locale-specific characters like the © and £ will likely not print the correct symbol. I need to look at mapping those to their Unicode equivalents...
  4. Did I mention it is text only?

Printing to Local USB Printers

If your printer is connected directly to your machine and is not available on the network you can run a small utility called WinPrinterServer that will accept the network connection and forward the print job to your locally connected printer.

Get the latest version of WinPrinterServer from the GitHub Releases

Tested Printers

Manufacturer Model Working Notes
Canon Canon Pixma TR7520 Printer activated but did not print.
EPSON Epson ECOTANK ET-2650 ✔️
EPSON Epson ECOTANK L575 ✔️
EPSON Epson L4160 ✔️
EPSON Epson SX435W ✔️
EPSON Epson WF-3520 ✔️
EPSON Epson XP-342 ✔️
Hewlett-Packard HP Color LaserJet CM1312 Multifunction Printer ✔️ Tested using WinPrinterServer
Hewlett-Packard HP Color LaserJet Pro 400 ✔️
Hewlett-Packard HP Color LaserJet Pro MFP M283fdw ✔️
Hewlett-Packard HP Envy 5547 Printer activated but did not print. Under investigation
Hewlett-Packard HP OfficeJet Pro 7720 ✔️
Hewlett-Packard HP Officejet Pro 8600 N911a ✔️