# Problem with Cups and Samsung ML-1640



## kerlin (Oct 7, 2014)

Good day to all FreeBSD users and developers!

I want to ask help with getting working USB printer with cups.
I'm connect fine from Windows client to that printer with url: http://192.168.1.240:631/printers/ml1640
But when I send any task to printer, it just appears in cups web interface with status: 
	
	



```
Waiting for printer to become available.
```

I'm trying various USB cables and USB ports and nothing changes. And with that cables on windows that printer works fine.

/var/log/messages

```
Oct  3 19:06:37 KOREICY-BSD kernel: ugen0.2: <Samsung Electronics Co., Ltd.> at usbus0
Oct  3 19:06:37 KOREICY-BSD kernel: ulpt0: <Samsung Electronics Co., Ltd. ML-1640 Series, class 0/0, rev 1.10/1.00, addr 2> on usbus0
Oct  3 19:06:37 KOREICY-BSD kernel: ulpt0: using bi-directional mode
```

I have copied ml1640.ppd from /usr/local/share/cups/model/samsung/ to /usr/local/share/cups/model/ and  /usr/local/etc/cups/ppd

*System*

```
FreeBSD KOREICY-BSD 10.1-BETA3 FreeBSD 10.1-BETA3 #0: Sun Sep 28 23:12:15 MSK 2014     kor@KOREICY-BSD:/usr/obj/usr/src/sys/BSD  amd64
```

/etc/rc.conf

```
dbus_enable="YES"
avahi_daemon_enable="YES"
cupsd_enable="YES"
```

`kldstat`

```
34    1 0xffffffff80ca1000 3f48     uhid.ko
35    1 0xffffffff80ca5000 3410     amdtemp.ko
36    1 0xffffffff80ca9000 aeb0     uhci.ko
37    1 0xffffffff80cb4000 a3f0     ohci.ko
38    1 0xffffffff80cbf000 d058     ehci.ko
39    1 0xffffffff80ccd000 d138     xhci.ko
40    1 0xffffffff80cdb000 7ee0     kbdmux.ko
41    3 0xffffffff80ce3000 6ca28    vboxdrv.ko
42    2 0xffffffff80e11000 29b2     vboxnetflt.ko
43    2 0xffffffff80e14000 9158     netgraph.ko
44    1 0xffffffff80e1e000 1602     ng_ether.ko
45    1 0xffffffff80e20000 3f64     vboxnetadp.ko
46    1 0xffffffff80f58000 15b4     fdescfs.ko
47    1 0xffffffff80f5a000 ed7      ulpt.ko
```

*packages*

```
cups-base-1.7.3_1              Common UNIX Printing System: Server
cups-client-1.7.3_2            Common UNIX Printing System: Library cups
cups-image-1.7.3_1             Common UNIX Printing System: Library cupsimage
splix-2.0.0_6                  CUPS printer drivers for Samsung Printer Language printers
gutenprint-base-5.2.10         GutenPrint Printer Driver
```

/usr/local/etc/cups/printers.conf

```
# Printer configuration file for CUPS v1.7.3
# Written by cupsd on 2014-10-03 18:59
# DO NOT EDIT THIS FILE WHEN CUPSD IS RUNNING
<DefaultPrinter ml1640>
UUID urn:uuid:63231b61-6fee-3594-523b-4b678fdd1ba8
Info Samsung ML-1240 gdi
MakeModel Samsung ML-1640, SpliX V. 2.0.0
DeviceURI usb:/dev/ulpt0
State Idle
StateTime 1412339045
Type 12372
Accepting Yes
Shared Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy stop-printer
</Printer>
```

/usr/local/etc/cups/cupsd.conf

```
# Show troubleshooting information in error_log.
LogLevel debug
# Allow remote access
Port 631
Listen /var/run/cups.sock
# Share local printers on the local network.
Browsing Off
BrowseLocalProtocols
DefaultAuthType Basic
WebInterface Yes
<Location />
  # Allow shared printing...
  Order allow,deny
  Allow all
</Location>
<Location /admin>
  AuthType Default
</Location>
<Location /admin/conf>
  AuthType Default
  Require user @SYSTEM
</Location>
<Policy default>
  JobPrivateAccess default
  JobPrivateValues default
  SubscriptionPrivateAccess default
  SubscriptionPrivateValues default
  <Limit Create-Job Print-Job Print-URI Validate-Job>
    Order deny,allow
  </Limit>
  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document>
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>
  <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default CUPS-Get-Devices>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>
  <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After Cancel-Jobs CUPS-Accept-Jobs CUPS-Reject-Jobs>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>
  <Limit CUPS-Authenticate-Job>
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>
  <Limit All>
    Order deny,allow
  </Limit>
</Policy>
<Policy authenticated>
  JobPrivateAccess default
  JobPrivateValues default
  SubscriptionPrivateAccess default
  SubscriptionPrivateValues default
  <Limit Create-Job Print-Job Print-URI Validate-Job>
    AuthType Default
    Order deny,allow
  </Limit>
  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document>
    AuthType Default
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>
  <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>
  <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After Cancel-Jobs CUPS-Accept-Jobs CUPS-Reject-Jobs>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>
  <Limit Cancel-Job CUPS-Authenticate-Job>
    AuthType Default
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>
  <Limit All>
    Order deny,allow
  </Limit>
</Policy>
```

