HPLIP 3.13-11, A LaserJet 4/4M with a JetDirect: no workie - printing

I'm trying to get a very old, but working great C2001A/J4100A (HP LaserJet 4) to work with the HP Linux Imaging and Printing library, but I'm having an awful time of it.
1) There's no entry in /usr/share/hplip/data/models/models.dat for [hp_laserjet_4]. This is the first problem so far when I used Bonjour discovery through an avahi.service file I put on my OpenWRT router. I don't currently have an iPhone I want it to discover with AirPrint, but this is how I started off and helps CUPS finds printers anyways.
2) SLP discovery is a complete bomb. I've traced it down to the UDP packet the JetDirect sends off in response to the broadcast discovery request. The part that is 'x-hp-p1=0' should be something like 'x-hp-p1=MFG:HP;MDL:LaserJet4;etc..' and it causes hp-probe to fail to see what printer the JetDirect is plugged into.
I can't seem to force HPLIP to bypass the bad discovery methods and it's too smart and wants to verify.
I've posted to the HPLIP help area, but they seem to run a week slow.

Instead of doing JetDirect, try LPR directly to the IP address. And any of the older PCL drivers should work against that printer.

Related

Is it possible to access a Chromebook via ssh through USB?

My employer has asked me to prepare for testing several thousand Chromebooks (mix of models/manufacturers) to refurb/flip. This may be a recurring thing.
Most or all of these will be old enough that CCD will not be available. I'd like to connect a widget such as a Raspberry Pi to the USB and have it automate testing as much as possible.
I know I can use keyboard emulation to inject commands, but I'd like to get a crosh session running over USB so that I can read info from the DUT besides just controlling it.
Google shows bazillions of returns about using a Chromebook as an ssh terminal but what I'm looking for is the opposite. I'm prepared for the answer to be a simple "no" but I'm concerned because I can't find that anyone else has asked this question. I don't think I'm that creative, so I suspect my Goog-fu is weak.
The answer appears to be "no". However I solved it another way; using "gadget mode" I have a Raspberry Pi ZW enumerate as a keyboard and a serial port. I put the Chromebook into Developer mode, open a developer shell with ctrl/alt/F2, or on a PC/linux or Mac system open a terminal window and type "sudo su" (these have to be done manually). Then I have the RPi issue this bash command to identify the serial port "in the blind":
SERPORT=/dev/serial/by-id/$(ls /dev/serial/by-id) # Chromebook or PC/linux
(or)
SERPORT=$(ls /dev/cu.usbmodem*) # Mac
Now I can have the RPi inject commands via the keyboard, put ">$SERPORT" on the end of each command, and the output comes in the RPi gadget serial port. The RPi then packages the data and forwards it over WiFi to our CRM. It's working nicely for Chromebooks, PCs booted into linux, Mac desktops and Macbooks.
Edit:
The company I work for has actually turned this into a product and so I'm not sure how much detail I should share, but...
I learned my way around gadget mode on the RPi from this link. There are examples for setting up a keyboard and a serial port. Using the templates in that link, I made a device called /dev/hidg0 which emits keyboard scancodes from the RPi to the Chromebook. I also made a device called /dev/ttyGS0 which the Chromebook sees as a serial port.
So I send keystrokes with some python like:
with open("/dev/hidg0","bw") as hid:
hid.write(blah)
and then have the Chromebook send text to the serial port, which I then read by looking at /dev/ttyGS0
Hopefully this will be enough to get you started. I found the isticktoit link very helpful.

Find out if a device is turned on in LAN using its MAC address without an IP

On a local network I'm sending a WOL (Wake-On-LAN) packet using sendto to the target MAC address. The code for that works without any problems and the target machine is turned on correctly. The problem is, that I don't know if the target machine has a LAN cable attached or not. If it's not attached, then the whole process fails. Unfortunately, sendto is unidirectional, so I don't know if my magic packet arrived.
I'm wondering about the best and fastest way to find out if WOL succeeded or not. Waiting for the device to boot up completely so I find out get and ping its IP address takes way too long.
Is there a way to "ping" a MAC address, i.e. get some sort of Layer-2-reply?
I need this solution for a Delphi application, but if you have a solution for a different language at hand you're welcome to post that as well. Thank you!

ARP replies (Unicast) not seen in Wireshark, any ideas?

