Author Message

<  Device Information  ~  working configuration for the Dymo LabelMaker PnP printer

PostPosted: Sun Jul 08, 2012 10:47 pm Reply with quote
Posts: 2 Joined: Sun Jul 08, 2012 6:53 pm
Hi,

I recently got myself a Dymo LabelManager PnP printer, that is this one:

http://global.dymo.com/ieIE/Products/La ... r_PnP.html

Out of the box, this printer shows up as a HID and a Storage device on Linux,
while on Windows, with driver installed, you also get, in addition to the HID
and Storage, a printer device.

But by following the instructions given at

http://www.draisberghof.de/usb_modeswitch/

and M. Ziesmers description given at

http://blogger.ziesemer.com/2008/10/all ... buntu.html

I kind of "accidentally" managed, after many trials, to produce a working
"usb_modeswitch" configuration for the printer. The final configuration looks like
this:
Code:
# Dymo LabelManager PnP

DefaultVendor= 0x0922
DefaultProduct=0x1001

TargetVendor=  0x0922
TargetProduct= 0x1002

MessageEndpoint= 0x01
ResponseEndpoint=0x01

MessageContent="1b5a01"

(Only the last three lines are really neccessary.)

Just to complete the description, I also did the following steps in order
make the printer work on my Ubuntu box with the above configuration:

1. Put the "usb_modeswitch" configuration into the file:

/etc/usb_modeswitch.d/dymo-labelmanager-pnp.conf

2. Created a file

/etc/udev/rules.d/91-dymo-labelmanager-pnp.rules

with the content:

# DYMO LabelManager PNP
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0922", ATTRS{idProduct}=="1001", \
RUN+="/usr/sbin/usb_modeswitch -c /etc/usb_modeswitch.d/dymo-labelmanager-pnp.conf"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0922", ATTRS{idProduct}=="1002", MODE="0660", GROUP="plugdev"

(The last line is really uneccessary but adds the device to the "plugdev"
group, which gives users read/write access to the device on Ubuntu.)

3. Restarted "udev" with:

# restart udev

Now when plugging in the Dymo printer its VID/PID values changes from 0922:1001
to 0922:1002 and all the three "devices" becomes available (that is the HID,
Storage and Printer).

As the "disk" only contains a Windows application and some documentation, it is not
all that interesting on linux. One way of "disabling" the disk is to create a file:

/etc/modprobe.d/blacklist-usb-storage.conf

with the content:

# Ignore DYMO LabelManager PNP built in storage
# (contains Windows and Mac apps, has no function on linux)
options usb-storage quirks=0922:1001:i,0922:1002:i

(note that just to be sure, both VID/PID values are marked as "ignored") and
"activate" the configuration with the commands:

# depmod -a
# rmmod usb-storage

Now the device is still there but is "blocked" from becoming visible as a disk.

The "cups" files for the printer (and other Dymo printers) can be found at:

http://download.dymo.com/Software/Linux ... 4.0.tar.gz

For more about the "cups" files, see:

http://dymodevelopers.wordpress.com/201 ... for-linux/

An another option that I came accross while searching for information about how
to best use this printer, is S. Bronner "dymoprint" script:

http://www.sbronner.com/dymoprint/

This script accesses the HID device directly and makes it really easy to write
labels from the command line. (Note that the "DEV_PRODUCT" value at the top of
the script should be changed from "1001" to "1002", if the above
"usb_modeswitch" setup is used.)

As I only have tested the one printer that I have on one the one computer that I
have, I cannot say that this setup will work for others. But it would be
interesting to hear if others with the same printer are able to get it to work
using the above description.

br,
kmm


PS! There does not seems to be a way to post "plain text" messages here, so
the indentation in the text unfortunately became destroyed. But hopefully
the text is still readable. becomes available (that is the HID,
Storage and Printer).

As the


Offline
PostPosted: Mon Jul 09, 2012 10:23 pm Reply with quote
Site Admin Posts: 6420 Joined: Sat Nov 03, 2007 12:30 am
kmart wrote:
I kind of "accidentally" managed, after many trials, to produce a working "usb_modeswitch" configuration for the printer.
Excellent job!

