Re: Is writing usb devices as files (via /dev/ugen*) supported in FreeBSD?

2014-12-09 Thread Torfinn Ingolfsen
On Mon, 08 Dec 2014 07:50:39 +0100
Hans Petter Selasky  wrote:

> 
> /dev/ugenX is not a stream. You should either consider using libusb or 
> /dev/ulptX .
> 

You are right (of course). Sorry about the brainfart. I changed the device in 
the script:
root@kg-core1# grep ^DEV_NODE dymoprint2
DEV_NODE   = "/dev/ulpt0"

and now it works:
root@kg-core1# python dymoprint2 "4port USB2.0 hub" "38-5663"
[96, 0, 18, 100, 13, 220, 0, 0]

(Tes, I get the printout too)
Thanks for the hint!
-- 
Torfinn Ingolfsen 
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: Is writing usb devices as files (via /dev/ugen*) supported in FreeBSD?

2014-12-07 Thread Hans Petter Selasky

On 12/07/14 23:52, Torfinn Ingolfsen wrote:

Hello,
Question: is writing to the device file (/dev/ugenX) with normal file calls 
supposed to work in FreeBSD?
(as in "everything is a file" in unix-like operating systems)

Background: I recently got a usb label printer for cheap: a Dymo LabelManager 
PnP[1]. I found the dymoprint[2] Python script, which works fairly well on 
Linux.
It works (AFAICT) by reading / writing the usb device as a regular file, via 
the device file.
You have to use usb_modeswitch[3] on the printer first, of course.


Hi,

/dev/ugenX is not a stream. You should either consider using libusb or 
/dev/ulptX .


If it is supposed to work with those devices, you should postfix the 
endpoint number:


/dev/usb/3.4.z

--HPS



Since we have all tools available on FreeBSD, I tried the setup on my FreeBSD 
workstation, which currently runs FreeBSD 9.3-stable:
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 r...@kg-core1.kg4.no:/usr/obj/usr/src/sys/GENERIC  amd64

The detection code in the dymoprint script doesn't work on FreeBSD, but setting 
the correct device via DEV_NODE in the script works:
tingo@kg-core1$ grep ^DEV_NODE dymoprint2
DEV_NODE   = "/dev/ugen3.4"

But when I run the script I just get an IO error:
root@kg-core1# python dymoprint2 test
Traceback (most recent call last):
   File "dymoprint2", line 313, in 
 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


References:
1) http://global.dymo.com/ieIE/Products/LabelManager_PnP.html
2) http://sbronner.com/dymoprint/
3) http://www.draisberghof.de/usb_modeswitch/



___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Is writing usb devices as files (via /dev/ugen*) supported in FreeBSD?

2014-12-07 Thread Torfinn Ingolfsen
Hello,
Question: is writing to the device file (/dev/ugenX) with normal file calls 
supposed to work in FreeBSD?
(as in "everything is a file" in unix-like operating systems)

Background: I recently got a usb label printer for cheap: a Dymo LabelManager 
PnP[1]. I found the dymoprint[2] Python script, which works fairly well on 
Linux.
It works (AFAICT) by reading / writing the usb device as a regular file, via 
the device file.
You have to use usb_modeswitch[3] on the printer first, of course.

Since we have all tools available on FreeBSD, I tried the setup on my FreeBSD 
workstation, which currently runs FreeBSD 9.3-stable:
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 r...@kg-core1.kg4.no:/usr/obj/usr/src/sys/GENERIC  amd64

The detection code in the dymoprint script doesn't work on FreeBSD, but setting 
the correct device via DEV_NODE in the script works:
tingo@kg-core1$ grep ^DEV_NODE dymoprint2
DEV_NODE   = "/dev/ugen3.4"

But when I run the script I just get an IO error:
root@kg-core1# python dymoprint2 test
Traceback (most recent call last):
  File "dymoprint2", line 313, in 
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


References:
1) http://global.dymo.com/ieIE/Products/LabelManager_PnP.html
2) http://sbronner.com/dymoprint/
3) http://www.draisberghof.de/usb_modeswitch/
-- 
Torfinn Ingolfsen 
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"