Browsed by
Tag: usb

Fun with (Laser) Printers using PJL

Fun with (Laser) Printers using PJL

Conversing with your Laser Printer:(See disclaimer below)

To extract information from your printer in PJL telnet to its IP address, port 9100 (or by serial, see below), and send it these commands:

<Control+[>%[email protected] <Enter>

Then copy and paste the following commands:

@PJL INFO ID
@PJL INFO CONFIG
@PJL INFO FILESYS
@PJL INFO MEMORY
@PJL INFO PAGECOUNT
@PJL INFO STATUS
@PJL INFO VARIABLES
@PJL INFO USTATUS

Or even try some newer, more detailed but undocumented ones:

@PJL INFO LOG
@PJL INFO PRODINFO
@PJL INFO SUPPLIES

Save your responses, and then type (note: NO <Enter> afterwards):
<Control+[>
%-12345X

Then you can disconnect and/or close your Telnet program

Alternately, here is a small BASH script to return all of the information in a dated text file. To use, simply give the script the IP address of the printer as an argument.

#!/bin/bash
#v1.0 – M Lange, 4-Jan-2014
echo -e “Scan of $1 9100 run on `date`:\n——————————-\n” > PJLScan-`date -I`.$1.txt

{ echo -e “\033%[email protected]”;
echo @PJL INFO ID;
echo @PJL INFO CONFIG;
echo @PJL INFO FILESYS;
echo @PJL INFO LOG;
echo @PJL INFO MEMORY;
echo @PJL INFO PRODINFO;
echo @PJL INFO STATUS;
echo @PJL INFO SUPPLIES;
echo @PJL INFO VARIABLES;
echo -e “\033%-12345X”;
sleep 5; } | telnet $1 9100 | sed -e ‘s/\r$//’ >> PJLScan-`date -I`.$1.txt

If you could post your results in the comments, or Pastebin them and post the link, I’d be happy to share them. (Feel free to remove serial numbers if you wish; simply replace them with ‘x’s or ‘-‘s.) I’m trying to get a feel for what the most common options and languages are, as an upcoming open-source project has me parsing raw data and sending it to network printers.

The usual disclaimers apply: I’m not responsible for damages caused to your stuff or expenses incurred (i.e ink/toner/paper). Luckily, the worst case scenario is either A) Print out a page with those commands on it, or B) Hog the printer’s I/O until it times out (or you turn it off and then back on). For this reason, I recommend only trying this on a printer to which you *own* and to which you have physical access.

PJL Commands:

Tip: To run a PJL command,
you need to be in PJL mode. If you’re not in PJL mode (ie you typed something that doesn’t begin with an @, you get bumped into raw text mode), you need to send a <Control+[>%[email protected] <Enter>, then you can type your PJL command, beginning with “@”. To end your PJL session, send <Control+[>%-12345X (with no <Enter> after it)

“@PJL” can be used as a command on its own, or rather, a lack of command (or NOOP). It is used after the Escape Code (…%-12345X) to tell the printer you will be typing some PJL. This is necessary because printers sample the code after the Escape Code (…%-12345X) to try to determine what type of data they are receiving (PJL, PCL, PCLXL, PostScript, etc., depending on the model)

HP LaserJet 4M Plus

HP Color LaserJet CP1518ni:

HP Color Laserjet MFP M275nw:

HP LaserJet 1012:

  • Plugs in by USB only
  • Can interact with it at /dev/usblp0 at 115200,8,n,1 using gtkTerm as root: sudo gtkterm –port /dev/usblp0 –speed 115200 –echo and set “CR LF auto” under the configuration menu
  • Interesting: @PJL SET TESTPAGE=DATASTORE is an interesting (4-page) test page, essentially a printout of the value and meaning of all variables
  • Personalities: PCL, PCLXL
  • Info: HP LaserJet 1012 Info Dump.doc

HP LaserJet 9050:

HP Color LaserJet 9500:

HP Officejet Pro X476dw MFP:

Brother HL-3040cn:

Brother MFC-7440n:

See also:

Please note:

  • I would imagine a number of inkjets use PJL, though honestly I have no inkjet printers on-hand to test on. I posit that a number of inkjets will work, including ones with built-in Ethernet. It may be possible to execute commands over USB as with the LaserJet 1012 (See above for serial terminal settings). If anyone has inkjet dumps, they’re just as welcome as Laser ones.
USB Host on HP Touchpad: Progress…

USB Host on HP Touchpad: Progress…

To access USB Host mode on the Touchpad (to plug in a Keyboard/USB Drive/etc), you need:

  1. A microUSB to USB Female cable (USB-OTG cable), available on ebay for ~$3, shipped [search ‘USB-OTG cable’]
  2. A powered USB Hub (a USB Hub with a spot to plug in an external power supply), available on ebay for under $10, shipped, with power supply  [Search ‘powered usb hub’]

All you need to do is plug the USB Hub into the OTG adapter, and the OTG Adapter into the Touchpad. Power it with a wall adapter, and you’ll have USB devices showing up in dmesg in no time!

For example:

[16075.755719] usb 1-1.1: new high speed USB device using msm_hsusb_host and address 3
[16075.775744] get_port_status port=1,portstatus=1503, portchange=10
[16075.868006] usb 1-1.1: New USB device found, idVendor=13fe, idProduct=3323
[16075.868111] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[16075.883769] usb 1-1.1: Product: STORE N GO
[16075.883821] usb 1-1.1: Manufacturer: Verbatim
[16075.894000] usb 1-1.1: SerialNumber: 070007A315074099E8C5
[16075.922270] scsi1 : usb-storage 1-1.1:1.0
[16075.944010] get_port_status port=1,portstatus=1503, portchange=0
[16076.953338] scsi 1:0:0:0: Direct-Access     Verbatim STORE N GO       5.00 PQ: 0 ANSI: 0 CCS
[16076.993863] sd 1:0:0:0: Attached scsi generic sg0 type 0
[16077.204050] sd 1:0:0:0: [sda] 7802880 512-byte logical blocks: (3.99 GB/3.72 GiB)
[16077.204665] sd 1:0:0:0: [sda] Write Protect is off
[16077.216317] sd 1:0:0:0: [sda] Mode Sense: 23 00 00 00
[16077.216329] sd 1:0:0:0: [sda] Assuming drive cache: write through
[16077.219671] sd 1:0:0:0: [sda] Assuming drive cache: write through
[16077.227274]  sda: sda1
[16077.237134] sd 1:0:0:0: [sda] Assuming drive cache: write through
[16077.237234] sd 1:0:0:0: [sda] Attached SCSI removable disk

To be fair, there is most likely a way to enable the Touchpad to power USB OTG devices itself, which would remove the need for the powered hub.

See also: http://forums.precentral.net/hp-touchpad/296505-functional-usb-host-touchpad.html and http://www.youtube.com/watch?NR=1&v=rXRcvN50-nU, which suggest using a USB Y-cable to inject power, and from which I blatantly stole the idea of using a powered USB hub 😉

So far I have tried a USB thumbdrive and a wireless mouse dongle; the thumbdrive was detected flawlessly, while the mouse’s dongle was not.

D-Link DWL-120 Hacking/Probing

D-Link DWL-120 Hacking/Probing

I found 3 or 4 of these at a garage sale a few years ago for a few bucks, and I am (surprisingly) just cracking them open now.

On the front, it is marked as D-Link DWL-120 11Mbps Wireless USB Adapter, on the back is FCC ID# MXF-WL280, H/W: B2, F/W: 2.25

On the bottom of the PCB, we have the following chips:

  • Atmel AT76C503AWireless LAN MAC Unit with ARM7TDMI RISC Processor
  • Atmel AT25040N4K (512 x 8) SPI Serial EEPROM
  • tmTECH T14L1024N128 x 9 High-Speed CMOS Static RAM
  • Intersil HFA3861BINDirect Sequence Spread Spectrum Baseband Processor

On the top of the PCB (under the RF shield), we have the following chips:

  • Intersil HFA3683AIN2.4GHz RF/IF Converter and Synthesizer
  • Intersil HFA3783INI/Q Modulator/Demodulator and Synthesizer
  • Intersil HFA3983IV2.4GHz Power Amplifier and Detector

I plugged it into my i386-based laptop (My x64 desktop doesn’t have drivers) and got this dmesg:

[   80.592101] usb 1-2: new full speed USB device using uhci_hcd and address 2
[   80.763204] usb 1-2: configuration #1 chosen from 1 choice
[   81.504200] cfg80211: Using static regulatory domain info
[   81.504209] cfg80211: Regulatory domain: US
[   81.504215] 	(start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[   81.504224] 	(2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2700 mBm)
[   81.504233] 	(5170000 KHz - 5190000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
[   81.504241] 	(5190000 KHz - 5210000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
[   81.504248] 	(5210000 KHz - 5230000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
[   81.504256] 	(5230000 KHz - 5330000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
[   81.504264] 	(5735000 KHz - 5835000 KHz @ 40000 KHz), (600 mBi, 3000 mBm)
[   81.504290] cfg80211: Calling CRDA for country: US
[   81.654555] cfg80211: Regulatory domain changed to country: US
[   81.654567] 	(start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[   81.654577] 	(2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2700 mBm)
[   81.654585] 	(5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 1700 mBm)
[   81.654593] 	(5250000 KHz - 5330000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   81.654601] 	(5490000 KHz - 5710000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   81.654609] 	(5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 3000 mBm)
[   81.912231] Atmel at76x USB Wireless LAN Driver 0.17 loading
[   81.912307] usb 1-2: firmware: requesting atmel_at76c503-i3861.bin
[   81.965349] usb 1-2: using firmware atmel_at76c503-i3861.bin (version 0.90.0-44)
[   81.967174] at76c50x-usb 1-2:1.0: downloading internal firmware
[   84.329808] usb 1-2: reset full speed USB device using uhci_hcd and address 2
[   84.477154] usb 1-2: device firmware changed
[   84.477265] usbcore: registered new interface driver at76c50x-usb
[   84.492786] usb 1-2: USB disconnect, address 2
[   84.604098] usb 1-2: new full speed USB device using uhci_hcd and address 3
[   84.781393] usb 1-2: configuration #1 chosen from 1 choice
[   84.789161] at76c50x-usb 1-2:1.0: downloading external firmware
[   85.032206] phy0: Selected rate control algorithm 'minstrel'
[   85.034924] phy0: USB 1-2:1.0, MAC 00:05:5d:f1:9d:39, firmware 0.90.0-44
[   85.034935] phy0: regulatory domain 0x00: <unknown>
[   85.383777] udev: renamed network interface wlan0 to wlan1
[   89.584738] ADDRCONF(NETDEV_UP): wlan1: link is not ready
Anadigi GPS-R02 DIY GPS Kit

Anadigi GPS-R02 DIY GPS Kit

I got this little “Anadigi GPS-R02 DIY” car gps kit from eBay seller anadigi-hk, and it was mailed direct from Hong Kong.

[Edit: Apparently, the eBay Store and user are no more.]

It came with the GPS Circuit board and a little plastic case for it, an MMCX antenna with magnetic base, and a matching USB cable. The mini-CD came with drivers and a few test and diagnostic programs.

It works great; by the time my computer comes out of hibernation, it already has a signal lock. Talk about bang for the buck!

The receiver is based on the NemeriX NJ1030A [Datasheet – Archive.org], and includes WAAS/EGNOS support.

Markings on the box: (They look like the vitals for the GPS Antenna)

  • Product Model: GPS
  • Center Frequency: 1575.42 +/-3Mhz
  • LNA Gain (Without Cable): 28dB
  • Noise Figure: <1.5dB
  • VSWR: <2.0
  • DC Current: 10mA Max
  • Mounting: Magnetic Base
  • Housing: Black
  • Working Temp: -40*C ~ +85*C
  • Vibration: Sine sweep lg(0-p) 10~50~10Hz each axis
  • Humidity: 95%-100%RH
  • Weatherproof: 100% Weatherproof
  • Cable Length: 3m
  • Voltage: 3-5V
  • Connector: MMCX
  • USB to Serial Converter (onboard): PL-2303* (but the Prolific Windows driver doesn’t like it, errors with Code 10: Cannot start”, according to the Prolific website, that means it’s likely a counterfeit PL-2303 chip. I’ll have to dig out the CD that came with it again.)

Update: How to add GPS to your Eee PC @ beta.ivancover.com – That’s definitely one of the first things I’d do with an Eee.

USB SD Card Adapter

USB SD Card Adapter

Ok, I got this set of 3 USB SD Card adapters from eBay seller flash-mart.

The picture shows the innards of one, and a full one. They come in multiple colors. They’re nice because you can insert an SD card and put the cover back on. I’m thinking in particular about USB hard drives for the MSNTV2s with these.

SparkFun FT232RL Breakout Board

SparkFun FT232RL Breakout Board

This little guy will be making his appearance in some future electronics projects 

:thumbsup:

From SparkFun Electronics, this little guy is a USB to UART converter, I’ll see what kind of fun I can have with it.

SparkFun Electronics says:

[This is a…] basic breakout board for FTDI’s popular USB to UART IC. Now with
internal oscillator and EEPROM, the FT232RL is an impressive IC!

VCCIO is now tied to 3.3V through a solder jumper. You have the
option of clearing this jumper and tying the VCCIO pin to 5V or any
other IO voltage you need.

Features:

  • Implements full v2.0 USB protocol
  • Needs no external crystal
  • Internal EEPROM for device ID and Product Description strings
  • Royalty-Free Driver support for Windows, Linux, and Mac OSX
Phidgets

Phidgets

Phidgets are an easy to use set of electronic building blocks for low cost sensing and control from your PC. Using the Universal Serial Bus (USB) as the basis for all Phidgets, the complexity is managed behind an easy to use and robust Application Programming Interface (API). Applications can be developed quickly in Visual Basic, VBA (Microsoft Access and Excel), LabView, Java, Delphi, C and C++.