Dymo LabelManager PnP - FreeBSD
Hardware info on main page.
Links
Local links
core1, core1 - FreeBSD,
History
2018-01-27: c1 - ada2p2 - ok, after a lot of mumbo jumbo (holding down the button while plugging in the LabelManager, getting the light to flash quickly) running fsck_msdosfs on /dev/da0s1 and a trip into windows with a new program, it finally looks like the printer works again:
Jan 27 23:29:29 kg-core1 kernel: ugen3.4: <vendor 0x0922> at usbus3 Jan 27 23:29:29 kg-core1 devd: Executing 'chgrp cups /dev/ugen3.4; chmod g+rw /dev/ugen3.4' Jan 27 23:29:29 kg-core1 kernel: ulpt0: <vendor 0x0922 DYMO LabelManager PnP, class 0/0, rev 2.00/1.00, addr 4> on usbus3 Jan 27 23:29:29 kg-core1 kernel: ulpt0: using bi-directional mode Jan 27 23:29:29 kg-core1 kernel: umass0: <vendor 0x0922 DYMO LabelManager PnP, class 0/0, rev 2.00/1.00, addr 4> on usbus3 Jan 27 23:29:29 kg-core1 kernel: umass0: SCSI over Bulk-Only; quirks = 0x0000 Jan 27 23:29:29 kg-core1 kernel: umass0:7:0:-1: Attached to scbus7 Jan 27 23:29:29 kg-core1 kernel: uhid0: <vendor 0x0922 DYMO LabelManager PnP, class 0/0, rev 2.00/1.00, addr 4> on usbus3 Jan 27 23:29:29 kg-core1 kernel: da0 at umass-sim0 bus 0 scbus7 target 0 lun 0 Jan 27 23:29:29 kg-core1 kernel: da0: <DYMO PnP 1.00> Removable Direct Access SCSI device Jan 27 23:29:29 kg-core1 kernel: da0: Serial Number 08444603042014 Jan 27 23:29:29 kg-core1 kernel: da0: 1.000MB/s transfers Jan 27 23:29:29 kg-core1 kernel: da0: 3MB (8191 512 byte sectors) Jan 27 23:29:29 kg-core1 kernel: da0: quirks=0x2<NO_6_BYTE>
device nodes
root@kg-core1# ls -l /dev/da* /dev/ul* crw-r----- 1 root operator 0x8a Jan 27 23:29 /dev/da0 crw-r----- 1 root operator 0x92 Jan 27 23:29 /dev/da0s1 crw-rw---- 1 root operator 0xa6 Jan 27 23:29 /dev/ulpt0
and, finally, dymoprint
tingo@kg-core1$ dymoprint "ASRock BeeBox-S" [96, 0, 18, 28, 12, 152, 0, 0]
which prints this time. Phew!
2018-01-27: v2 - ad4s2a - which runs the ancient FreeBSD 8.4-stable
root@kg-v2# uname -a FreeBSD kg-v2.kg4.no 8.4-STABLE FreeBSD 8.4-STABLE #8 r288306: Sun Sep 27 13:35:38 CEST 2015 root@kg-v2.kg4.no:/usr/obj/usr/src/sys/GENERIC amd64
but it disconnects there too.
Jan 27 21:38:53 kg-v2 kernel: ugen0.3: <vendor 0x0922> at usbus0 Jan 27 21:38:53 kg-v2 kernel: uhid0: <vendor 0x0922 DYMO LabelManager PnP, class 0/0, rev 2.00/1.00, addr 3> on usbus0 Jan 27 21:38:53 kg-v2 kernel: umass0: <vendor 0x0922 DYMO LabelManager PnP, class 0/0, rev 2.00/1.00, addr 3> on usbus0 Jan 27 21:38:53 kg-v2 kernel: umass0: SCSI over Bulk-Only; quirks = 0x0000 Jan 27 21:38:53 kg-v2 kernel: umass0:0:0:-1: Attached to scbus0 Jan 27 21:38:53 kg-v2 kernel: da0 at umass-sim0 bus 0 scbus0 target 0 lun 0 Jan 27 21:38:53 kg-v2 kernel: da0: <DYMO PnP 1.00> Removable Direct Access SCSI-0 device Jan 27 21:38:53 kg-v2 kernel: da0: 1.000MB/s transfers Jan 27 21:38:53 kg-v2 kernel: da0: 3MB (8191 512 byte sectors: 64H 32S/T 3C) Jan 27 21:38:53 kg-v2 kernel: da0: quirks=0x2<NO_6_BYTE> Jan 27 21:38:56 kg-v2 kernel: ugen0.3: <vendor 0x0922> at usbus0 (disconnected) Jan 27 21:38:56 kg-v2 kernel: uhid0: at uhub0, port 3, addr 3 (disconnected) Jan 27 21:38:56 kg-v2 kernel: umass0: at uhub0, port 3, addr 3 (disconnected) Jan 27 21:38:56 kg-v2 kernel: (da0:umass-sim0:0:0:0): lost device - 0 outstanding, 0 refs Jan 27 21:38:56 kg-v2 kernel: (da0:umass-sim0:0:0:0): removing device entry
Strange, perhaps the printer is broken.
2018-01-27: quiet - ada0p7 - (for good measure) I tested on quiet, which runs FreeBSD 10.3-release
root@kg-quiet# freebsd-version -ku 10.3-RELEASE-p20 10.3-RELEASE-p21 root@kg-quiet# uname -a FreeBSD kg-quiet.kg4.no 10.3-RELEASE-p20 FreeBSD 10.3-RELEASE-p20 #0: Wed Jul 12 03:13:07 UTC 2017 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64
and it detaches there too
Jan 27 21:32:38 kg-quiet kernel: ugen2.2: <vendor 0x0922> at usbus2 Jan 27 21:32:40 kg-quiet kernel: ugen2.2: <vendor 0x0922> at usbus2 (disconnected) Jan 27 21:32:45 kg-quiet kernel: ugen2.2: <vendor 0x0922> at usbus2 Jan 27 21:32:45 kg-quiet devd: Executing 'chgrp cups /dev/ugen2.2; chmod g+rw /dev/ugen2.2' Jan 27 21:32:45 kg-quiet kernel: umass0: <vendor 0x0922 DYMO LabelManager PnP, class 0/0, rev 2.00/1.00, addr 2> on usbus2 Jan 27 21:32:45 kg-quiet kernel: umass0: SCSI over Bulk-Only; quirks = 0x0000 Jan 27 21:32:45 kg-quiet kernel: umass0:6:0:-1: Attached to scbus6 Jan 27 21:32:45 kg-quiet kernel: da0 at umass-sim0 bus 0 scbus6 target 0 lun 0 Jan 27 21:32:45 kg-quiet kernel: da0: <DYMO PnP 1.00> Removable Direct Access SCSI device Jan 27 21:32:45 kg-quiet kernel: da0: Serial Number 08444603042014 Jan 27 21:32:45 kg-quiet kernel: da0: 1.000MB/s transfers Jan 27 21:32:45 kg-quiet kernel: da0: 3MB (8191 512 byte sectors) Jan 27 21:32:45 kg-quiet kernel: da0: quirks=0x2<NO_6_BYTE> Jan 27 21:32:45 kg-quiet devd: Executing 'kldload -n ulpt' Jan 27 21:32:45 kg-quiet devd: Executing 'kldload -n uhid' Jan 27 21:32:45 kg-quiet kernel: ulpt0: <vendor 0x0922 DYMO LabelManager PnP, class 0/0, rev 2.00/1.00, addr 2> on usbus2 Jan 27 21:32:45 kg-quiet kernel: ulpt0: using bi-directional mode Jan 27 21:32:45 kg-quiet devd: Executing 'kldload -n uhid' Jan 27 21:32:45 kg-quiet kernel: uhid0: <vendor 0x0922 DYMO LabelManager PnP, class 0/0, rev 2.00/1.00, addr 2> on usbus2 Jan 27 21:32:47 kg-quiet kernel: ugen2.2: <vendor 0x0922> at usbus2 (disconnected) Jan 27 21:32:47 kg-quiet kernel: ulpt0: at uhub2, port 4, addr 2 (disconnected) Jan 27 21:32:47 kg-quiet kernel: umass0: at uhub2, port 4, addr 2 (disconnected) Jan 27 21:32:47 kg-quiet kernel: da0 at umass-sim0 bus 0 scbus6 target 0 lun 0 Jan 27 21:32:47 kg-quiet kernel: da0: <DYMO PnP 1.00> s/n 08444603042014 detached Jan 27 21:32:47 kg-quiet kernel: (da0:umass-sim0:0:0:0): Periph destroyed Jan 27 21:32:47 kg-quiet kernel: uhid0: at uhub2, port 4, addr 2 (disconnected)
double crap.
2018-01-27: v7 - ada1p4 - tested on v7 as well, which runs FreeBSD 11.1-stable
root@kg-v7# freebsd-version -ku 11.1-STABLE 11.1-STABLE root@kg-v7# uname -a FreeBSD kg-v7.kg4.no 11.1-STABLE FreeBSD 11.1-STABLE #0 r326918: Mon Dec 18 01:54:52 CET 2017 root@kg-v7.kg4.no:/usr/obj/usr/src/sys/GENERIC amd64
from /var/log/messages
Jan 27 21:26:15 kg-v7 kernel: ugen0.3: <vendor 0x0922 DYMO LabelManager PnP> at usbus0 Jan 27 21:26:17 kg-v7 kernel: ugen0.3: <vendor 0x0922 DYMO LabelManager PnP> at usbus0 (disconnected) Jan 27 21:26:21 kg-v7 kernel: ugen0.3: <vendor 0x0922 DYMO LabelManager PnP> at usbus0 Jan 27 21:26:21 kg-v7 kernel: umass0 on uhub2 Jan 27 21:26:21 kg-v7 kernel: umass0: <vendor 0x0922 DYMO LabelManager PnP, class 0/0, rev 2.00/1.00, addr 3> on usbus0 Jan 27 21:26:21 kg-v7 kernel: umass0: SCSI over Bulk-Only; quirks = 0x0000 Jan 27 21:26:21 kg-v7 kernel: umass0:7:0: Attached to scbus7 Jan 27 21:26:21 kg-v7 kernel: da0 at umass-sim0 bus 0 scbus7 target 0 lun 0 Jan 27 21:26:21 kg-v7 kernel: da0: <DYMO PnP 1.00> Removable Direct Access SCSI device Jan 27 21:26:21 kg-v7 kernel: da0: Serial Number 08444603042014 Jan 27 21:26:21 kg-v7 kernel: da0: 1.000MB/s transfers Jan 27 21:26:21 kg-v7 kernel: da0: 3MB (8191 512 byte sectors) Jan 27 21:26:21 kg-v7 kernel: da0: quirks=0x2<NO_6_BYTE> Jan 27 21:26:21 kg-v7 kernel: ulpt0 on uhub2 Jan 27 21:26:21 kg-v7 kernel: ulpt0: <vendor 0x0922 DYMO LabelManager PnP, class 0/0, rev 2.00/1.00, addr 3> on usbus0 Jan 27 21:26:21 kg-v7 kernel: ulpt0: using bi-directional mode Jan 27 21:26:21 kg-v7 kernel: uhid0 on uhub2 Jan 27 21:26:21 kg-v7 kernel: uhid0: <vendor 0x0922 DYMO LabelManager PnP, class 0/0, rev 2.00/1.00, addr 3> on usbus0 Jan 27 21:26:23 kg-v7 kernel: ugen0.3: <vendor 0x0922 DYMO LabelManager PnP> at usbus0 (disconnected) Jan 27 21:26:23 kg-v7 kernel: ulpt0: at uhub2, port 4, addr 3 (disconnected) Jan 27 21:26:23 kg-v7 kernel: ulpt0: detached Jan 27 21:26:23 kg-v7 kernel: umass0: at uhub2, port 4, addr 3 (disconnected) Jan 27 21:26:23 kg-v7 kernel: da0 at umass-sim0 bus 0 scbus7 target 0 lun 0 Jan 27 21:26:23 kg-v7 kernel: da0: <DYMO PnP 1.00> s/n 08444603042014 detached Jan 27 21:26:23 kg-v7 kernel: (da0:umass-sim0:0:0:0): Periph destroyed Jan 27 21:26:23 kg-v7 kernel: umass0: detached Jan 27 21:26:23 kg-v7 kernel: uhid0: at uhub2, port 4, addr 3 (disconnected) Jan 27 21:26:23 kg-v7 kernel: uhid0: detached
hmm, no go there either.
2018-01-27: c1 - ada2p2 - unfortunately the LabelManager disconnects from the bus. From /var/log/messages:
Jan 27 21:02:29 kg-core1 kernel: ugen3.4: <vendor 0x0922> at usbus3 Jan 27 21:02:29 kg-core1 devd: Executing 'chgrp cups /dev/ugen3.4; chmod g+rw /dev/ugen3.4' Jan 27 21:02:29 kg-core1 kernel: ulpt0: <vendor 0x0922 DYMO LabelManager PnP, class 0/0, rev 2.00/1.00, addr 4> on usbus3 Jan 27 21:02:29 kg-core1 kernel: ulpt0: using bi-directional mode Jan 27 21:02:29 kg-core1 kernel: umass0: <vendor 0x0922 DYMO LabelManager PnP, class 0/0, rev 2.00/1.00, addr 4> on usbus3 Jan 27 21:02:29 kg-core1 kernel: umass0: SCSI over Bulk-Only; quirks = 0x0000 Jan 27 21:02:29 kg-core1 kernel: umass0:7:0:-1: Attached to scbus7 Jan 27 21:02:29 kg-core1 kernel: uhid0: <vendor 0x0922 DYMO LabelManager PnP, class 0/0, rev 2.00/1.00, addr 4> on usbus3 Jan 27 21:02:29 kg-core1 kernel: da0 at umass-sim0 bus 0 scbus7 target 0 lun 0 Jan 27 21:02:29 kg-core1 kernel: da0: <DYMO PnP 1.00> Removable Direct Access SCSI device Jan 27 21:02:29 kg-core1 kernel: da0: Serial Number 08444603042014 Jan 27 21:02:29 kg-core1 kernel: da0: 1.000MB/s transfers Jan 27 21:02:29 kg-core1 kernel: da0: 3MB (8191 512 byte sectors) Jan 27 21:02:29 kg-core1 kernel: da0: quirks=0x2<NO_6_BYTE> Jan 27 21:02:31 kg-core1 kernel: ugen3.4: <vendor 0x0922> at usbus3 (disconnected) Jan 27 21:02:31 kg-core1 kernel: ulpt0: at uhub8, port 3, addr 4 (disconnected) Jan 27 21:02:31 kg-core1 kernel: umass0: at uhub8, port 3, addr 4 (disconnected) Jan 27 21:02:31 kg-core1 kernel: da0 at umass-sim0 bus 0 scbus7 target 0 lun 0 Jan 27 21:02:31 kg-core1 kernel: da0: <DYMO PnP 1.00> s/n 08444603042014 detached Jan 27 21:02:31 kg-core1 kernel: (da0:umass-sim0:0:0:0): Periph destroyed Jan 27 21:02:31 kg-core1 kernel: uhid0: at uhub8, port 3, addr 4 (disconnected)
crap. c1 runs
root@kg-core1# freebsd-version -ku 10.3-STABLE 10.3-STABLE root@kg-core1# uname -a FreeBSD kg-core1.kg4.no 10.3-STABLE FreeBSD 10.3-STABLE #0 r310083: Wed Dec 14 21:00:13 CET 2016 root@kg-core1.kg4.no:/usr/obj/usr/src/sys/GENERIC amd64
ok.
2018-01-27: c1 - ada2p2 - a lot has changed. First, I added necessary lines to usb_modeswitch.conf
root@kg-core1# tail -13 /usr/local/etc/usb_modeswitch.conf # Dymo LabelManager PnP DefaultVendor= 0x0922 DefaultProduct=0x1001 TargetVendor= 0x0922 TargetProduct= 0x1002 MessageEndpoint= 0x01 ResponseEndpoint=0x01 MessageContent="1b5a01"
ok.
2017-05-16: c1 - ada2p2 - the power LED on the LabelManager PnP was blinking, so I disconnected the printer
May 16 21:39:16 kg-core1 kernel: ugen3.3: <vendor 0x0922> at usbus3 (disconnected) May 16 21:39:16 kg-core1 kernel: ulpt0: at uhub8, port 3, addr 3 (disconnected) May 16 21:39:16 kg-core1 kernel: umass0: at uhub8, port 3, addr 3 (disconnected)
and reconnected it
May 16 21:40:19 kg-core1 kernel: ugen3.3: <vendor 0x0922> at usbus3 May 16 21:40:19 kg-core1 kernel: ulpt0: <vendor 0x0922 DYMO LabelManager PnP, class 0/0, rev 2.00/1.00, addr 3> on usbus3 May 16 21:40:19 kg-core1 kernel: ulpt0: using bi-directional mode May 16 21:40:19 kg-core1 kernel: umass0: <vendor 0x0922 DYMO LabelManager PnP, class 0/0, rev 2.00/1.00, addr 3> on usbus3 May 16 21:40:19 kg-core1 kernel: umass0: SCSI over Bulk-Only; quirks = 0x0000 May 16 21:40:19 kg-core1 kernel: umass0:7:0:-1: Attached to scbus7 May 16 21:40:19 kg-core1 kernel: uhid0: <vendor 0x0922 DYMO LabelManager PnP, class 0/0, rev 2.00/1.00, addr 3> on usbus3 May 16 21:40:19 kg-core1 kernel: da0 at umass-sim0 bus 0 scbus7 target 0 lun 0 May 16 21:40:19 kg-core1 kernel: da0: <DYMO PnP 1.00> Removable Direct Access SCSI device May 16 21:40:19 kg-core1 kernel: da0: Serial Number 08444603042014 May 16 21:40:19 kg-core1 kernel: da0: 1.000MB/s transfers May 16 21:40:19 kg-core1 kernel: da0: 3MB (8191 512 byte sectors) May 16 21:40:19 kg-core1 kernel: da0: quirks=0x2<NO_6_BYTE>
I wonder if that will improve things. BTW, the power LED lights steady now.
Try a print:
tingo@kg-core1$ dymoprint "F25 Xfce" "LiveUSB" [96, 0, 18, 45, 12, 198, 0, 0]
yes, that worked. Nice!
2017-04-02: c1 - ada2p2 - dymoprint wasn't working today, so I switched the printer off and on with the button. Permissions on /dev/ulpt0 looks correct:
root@kg-core1# ll /dev/ul* crw-rw---- 1 root operator 0xda Apr 2 12:06 /dev/ulpt0
but dymoprint still hangs:
tingo@kg-core1$ dymoprint "F25 Xfce" "LiveUSB" (hangs)
I wonder what has changed in Python this time?
2017-01-10: c1 - ada2p2 - for some reason, the mode on /dev/ulpt0 had changed, so dymoprint complained:
tingo@kg-core1$ dymoprint You do not have sufficient access to the device file /dev/ulpt0: crw-r--r-- 1 root operator 0x71 Dec 14 22:03 /dev/ulpt0 You probably want to add a rule in /etc/udev/rules.d along the following lines: SUBSYSTEM=="hidraw", ACTION=="add", ATTRS{idVendor}=="0922", ATTRS{idProduct}=="1002", GROUP="plugdev" Following that, turn off your device and back on again to activate the new permissions. root@kg-core1# ls -l /dev/ulpt* crw-r--r-- 1 root operator 0xe2 Jan 10 19:54 /dev/ulpt0
but both /etc/devfs.rules and /etc/rc.conf was correct, so I just restarted devfs:
root@kg-core1# service devfs restart
after that permissions are back to the usual
root@kg-core1# ll /dev/ul* crw-rw---- 1 root operator 0xe2 Jan 10 19:54 /dev/ulpt0
After that, writing labels work again
tingo@kg-core1$ dymoprint "Pixel x86" "1.1 2016-12-13" [96, 0, 2, 5, 12, 92, 0, 0]
ok.
2016-11-19: c1 - ada0p2 - wrote labels for the power adapter of my Steam Machine:
tingo@kg-core1$ dymoprint "Zotac SN970" "Steam Machine" [96, 0, 2, 30, 12, 157, 0, 0] tingo@kg-core1$ dymoprint "Zotac SN970" "Steam Machine" [96, 0, 2, 30, 12, 157, 0, 0]
ok.
2016-11-19: c1 - ada0p2 - wrote labels for the power adapter of my new scanner:
tingo@kg-core1$ dymoprint "CZUR ET16" "scanner" [96, 0, 2, 29, 12, 155, 0, 0] tingo@kg-core1$ dymoprint "CZUR ET16" "scanner" [96, 0, 2, 29, 12, 154, 0, 0]
one for each direction.
2016-10-25: c1 - ada0p2 - (the printer is always on now) - wrote a label:
tingo@kg-core1$ dymoprint "FreeBSD" "10.3-RELEASE" [96, 0, 2, 46, 12, 199, 0, 0]
for a usb memory stick.
2016-05-16: c1 - ada0p2 - turned on the printer and wrote labels:
tingo@kg-core1$ dymoprint "Asus" "BeeBox N3150" [96, 0, 18, 100, 13, 250, 0, 0] tingo@kg-core1$ dymoprint "Asus" "BeeBox N3150" [96, 0, 18, 100, 13, 250, 0, 0] tingo@kg-core1$ dymoprint "Asus" "BeeBox N3150" [96, 0, 18, 100, 13, 251, 0, 0]
for power adapter.
2016-03-31: c1 - ada0p2 - turned on the printer, now dymoprint is broken:
tingo@kg-core1$ dymoprint "Bitraf" "switch 1" Traceback (most recent call last): File "/home/tingo/bin/dymoprint", line 314, in <module> main() File "/home/tingo/bin/dymoprint", line 290, in main labelstream = labelrotated.tostring() File "/usr/local/lib/python2.7/site-packages/PIL/Image.py", line 695, in tostring "Please call tobytes() instead.") Exception: tostring() has been removed. Please call tobytes() instead.
Hmm, is it the py-pillow package that is broken?
root@kg-core1# pv *pillow* [Reading data from pkg(8) ... - 835 packages found - done] py27-pillow-3.1.1 = up-to-date with port
try a reinstall Nope, that didn't help. A closer look: the tostring() call is actually in dymoprint. Changing it as the error message suggests makes dymoprint work again:
tingo@kg-core1$ dymoprint "Bitraf" "switch 1" [96, 0, 2, 100, 13, 255, 0, 0]
good.
2016-02-14: c1 - ada0p2 - turned on the printer and wrote labels:
tingo@kg-core1$ dymoprint "Squeezebox V3" [96, 0, 18, 100, 14, 5, 0, 0] tingo@kg-core1$ dymoprint "Squeezebox V3" [96, 0, 18, 100, 14, 1, 0, 0]
a bit large, but they fit on the new power adapter.
2015-12-06: ada0p2 - turned on the printer and wrote labels:
tingo@kg-core1$ dymoprint "Toshiba" "Satellite Z30-B-10W" "recovery" [96, 0, 2, 100, 14, 4, 0, 0]
nice.
2015-10-29: ada0p2 - today I simply turned on the printer and wrote a label (or three):
tingo@kg-core1$ dymoprint "Shuttle XH61V" [96, 0, 18, 100, 13, 253, 0, 0]
jolly good!
2015-09-11: ada0p2 - today I simply turned on the printer and wrote a label (or two):
tingo@kg-core1$ which dymoprint /home/tingo/bin/dymoprint tingo@kg-core1$ dymoprint "Asus" "BeeBox N3000" [96, 0, 18, 100, 13, 224, 0, 0]
nice.
2015-03-28: ada0p2 - the Dymo Labelmanager PnP didn't create the ulpt0 device when i turned it on today. This is on my workstation, which runs:
tingo@kg-core1$ uname -a FreeBSD kg-core1.kg4.no 9.3-STABLE FreeBSD 9.3-STABLE #0 r273918: Fri Oct 31 22:52:44 CET 2014 root@kg-core1.kg4.no:/usr/obj/usr/src/sys/GENERIC amd64
Ok, no problem, I just run the usb_modeswitch again:
root@kg-core1# usb_modeswitch -c /usr/local/etc/usb_modeswitch.conf Looking for target devices ... No devices in target mode or class found Looking for default devices ... found matching product ID adding device Found device in default mode, class or configuration (1) Accessing device 013 on bus 000 ... Getting the current device configuration ... OK, got current device configuration (1) Using first interface: 0x00 Using endpoints 0x01 (out) and 0x01 (in) Not a storage device, skipping SCSI inquiry USB description data (for identification) ------------------------- Manufacturer: Product: DYMO LabelManager PnP Serial No.: 08444603042014 ------------------------- Cant't do driver detection and detaching on this platform. Setting up communication with interface 0 Using endpoint 0x01 for message sending ... Trying to send message 1 to endpoint 0x01 ... OK, message successfully sent Resetting response endpoint 0x01 Resetting message endpoint 0x01 -> Run lsusb to note any changes. Bye.
afterwards, the device is there:
root@kg-core1# ls -l /dev/ulp* crw-r--r-- 1 root operator 0xd5 Mar 28 22:25 /dev/ulpt0
and I can run dymoprint again (I copied my modified version to ~/bin for easy access):
tingo@kg-core1$ dymoprint You do not have sufficient access to the device file /dev/ulpt0: crw-r--r-- 1 root operator 0xc4 Mar 28 22:33 /dev/ulpt0 You probably want to add a rule in /etc/udev/rules.d along the following lines: SUBSYSTEM=="hidraw", ACTION=="add", ATTRS{idVendor}=="0922", ATTRS{idProduct}=="1002", GROUP="plugdev" Following that, turn off your device and back on again to activate the new permissions.
after adding this line to /etc/devfs.rules:
add path 'ulpt*' mode 0660
and restarting devfs:
root@kg-core1# service devfs restart
the device shows up with the correct permissions:
root@kg-core1# ll /dev/ulpt0 crw-rw---- 1 root operator 0xc4 Mar 28 22:38 /dev/ulpt0
and I can finally print:
tingo@kg-core1$ dymoprint rEFInd Traceback (most recent call last): File "/home/tingo/bin/dymoprint", line 313, in <module> main() File "/home/tingo/bin/dymoprint", line 276, in main font = ImageFont.truetype(FONT_FILENAME, fontsize) File "/usr/local/lib/python2.7/site-packages/PIL/ImageFont.py", line 240, in truetype return FreeTypeFont(font, size, index, encoding) File "/usr/local/lib/python2.7/site-packages/PIL/ImageFont.py", line 137, in __init__ self.font = core.getfont(font, size, index, encoding) IOError: cannot open resource
or not. It looks like the font has changed location again:
tingo@kg-core1$ grep ^FONT_FILENAME ~/bin/dymoprint FONT_FILENAME = '/usr/local/lib/X11/fonts/bitstream-vera/Vera.ttf' tingo@kg-core1$ locate Vera.ttf /usr/local/share/fonts/bitstream-vera/Vera.ttf
ok, easy to fix:
tingo@kg-core1$ dymoprint rEFInd [96, 0, 2, 100, 13, 247, 0, 0]
finally.
2014-12-09: wow, brainfart about the last try. Trying this instead:
root@kg-core1# grep ^DEV_NODE dymoprint2 DEV_NODE = "/dev/ulpt0"
I get this:
root@kg-core1# python dymoprint2 "4port USB2.0 hub" "38-5663" [96, 0, 18, 100, 13, 220, 0, 0]
and a nice printout. Woohoo!
2014-12-05: more dymoprint testing. If I set DEV_NODE like this:
tingo@kg-core1$ grep ^DEV_NODE dymoprint2 DEV_NODE = "/dev/ugen3.4"
I get this:
tingo@kg-core1$ python dymoprint2 You do not have sufficient access to the device file /dev/ugen3.4: lrwxr-xr-x 1 root wheel 9 Dec 5 19:43 /dev/ugen3.4 -> usb/3.4.0 You probably want to add a rule in /etc/udev/rules.d along the following lines: SUBSYSTEM=="hidraw", ACTION=="add", ATTRS{idVendor}=="0922", ATTRS{idProduct}=="1002", GROUP="plugdev" Following that, turn off your device and back on again to activate the new permissions.
cool. After fixing device permissions and adding myself to the cups group, I get this:
root@kg-core1# python dymoprint2 No label text was specified.
Hmm, working?
root@kg-core1# python dymoprint2 "4port USB2.0 hub" "38-5663" Traceback (most recent call last): File "dymoprint2", line 312, in <module> main() File "dymoprint2", line 275, in main font = ImageFont.truetype(FONT_FILENAME, fontsize) File "/usr/local/lib/python2.7/site-packages/PIL/ImageFont.py", line 240, in truetype return FreeTypeFont(font, size, index, encoding) File "/usr/local/lib/python2.7/site-packages/PIL/ImageFont.py", line 137, in __init__ self.font = core.getfont(font, size, index, encoding) IOError: cannot open resource
Ok, missing the bitstream-vera font. Adjusted the script for the correct location of the font:
root@kg-core1# grep ^FONT_FILENAME dymoprint2 FONT_FILENAME = '/usr/local/lib/X11/fonts/bitstream-vera/Vera.ttf'
but still I get this:
root@kg-core1# python dymoprint2 test Traceback (most recent call last): File "dymoprint2", line 313, in <module> main() File "dymoprint2", line 309, in main lm.printLabel(labelmatrix, dottab) File "dymoprint2", line 183, in printLabel response = self.sendCommand() File "dymoprint2", line 80, in sendCommand responseBin = self.dev.read(8) IOError: [Errno 5] Input/output error
ow, I'm tired.
2014-12-05: try with the dymoprint script:
tingo@kg-core1$ python dymoprint Traceback (most recent call last): File "dymoprint", line 30, in <module> import Image ImportError: No module named Image
ok, missing something. After fixing the script a bit:
tingo@kg-core1$ diff -u dymoprint_org dymoprint --- dymoprint_org 2014-11-29 13:00:54.000000000 +0100 +++ dymoprint 2014-12-05 21:29:12.000000000 +0100 @@ -27,9 +27,9 @@ VERSION = "0.1.0 (2013-07-09)" -import Image -import ImageDraw -import ImageFont +from PIL import Image +from PIL import ImageDraw +from PIL import ImageFont import array import fcntl import os @@ -196,7 +196,8 @@ def getDeviceFile(classID, vendorID, productID): # find file containing the device's major and minor numbers - searchdir = '/sys/bus/hid/devices' + # searchdir = '/sys/bus/hid/devices' + searchdir = '/dev/usb' pattern = '^%04d:%04X:%04X.[0-9A-F]{4}$' % (classID, vendorID, productID) deviceCandidates = os.listdir(searchdir) foundpath = None
I'm here:
tingo@kg-core1$ python dymoprint The device 'Dymo LabelManager PnP' could not be found on this system.
better than nothing.
Oh, BTW, usbconfig can do this too:
root@kg-core1# usbconfig -d ugen3.4 show_ifdrv ugen3.4: <DYMO LabelManager PnP vendor 0x0922> at usbus3, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (500mA) ugen3.4.0: ulpt0: <vendor 0x0922 DYMO LabelManager PnP, class 0/0, rev 2.00/1.00, addr 4> ugen3.4.1: umass0: <vendor 0x0922 DYMO LabelManager PnP, class 0/0, rev 2.00/1.00, addr 4> ugen3.4.2: uhid0: <vendor 0x0922 DYMO LabelManager PnP, class 0/0, rev 2.00/1.00, addr 4>
which is useful.
2014-12-05: after installing usb_modeswich:
root@kg-core1# usb_modeswitch -e * usb_modeswitch: handle USB devices with multiple modes * Version 1.2.1 (C) Josua Dietze 2011 * Based on libusb0 (0.1.12 and above) ! PLEASE REPORT NEW CONFIGURATIONS ! I created this config file: root@kg-core1# more /usr/local/etc/usb_modeswitch.conf # Configuration for the usb_modeswitch package, a mode switching tool for # USB devices providing multiple states or modes # # Evaluated by the wrapper script /usr/sbin/usb_modeswitch_dispatcher # # To enable an option, set it to "1", "yes" or "true" (case doesn't matter) # Everything else counts as "disable" # Disable automatic mode switching globally (e.g. to access the original # install storage) DisableSwitching=0 # Enable logging (results in a extensive report file in /var/log, named # "usb_modeswitch_<interface-name>" and probably others EnableLogging=0 # Dymo LabelManager PnP DefaultVendor= 0x0922 DefaultProduct=0x1001 TargetVendor= 0x0922 TargetProduct= 0x1002 MessageEndpoint= 0x01 ResponseEndpoint=0x01 MessageContent="1b5a01"
(only the lines from # Dymo ..., the other was there from the install)
Now, will it switch?
root@kg-core1# usb_modeswitch -c /usr/local/etc/usb_modeswitch.conf Looking for target devices ... No devices in target mode or class found Looking for default devices ... found matching product ID adding device Found device in default mode, class or configuration (1) Accessing device 011 on bus 000 ... Getting the current device configuration ... OK, got current device configuration (1) Using first interface: 0x00 Using endpoints 0x01 (out) and 0x01 (in) Not a storage device, skipping SCSI inquiry USB description data (for identification) ------------------------- Manufacturer: Product: DYMO LabelManager PnP Serial No.: 08444603042014 ------------------------- Cant't do driver detection and detaching on this platform. Setting up communication with interface 0 Using endpoint 0x01 for message sending ... Trying to send message 1 to endpoint 0x01 ... OK, message successfully sent Resetting response endpoint 0x01 Resetting message endpoint 0x01 -> Run lsusb to note any changes. Bye.
it did something at least. From /var/log/messages:
Dec 5 19:42:15 kg-core1 kernel: ugen3.4: <vendor 0x0922> at usbus3 Dec 5 19:42:15 kg-core1 kernel: ulpt0: <vendor 0x0922 DYMO LabelManager PnP, class 0/0, rev 2.00/1.00, addr 4> on usbus3 Dec 5 19:42:15 kg-core1 kernel: ulpt0: using bi-directional mode Dec 5 19:42:15 kg-core1 kernel: umass0: <vendor 0x0922 DYMO LabelManager PnP, class 0/0, rev 2.00/1.00, addr 4> on usbus3 Dec 5 19:42:15 kg-core1 kernel: umass0: SCSI over Bulk-Only; quirks = 0x0000 Dec 5 19:42:15 kg-core1 kernel: umass0:7:0:-1: Attached to scbus7 Dec 5 19:42:15 kg-core1 kernel: uhid0: <vendor 0x0922 DYMO LabelManager PnP, class 0/0, rev 2.00/1.00, addr 4> on usbus3 Dec 5 19:42:15 kg-core1 kernel: da0 at umass-sim0 bus 0 scbus7 target 0 lun 0 Dec 5 19:42:15 kg-core1 kernel: da0: <DYMO PnP 1.00> Removable Direct Access SCSI-0 device Dec 5 19:42:15 kg-core1 kernel: da0: Serial Number 08444603042014 Dec 5 19:42:15 kg-core1 kernel: da0: 1.000MB/s transfers Dec 5 19:42:15 kg-core1 kernel: da0: 3MB (8191 512 byte sectors: 64H 32S/T 3C) Dec 5 19:42:15 kg-core1 kernel: da0: quirks=0x2<NO_6_BYTE>
looks good. For good measure, usb config:
root@kg-core1# usbconfig -d ugen3.4 ugen3.4: <DYMO LabelManager PnP vendor 0x0922> at usbus3, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (500mA) root@kg-core1# usbconfig -d ugen3.4 dump_device_descugen3.4: <DYMO LabelManager PnP vendor 0x0922> at usbus3, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (500mA) bLength = 0x0012 bDescriptorType = 0x0001 bcdUSB = 0x0200 bDeviceClass = 0x0000 bDeviceSubClass = 0x0000 bDeviceProtocol = 0x0000 bMaxPacketSize0 = 0x0040 idVendor = 0x0922 idProduct = 0x1002 bcdDevice = 0x0100 iManufacturer = 0x0001 <> iProduct = 0x0002 <DYMO LabelManager PnP> iSerialNumber = 0x0003 <08444603042014> bNumConfigurations = 0x0001
and usb current config
root@kg-core1# usbconfig -d ugen3.4 dump_curr_config_desc ugen3.4: <DYMO LabelManager PnP vendor 0x0922> at usbus3, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (500mA) Configuration index 0 bLength = 0x0009 bDescriptorType = 0x0002 wTotalLength = 0x0057 bNumInterfaces = 0x0003 bConfigurationValue = 0x0001 iConfiguration = 0x0000 <no string> bmAttributes = 0x0080 bMaxPower = 0x00fa Interface 0 bLength = 0x0009 bDescriptorType = 0x0004 bInterfaceNumber = 0x0000 bAlternateSetting = 0x0000 bNumEndpoints = 0x0002 bInterfaceClass = 0x0007 bInterfaceSubClass = 0x0001 bInterfaceProtocol = 0x0002 iInterface = 0x0000 <no string> Endpoint 0 bLength = 0x0007 bDescriptorType = 0x0005 bEndpointAddress = 0x0085 <IN> bmAttributes = 0x0002 <BULK> wMaxPacketSize = 0x0040 bInterval = 0x0000 bRefresh = 0x0000 bSynchAddress = 0x0000 Endpoint 1 bLength = 0x0007 bDescriptorType = 0x0005 bEndpointAddress = 0x0005 <OUT> bmAttributes = 0x0002 <BULK> wMaxPacketSize = 0x0040 bInterval = 0x0000 bRefresh = 0x0000 bSynchAddress = 0x0000 Interface 1 bLength = 0x0009 bDescriptorType = 0x0004 bInterfaceNumber = 0x0001 bAlternateSetting = 0x0000 bNumEndpoints = 0x0002 bInterfaceClass = 0x0008 bInterfaceSubClass = 0x0006 bInterfaceProtocol = 0x0050 iInterface = 0x0000 <no string> Endpoint 0 bLength = 0x0007 bDescriptorType = 0x0005 bEndpointAddress = 0x0082 <IN> bmAttributes = 0x0002 <BULK> wMaxPacketSize = 0x0040 bInterval = 0x0000 bRefresh = 0x0000 bSynchAddress = 0x0000 Endpoint 1 bLength = 0x0007 bDescriptorType = 0x0005 bEndpointAddress = 0x0002 <OUT> bmAttributes = 0x0002 <BULK> wMaxPacketSize = 0x0040 bInterval = 0x0000 bRefresh = 0x0000 bSynchAddress = 0x0000 Interface 2 bLength = 0x0009 bDescriptorType = 0x0004 bInterfaceNumber = 0x0002 bAlternateSetting = 0x0000 bNumEndpoints = 0x0002 bInterfaceClass = 0x0003 bInterfaceSubClass = 0x0000 bInterfaceProtocol = 0x0000 iInterface = 0x0000 <no string> Additional Descriptor bLength = 0x09 bDescriptorType = 0x21 bDescriptorSubType = 0x11 RAW dump: 0x00 | 0x09, 0x21, 0x11, 0x01, 0x00, 0x01, 0x22, 0x22, 0x08 | 0x00 Endpoint 0 bLength = 0x0007 bDescriptorType = 0x0005 bEndpointAddress = 0x0081 <IN> bmAttributes = 0x0003 <INTERRUPT> wMaxPacketSize = 0x0040 bInterval = 0x000a bRefresh = 0x0000 bSynchAddress = 0x0000 Endpoint 1 bLength = 0x0007 bDescriptorType = 0x0005 bEndpointAddress = 0x0001 <OUT> bmAttributes = 0x0003 <INTERRUPT> wMaxPacketSize = 0x0040 bInterval = 0x000a bRefresh = 0x0000 bSynchAddress = 0x0000
cool.
2014-12-05: I connect the LabelManager PnP to my FreeBSD workstation (core1). The workstation runs:
tingo@kg-core1$ uname -a FreeBSD kg-core1.kg4.no 9.3-STABLE FreeBSD 9.3-STABLE #0 r273918: Fri Oct 31 22:52:44 CET 2014 root@kg-core1.kg4.no:/usr/obj/usr/src/sys/GENERIC amd64
when usb is connected, the (blue) power LED in the power switch on the printer lights up, and these entries shows up in /var/log/messages:
Dec 5 19:08:51 kg-core1 kernel: ugen3.4: <vendor 0x0922> at usbus3 Dec 5 19:08:51 kg-core1 kernel: uhid0: <vendor 0x0922 DYMO LabelManager PnP, class 0/0, rev 2.00/1.00, addr 4> on usbus3 Dec 5 19:08:51 kg-core1 kernel: umass0: <vendor 0x0922 DYMO LabelManager PnP, class 0/0, rev 2.00/1.00, addr 4> on usbus3 Dec 5 19:08:51 kg-core1 kernel: umass0: SCSI over Bulk-Only; quirks = 0x0000 Dec 5 19:08:51 kg-core1 kernel: umass0:7:0:-1: Attached to scbus7 Dec 5 19:08:51 kg-core1 kernel: da0 at umass-sim0 bus 0 scbus7 target 0 lun 0 Dec 5 19:08:51 kg-core1 kernel: da0: <DYMO PnP 1.00> Removable Direct Access SCSI-0 device Dec 5 19:08:51 kg-core1 kernel: da0: Serial Number 08444603042014 Dec 5 19:08:51 kg-core1 kernel: da0: 1.000MB/s transfers Dec 5 19:08:51 kg-core1 kernel: da0: 3MB (8191 512 byte sectors: 64H 32S/T 3C) Dec 5 19:08:51 kg-core1 kernel: da0: quirks=0x2<NO_6_BYTE>
Next up is usbconfig:
root@kg-core1# usbconfig -d ugen3.4 ugen3.4: <DYMO LabelManager PnP vendor 0x0922> at usbus3, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (500mA)
usb device description
root@kg-core1# usbconfig -d ugen3.4 dump_device_desc ugen3.4: <DYMO LabelManager PnP vendor 0x0922> at usbus3, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (500mA) bLength = 0x0012 bDescriptorType = 0x0001 bcdUSB = 0x0200 bDeviceClass = 0x0000 bDeviceSubClass = 0x0000 bDeviceProtocol = 0x0000 bMaxPacketSize0 = 0x0040 idVendor = 0x0922 idProduct = 0x1001 bcdDevice = 0x0100 iManufacturer = 0x0001 <> iProduct = 0x0002 <DYMO LabelManager PnP> iSerialNumber = 0x0003 <08444603042014> bNumConfigurations = 0x0001
usb current config:
root@kg-core1# usbconfig -d ugen3.4 dump_curr_config_desc ugen3.4: <DYMO LabelManager PnP vendor 0x0922> at usbus3, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (500mA) Configuration index 0 bLength = 0x0009 bDescriptorType = 0x0002 wTotalLength = 0x0040 bNumInterfaces = 0x0002 bConfigurationValue = 0x0001 iConfiguration = 0x0000 <no string> bmAttributes = 0x0080 bMaxPower = 0x00fa Interface 0 bLength = 0x0009 bDescriptorType = 0x0004 bInterfaceNumber = 0x0000 bAlternateSetting = 0x0000 bNumEndpoints = 0x0002 bInterfaceClass = 0x0003 bInterfaceSubClass = 0x0000 bInterfaceProtocol = 0x0000 iInterface = 0x0000 <no string> Additional Descriptor bLength = 0x09 bDescriptorType = 0x21 bDescriptorSubType = 0x11 RAW dump: 0x00 | 0x09, 0x21, 0x11, 0x01, 0x00, 0x01, 0x22, 0x22, 0x08 | 0x00 Endpoint 0 bLength = 0x0007 bDescriptorType = 0x0005 bEndpointAddress = 0x0081 <IN> bmAttributes = 0x0003 <INTERRUPT> wMaxPacketSize = 0x0040 bInterval = 0x000a bRefresh = 0x0000 bSynchAddress = 0x0000 Endpoint 1 bLength = 0x0007 bDescriptorType = 0x0005 bEndpointAddress = 0x0001 <OUT> bmAttributes = 0x0003 <INTERRUPT> wMaxPacketSize = 0x0040 bInterval = 0x000a bRefresh = 0x0000 bSynchAddress = 0x0000 Interface 1 bLength = 0x0009 bDescriptorType = 0x0004 bInterfaceNumber = 0x0001 bAlternateSetting = 0x0000 bNumEndpoints = 0x0002 bInterfaceClass = 0x0008 bInterfaceSubClass = 0x0006 bInterfaceProtocol = 0x0050 iInterface = 0x0000 <no string> Endpoint 0 bLength = 0x0007 bDescriptorType = 0x0005 bEndpointAddress = 0x0082 <IN> bmAttributes = 0x0002 <BULK> wMaxPacketSize = 0x0040 bInterval = 0x0000 bRefresh = 0x0000 bSynchAddress = 0x0000 Endpoint 1 bLength = 0x0007 bDescriptorType = 0x0005 bEndpointAddress = 0x0002 <OUT> bmAttributes = 0x0002 <BULK> wMaxPacketSize = 0x0040 bInterval = 0x0000 bRefresh = 0x0000 bSynchAddress = 0x0000
so far all.