Rights to printer device granted to root:cups

```
crw-rw----  1 root  cups  0x78  3 окт 19:06 /dev/ulpt0
```

Log messages when I send task from Win client to printer
/var/log/cups/error_log

```
D [03/Oct/2014:19:35:52 +0600] [Client 13] POST /printers/ml1640 HTTP/1.1
D [03/Oct/2014:19:35:52 +0600] cupsdSetBusyState: newbusy="Active clients, printing jobs, and dirty files", busy="Printing jobs and dirty files"
D [03/Oct/2014:19:35:52 +0600] [Client 13] No authentication data provided.
D [03/Oct/2014:19:35:52 +0600] [Client 13] 1.0 Get-Printer-Attributes 11
D [03/Oct/2014:19:35:52 +0600] Get-Printer-Attributes http://192.168.1.240:631/printers/ml1640
D [03/Oct/2014:19:35:52 +0600] [Client 13] Returning IPP successful-ok for Get-Printer-Attributes (http://192.168.1.240:631/printers/ml1640) from 192.168.1.114
D [03/Oct/2014:19:35:52 +0600] [Client 13] Content-Length: 6735
D [03/Oct/2014:19:35:52 +0600] [Client 13] cupsdWriteClient error=0, used=0, state=HTTP_STATE_POST_SEND, data_encoding=HTTP_ENCODING_LENGTH, data_remaining=6735, response=0x8040ae2c0(IPP_IDLE), pipe_pid=0, file=-1
D [03/Oct/2014:19:35:52 +0600] [Client 13] Writing IPP response, ipp_state=DATA, old wused=0, new wused=0
D [03/Oct/2014:19:35:52 +0600] [Client 13] bytes=0, http_state=0, data_remaining=0
D [03/Oct/2014:19:35:52 +0600] [Client 13] Waiting for request.
D [03/Oct/2014:19:35:52 +0600] cupsdSetBusyState: newbusy="Printing jobs and dirty files", busy="Active clients, printing jobs, and dirty files"
D [03/Oct/2014:19:35:52 +0600] [Client 13] POST /printers/ml1640 HTTP/1.1
D [03/Oct/2014:19:35:52 +0600] cupsdSetBusyState: newbusy="Active clients, printing jobs, and dirty files", busy="Printing jobs and dirty files"
D [03/Oct/2014:19:35:52 +0600] [Client 13] No authentication data provided.
D [03/Oct/2014:19:35:52 +0600] [Client 13] 1.0 Get-Jobs 10
D [03/Oct/2014:19:35:52 +0600] Get-Jobs http://192.168.1.240:631/printers/ml1640
D [03/Oct/2014:19:35:52 +0600] [Client 13] Returning IPP successful-ok for Get-Jobs (http://192.168.1.240:631/printers/ml1640) from 192.168.1.114
D [03/Oct/2014:19:35:52 +0600] [Client 13] Content-Length: 843
D [03/Oct/2014:19:35:52 +0600] [Client 13] cupsdWriteClient error=0, used=0, state=HTTP_STATE_POST_SEND, data_encoding=HTTP_ENCODING_LENGTH, data_remaining=843, response=0x8040ae2c0(IPP_IDLE), pipe_pid=0, file=-1
D [03/Oct/2014:19:35:52 +0600] [Client 13] Writing IPP response, ipp_state=DATA, old wused=0, new wused=0
D [03/Oct/2014:19:35:52 +0600] [Client 13] bytes=0, http_state=0, data_remaining=0
D [03/Oct/2014:19:35:52 +0600] [Client 13] Waiting for request.
D [03/Oct/2014:19:35:52 +0600] cupsdSetBusyState: newbusy="Printing jobs and dirty files", busy="Active clients, printing jobs, and dirty files"
D [03/Oct/2014:19:35:57 +0600] [Job 8] libusb_get_device_list=0
I [03/Oct/2014:19:35:57 +0600] Saving job.cache...
D [03/Oct/2014:19:35:57 +0600] cupsdSetBusyState: newbusy="Printing jobs", busy="Printing jobs and dirty files"
I [03/Oct/2014:19:35:57 +0600] [Job 8] Waiting for printer to become available.
D [03/Oct/2014:19:36:02 +0600] [Job 8] libusb_get_device_list=0
I [03/Oct/2014:19:36:02 +0600] [Job 8] Waiting for printer to become available.
```


----------



## wblock@ (Oct 7, 2014)

I don't use CUPS, but some printers prefer the non-resetting USB printer device.  Where it says /dev/ulpt0, try /dev/unlpt0 instead.


----------



## ColdfireMC (Oct 9, 2014)

*I* have a *S*amsung ML-1740 and *I* can't configure it properly either. I only know that i have to install Splix, but CUPS still is incapable to detect my printer.


----------