[I had to repost this from the ask.wireshark.org as my questions do not come up there, still not sure why].
Hi All,
I'll try my luck here.
I'm trying to solve a similar problem to the one described in "how to work around unicast messages" question, albeit in my case I'm not seeing an ARP reply (unicast) in Wireshark.
I need to say that I have read everything that was suggested in that thread (wireshark help and a set of other documents on Ethernet Capturing/Hubs vs Switches vs Taps, etc.) and still puzzled, so basically would love to hear any ideas thrown at me by experts.
So:
it is Ethernet;
3 devices:
1. a custom device (running embedded linux)
2. a PC (WinXP) where wireshark is running (promiscuous mode, capture all)
3. a PC where a server application is running to which the custom device communicates.
all 3 connected to [what is believed to be] a simple hub "CentreCom MR415T repeater" 10BASE-T only (not dual speed).
I'm seeing all the traffic I expect to see in Wireshark but NO ARP replies (unless they are sent to the Wireshark PC).
For the problem I'm trying to nail it is crucial to tell whether there are NO replies to ARP requests sent by custom device (1) or it (the device) is unable to correctly handle these replies (which is quite possible).
All other symptoms point to the latter but I need to actually SEE and be able to SHOW this as a proof.
Thanks in advance to anyone who replies,
Alexei
UPD. 2016/06/09: In advanced settings of Panda Firewall found a tick box "SmartARP" - unticked and this solved the issue.
The ultimate reason of not seeing ARP replies in Wireshark turned out to be: Panda End Point Protection Plus Firewall. Not the most flexible piece of software as far as I can see, creating a User rule for Wireshark to allow both incoming/outcoming does not help in the slightest, but disabling the firewall - does.

POS Printer not available in Pos .NET

My Bixolon SRP-350II is not shown in the list of available devices given by
posExplorer.GetDevices();
All I see are Microsoft's simulated devices. The printer itself works, I can print on it and, using raw printing, send commands such as "cut". I've installed the OPOS driver for the printer, but nothing changed.
Is it necessary to do some further configuration? Is the order of installing POS.NET, the OPOS-driver and the Windows driver important?
Alright, figured out the Printer had to be configured with PSPLauncher.exe and now it shows up. Still, I am not sure I understand where exactly the benefit of POS .NET lies. I want the customers to plug-in new printers and when using Raw Printing and EscPos-commands, this seems to be much easier.
Plug printer in, install windows driver, set to main printer and then cut-commands etc. are being send in the raw stream.
I can't say directly for printers, but where we get the benefits out of POS.NET is the standard code we wrote for the scanners, or MSRs or cash drawers. All we have to do is install the driver, and configure the device in OPOS configuration (which is probably the step you were missing and resolved with the "PSPLauncher.exe") and we know that it's code-compatible and just works.
We have hundreds of terminals across the country (Australia) and they all use a variety of models and brands for the devices (within a range of tolerance) but because of POS.NET they're all supported.

How to build a virtual printer?

I'm trying to build a virtual printer.
There are already some answers like this and this.
However my demand is more specific. I just want to create a virtual printer that can be added into the system and can be accessed from any application. On clicking print command, a dialog looks like a real printer pops out and generates a PDF on printing. Then some more actions, like pushing the PDF to my server, are performed.
Do I need to dig into Windows Driver Kit? Or is there any free SDK for this?
Thanks.
Not sure if this question is still relevant to you, but you'd probably want to think about something like this:
Use the WDK (Windows Driver Kit) to create a Unidrv UI plugin. This will allow you to specify UI during the print (for your printer dialogue). The reason why you'd want to show UI here is because it's one of the only printer driver components that runs in the user session (the same process as the printing application). The XPS pipeline and port monitor are both session 0.
If you want to stick to MS convention, you'll do the spool file to PDF conversion in the render filter of the XPS Filter pipeline (this is if you're using an XPSDrv driver). The filter pipeline is where you have the opportunity to modify the XPS spool data coming in and in the final filter, convert it to your output document type (PDF in your case).
To do post print processing, you might want to consider creating a port monitor (again with the WDK) and kicking off a new process to do the post print processing after the port monitor writes out the print output to disk.
Only problem with this approach is that you can't use port monitors in Version 4 drivers (this is the new type of driver in Windows 8). Version 3 drivers still work in Win 8, but I guess they'll be phased out eventually.
Sorry it's probably not very obvious, but as I say, it's a high level overview (and unfortunately driver development is still very complex beyond a simple print to file). Version 4 printer drivers are becoming a lot easier to develop, but unfortunately with the removal of port monitor support and other improvements, it makes it a lot harder to develop anything requiring post processing.
[DISCLAIMER: I'm associated with the Mako SDK R&D team]
I know you asked for a free SDK, unfortunately I don't know of anything that would be suitable, but I know our company offer a Virtual Printer Platform (SDK) which would be good for you (prints to PDF and supports post print processing). You can find more information at the Mako SDK website
Hope this helps a bit anyway. I know printer driver development can be very confusing at times!
After reading up and doing a lot of research, with the aim to setup up something like redmon and use the printer SDK, I have completed the project using this SDK: http://www.novapdf.com/pdf-sdk.html
This solution however will work with windows only.
[I am not affiliated with novaPDF]
I have investigated an OSX version, however this will be a different build, you can probably set something up using this method: http://www.jms1.net/osx-pdf-services.shtml [I have not yet tried this]

Resources