The MessageContent is looking unusual, but so are a lot of devices ...

Since you do not read any response, did you try without the "ResponseEndpoint"?

And did the automatic MessageEndpoint detection not work in your case?

Regarding the configuration, I'd try to let the usb_modeswitch "framework" handle the device. For this to work rename your "dymo-labelmanager-pnp.conf" to "0922:1002" (same folder).
Then add a line to "/lib/udev/rules.d/40-usb_modeswitch.rules", just like the others you find in there, but adapted to your ID of course.

kmart wrote:
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0922", ATTRS{idProduct}=="1002", MODE="0660", GROUP="plugdev"

(The last line is really uneccessary but adds the device to the "plugdev" group, which gives users read/write access to the device on Ubuntu.)
This is in no way unnecessary - it's exactly the kind of stuff that udev is supposed to help with.

Even if you let the usb_modeswitch scripts handle the device as suggested, you should still keep that rule in the rules folder.

kmart wrote:
PS! There does not seems to be a way to post "plain text" messages here, so the indentation in the text unfortunately became destroyed.
Next time, just use the "Code" tag which will keep the formatting.

Anyway, thanks for the new device!



Offline
PostPosted: Tue Jul 10, 2012 12:24 am Reply with quote
Posts: 2 Joined: Sun Jul 08, 2012 6:53 pm
Hi,

Quote:
The MessageContent is looking unusual, but so are a lot of devices ...

Since you do not read any response, did you try without the "ResponseEndpoint"?

It seems like that the printer will not make the "switch", unless both "MessageEndpoint" and "ResponseEndpoint" are present.

Anyway, the relevant part from running UsbSnoop looks like this:

Code:
-- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:
  PipeHandle           = 86fee89c [endpoint 0x00000001]
  TransferFlags        = 00000002 (USBD_TRANSFER_DIRECTION_OUT, USBD_SHORT_TRANSFER_OK)
  TransferBufferLength = 00000040
  TransferBuffer       = ba75b119
  TransferBufferMDL    = 00000000
    00000000: 1b 5a 01 00 00 00 00 00 00 00 00 00 00 00 00 00
    00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    00000030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  UrbLink              = 00000000

This is the only message that goes downward to the 0x01 endpoint.

And it will also work if you set the "MessageContent" variable to all those 64 bytes. It still works if you reduce the "zero padding" down to a total of 31 bytes, which seems what most other configurations are using. But as the "switch" also happended when you went on and removed all of the zero padding (I assume that it is just padding - actually I really don't know), I ended up with using only the 4 remaining non-zero bytes. But maybe the variable should really be padded up to at least 31 bytes, just to be sure?

Quote:
Regarding the configuration, I'd try to let the usb_modeswitch "framework" handle the device. For this to work rename your "dymo-labelmanager-pnp.conf" to "0922:1002" (same folder).

Worked quite well! (Only that I had to name the file "0922:1001".)

Quote:
Next time, just use the "Code" tag which will keep the formatting.

Still learning... :-)

br,
kmm


Offline
PostPosted: Tue Jul 10, 2012 9:34 am Reply with quote
Site Admin Posts: 6420 Joined: Sat Nov 03, 2007 12:30 am
Since your mode-switching sequence is not a standard bulk command (where the length is fixed) it can really be as long as it pleases. Shorter is better, obviously ...

Interesting thing about the endpoint parameters though. To get an actual response, the endpoint must be different from the one for sending. These things are one-way only.

The single consequence of your giving the response endpoint as "1" without reading a response is - in the current usb_modeswitch code - that endpoint 1 will be "clear-halted" twice, because that's what is done to both endpoints after the "message" went out.

Anyway, it works and I'll keep the parameters exactly like posted.

Thanks again!



Offline

Display posts from previous:  Sort by:

All times are UTC+02:00
Page 1 of 1
4 posts
Users browsing this forum: No registered users and 1 guest
Search for:
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
cron